module - Module Management
Description
The module command manages hardware modules in the Accordion system. It allows you to load, unload, configure, and inspect modules and their settings.
Syntax
module [options]
Optional Options
| Option | Short | Description |
|---|---|---|
--module |
-m |
The module name to activate/deactivate |
--file |
-f |
Path to the file containing module definitions |
--rename |
-r |
Clone and rename the module before loading |
--key |
-k |
Key for initial data to change (must be paired with value) |
--value |
-v |
Value for initial data to change (must be paired with key) |
--deactivate |
-d |
Flag to deactivate (unload) the module |
Examples
List Available and Loaded Modules
module
Load a Module
module --module "PMBus_Engine"
Load Module from Custom File
module --module "PMBus_Engine" --file "C:\configs\modules.xml"
Clone and Rename Module
module --module "I2C_Device" --rename "I2C_Device_Clone"
Load Module with Custom Setting
module --module "ADC_Module" --key "SampleRate" --value "1000"
Unload a Module
module --module "PMBus_Engine" --deactivate
Output Format
Available Modules Section
Available Modules:
PMBus_Engine
AssemblyPath : additional/PmbusEngine/PMBusEngine.dll
ClassName : Pmbus
Namespace : PmbusEngine
ImageName : pmbus.png
InitialData :
I2CAddress : 0x50
DeviceType : LTC3880
Loaded Modules Section
Loaded Modules:
PMBus_Engine
GPIO_Controller
ADC_Module
Affected Channels Section
Affected channels:
PMBus_Engine.VOUT_COMMAND
PMBus_Engine.IOUT_MEASURED
PMBus_Engine.STATUS_WORD
Output Colors
- Dark Green: Available module names
- Gray: Module property details
- Blue: InitialData section header
- White: InitialData key-value pairs
- Dark Yellow: Loaded module names
- Green: Affected channel names
Module Properties
Each module has the following properties:
| Property | Description |
|---|---|
| Name | Module identifier |
| AssemblyPath | Path to the DLL file |
| ClassName | Class name within the assembly |
| Namespace | Namespace of the module class |
| ImageName | Associated icon/image file |
| InitialData | Dictionary of configuration parameters |
Loading Behavior
When loading a module:
- If no file specified, uses existing module definitions
- If file specified, reads module definitions from file
- If rename specified, creates a clone with new name
- If key/value specified, overrides InitialData settings
- Enables the module
- Loads into hardware manager
- Refreshes channel list
- Displays affected channels
Cloning Modules
Cloning allows multiple instances of the same module:
# Create two instances of I2C device driver
module -m "I2C_Device" -r "I2C_Dev_0x50" -k "Address" -v "0x50"
module -m "I2C_Device" -r "I2C_Dev_0x51" -k "Address" -v "0x51"
InitialData Configuration
Modules can have configurable initial data:
# Configure sample rate
module -m "ADC_Module" -k "SampleRate" -v "1000"
# Configure I2C address
module -m "I2C_Driver" -k "DeviceAddress" -v "0x48"
Note: Key and value must be provided together.
Unloading Modules
Unloading removes a module and its channels:
module --module "PMBus_Engine" --deactivate
After unloading:
- Module is removed from loaded list
- Associated channels are removed
- Resources are freed
Use Cases
List All Modules
# See what's available and what's loaded
module
Standard Module Loading
# Load PMBus engine
init --host 192.168.1.100
module --module "PMBus_Engine"
list --filter "PMBus.*"
Multiple Device Instances
# Load multiple temperature sensors
module -m "TempSensor" -r "TempSensor_CPU" -k "I2CAddr" -v "0x48"
module -m "TempSensor" -r "TempSensor_GPU" -k "I2CAddr" -v "0x49"
Custom Configuration
# Load module from specific config file
module -m "CustomDevice" -f "D:\configs\custom_modules.xml"
Cleanup
# Unload unused modules
module -m "TestModule" -d
module -m "DebugModule" -d
Module Files
Module definition files are typically XML format containing:
- Module name and description
- Assembly path and class information
- Default InitialData values
- Channel definitions
Error Handling
Common errors:
- Module not found: Module doesn't exist in available modules list
- Key without value: Key and value must be provided together
- File not found: Module definition file doesn't exist
- Module already loaded: Cannot load duplicate module (use rename)
- Unload failed: Module may be in use or dependencies exist
Performance Considerations
- Loading modules refreshes the channel list
- Large modules may take several seconds to load
- Unloading is typically fast
- Channel queries are faster with fewer loaded modules
Best Practices
- List before loading: Check available modules first
- Use meaningful names: When cloning, use descriptive names
- Unload unused modules: Free resources when modules not needed
- Verify channels: Check affected channels after loading
- Document settings: Keep track of InitialData customizations
Notes
- Requires an active connection (use
initfirst) - Some modules have dependencies
- Module order may matter for some configurations
- Changes persist until reset or manual unload