User Tools

Site Tools


uphp:functions:mb_add_dev

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
uphp:functions:mb_add_dev [2017/05/04 14:57]
jeff
uphp:functions:mb_add_dev [2021/09/13 05:57] (current)
Line 7: Line 7:
 ====Description==== ====Description====
  
-<well size="sm"> +<well size="sm"><html>
-<html>+
 <span style="font-size:125%;color:green">int <span style="font-size:125%;color:green">int
-<span style="color:black"> +<span style="color:black">mb_add_dev (
-</html> +
-[[mb_add_dev]] ( +
-<html>+
 <span style="color:green">int <span style="color:green">int
-<span style="color:blue">$device_id<span style="color:black">,+<span style="color:blue">$id<span style="color:black">,
 <span style="color:green">int <span style="color:green">int
-<span style="color:blue">$device_type_id<span style="color:black">,+<span style="color:blue">$type<span style="color:black">,
 <span style="color:green">string <span style="color:green">string
 <span style="color:blue">$name<span style="color:black">, <span style="color:blue">$name<span style="color:black">,
Line 23: Line 19:
 <span style="color:blue">$poll_interval<span style="color:black">, <span style="color:blue">$poll_interval<span style="color:black">,
 <span style="color:green">int <span style="color:green">int
-<span style="color:blue">$status+<span style="color:blue">$status<span style="color:black">, 
 +<span style="color:green">int 
 +<span style="color:blue">$bus
 <span style="color:black">) <span style="color:black">)
-</html> +</html></well>
-</well>+
  
 ====Parameters==== ====Parameters====
  
-<html><b><span style="color:blue">$device_id<span style="color:black"></b></html>:  Device identification number (slave ID)+<html><b><span style="color:blue">$id<span style="color:black"></b></html>:  Device identification number (slave ID)
  
-<html><b><span style="color:blue">$device_type_id<span style="color:black"></b></html>:  Device type identification number+<html><b><span style="color:blue">$type<span style="color:black"></b></html>:  Device type identification number
  
 <html><b><span style="color:blue">$name<span style="color:black"></b></html>:  Device name <html><b><span style="color:blue">$name<span style="color:black"></b></html>:  Device name
Line 40: Line 37:
 <html><b><span style="color:blue">$status<span style="color:black"></b></html>:  Current device status <html><b><span style="color:blue">$status<span style="color:black"></b></html>:  Current device status
  
-====Return Value====+<html><b><span style="color:blue">$bus<span style="color:black"></b></html>:  Optional bus ID.  See table below. 
 + 
 +====Return Values====
  
 <html><b><span style="color:green">Integer<span style="color:black"></b></html>:  0=success, otherwise there was an error adding the device <html><b><span style="color:green">Integer<span style="color:black"></b></html>:  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==== ====See Also====
  
-[[getmbstat()]] - Return an array of modbus statistics+[[mb_delete_dev()]] - Delete a device from the list of active devices
  
-[[mb_delete_device()]] - Delete a device from the list of active devices+[[mb_get_dev_by_id()]] - Return modbus device details by ID
  
-[[mb_get_dev_by_id()]] - Return modbus device details for the specified ID+[[mb_get_dev_by_index()]] - Return modbus device details by index
  
-[[mb_get_dev_by_index()]] - Return modbus device details for the specified index+[[mb_get_dev_by_name()]] - Return modbus device details by name
  
-[[mb_get_dev_by_name()]] - Return modbus device details for the specified name+[[mb_get_dev_info()]] - Return modbus device details by type
  
-[[mb_get_dev_info()]] - Return modbus device details for the specified type +[[mb_get_role_array()]] - Return an <html><b><span style="color:green">array<span style="color:black"></b></html> of all roles and their values
- +
-[[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_status_by_role()]] - Return status of the device attached to the role
  
-[[mb_get_val_by_role()]] - Return value of the role in the system+[[mb_get_val_by_role()]] - Return value of the role
  
 [[mb_num_devices()]] - Return number of devices on the modbus [[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_complete()]] - Check to see if a modbus scan has completed
Line 70: Line 76:
 [[mb_scan_percent()]] - Return scan percentage completed [[mb_scan_percent()]] - Return scan percentage completed
  
-[[mb_send_command()]] - Send a sequence of characters to the rs485 bus and get a reply +[[mb_send_command()]] - Send a sequence of characters to the RS-485 bus and get a reply
- +
-[[mb_queue_command()]] - Queue a sequence of characters to send to the rs485 bus and get but ignore the reply+
  
 [[mb_set_dev_var()]] - Set a variable on a modbus device [[mb_set_dev_var()]] - Set a variable on a modbus device
uphp/functions/mb_add_dev.1493909858.txt.gz · Last modified: 2021/09/13 05:56 (external edit)