User Tools

Site Tools


uphp:functions:mb_set_dev_var

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_set_dev_var [2017/05/08 14:34]
jeff
uphp:functions:mb_set_dev_var [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">mb_set_dev_var ( <span style="color:black">mb_set_dev_var (
Line 21: Line 20:
 <span style="color:blue">$value <span style="color:blue">$value
 <span style="color:black">) <span style="color:black">)
-</html> +</html></well>
-</well>+
  
 ====Parameters==== ====Parameters====
Line 30: Line 28:
 <html><b><span style="color:blue">$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">$variable<span style="color:black"></b></html>:  Parameter to set+<html><b><span style="color:blue">$variable<span style="color:black"></b></html>:  Parameter to set
 + 
 +This can be the register name, one of the predefined parameters such as "name", "slave_id", "delay", or a role value by passing "roleX" where is X is a number between 0 and the number of roles -1 for that driver.  This will allow you to set a role value which may span two registers (such as a float or unsigned) in one go.  It will take care of sending the appropriate Modbus command to update the value in the device itself.
  
 <html><b><span style="color:blue">$value<span style="color:black"></b>:  Value to set for the <b><span style="color:blue">variable<span style="color:black"></b></html> <html><b><span style="color:blue">$value<span style="color:black"></b>:  Value to set for the <b><span style="color:blue">variable<span style="color:black"></b></html>
  
-====Return Value====+====Return Values====
  
 <html><b><span style="color:green">Integer<span style="color:black"></b></html>: 1=OK <html><b><span style="color:green">Integer<span style="color:black"></b></html>: 1=OK
Line 42: Line 42:
 [[mb_add_dev()]] - Add a device to the list of polled devices [[mb_add_dev()]] - Add a device to the list of polled devices
  
-[[mb_delete_device()]] - Delete a device from the list of active devices+[[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_id()]] - Return modbus device details by ID
Line 60: Line 60:
 [[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 rs485 bus and get but ignore the reply+[[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 66: Line 66:
 [[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_set_val_by_role()]] - Set a role value on a modbus device [[mb_set_val_by_role()]] - Set a role value on a modbus device
uphp/functions/mb_set_dev_var.1494254042.txt.gz · Last modified: 2021/09/13 05:56 (external edit)