======mb_add_dev======
WMPRO, WMMINI FW >= 1.0 WMMEGA FW >= 2.0
Add a device to the list of polled devices
====Description====
int
mb_add_dev (
int
$id,
int
$type,
string
$name,
int
$poll_interval,
int
$status,
int
$bus
)
====Parameters====
$id: Device identification number (slave ID)
$type: Device type identification number
$name: Device name
$poll_interval: Modbus polling interval
$status: Current device status
$bus: Optional bus ID. See table below.
====Return Values====
Integer: 0=success, otherwise there was an error adding the device
====Bus====
The bus number indicates which subsystem handles the modbus processing in Wattmon.
^ Bus ^ Description ^
| 0 | RS-485 Port (Default) |
| 1 | Virtual Device |
| 2-11 | Modbus TCP Channel 0-9 |
====See Also====
[[mb_delete_dev()]] - Delete a device from the list of active devices
[[mb_get_dev_by_id()]] - Return modbus device details by ID
[[mb_get_dev_by_index()]] - Return modbus device details by index
[[mb_get_dev_by_name()]] - Return modbus device details by name
[[mb_get_dev_info()]] - Return modbus device details by type
[[mb_get_role_array()]] - Return an array of all roles and their values
[[mb_get_status_by_role()]] - Return status of the device attached to the role
[[mb_get_val_by_role()]] - Return value of the role
[[mb_num_devices()]] - Return number of devices on the modbus
[[mb_queue_command()]] - Queue a sequence of characters to the RS-485 bus and get but ignore the reply
[[mb_scan_complete()]] - Check to see if a modbus scan has completed
[[mb_scan_percent()]] - Return scan percentage completed
[[mb_send_command()]] - Send a sequence of characters to the RS-485 bus and get a reply
[[mb_set_dev_var()]] - Set a variable on a modbus device
[[mb_set_val_by_role()]] - Set a role value on a modbus device
[[mb_start_scan()]] - Initiate an automatic scan of the modbus