A rebuild of the old asynchronous rtd_dsxll driver with event and abstraction support.
/<driver_name>/<slave_address>/<function_code>/<register_address>:<length>/<field>
uri-part | values | description |
---|---|---|
slave_address | int_hex(0..ff) | slave address of modbus device |
function_code | int_hex(3|4) | 3 - Holding 4 - Input |
register_address | int_hex(0000..ffff) | register address |
length | int_hex(0..x) | count of words to read, optional, default=1 |
field | <empty> | _raw | time | state | verbose | <empty> - value _raw - raw object time - request succeeded time state - last request state verbose - list of [time succeeded,valid value,last state,last request time,last value] |
URI | /mb_master/00/04/007b | /mb_master/0a/03/0005/verbose |
---|---|---|
slave_address | 00 | 0a (hex) = 10 (dec) |
function_code | 04 - InputRegister | 03 - HoldingRegister |
register_address | 007b (hex) = 123 (dec) | 0005 (hex) = 5 (dec) |
length | 1 | 1 |
field | verbose | |
description | read InputRegister @ address 123 from device 0 | return verbose state of HoldingRegister @ address 5 from device 10 |
It's possible to block the bus via invoke:
invoke "/<driver_name>/_bus/block" <bool>
If configured, it's possible to allow raw access to the network via some kind of proxy.
It can be started via:
invoke "/<driver_name>/proxy/start" <config> (None, {'connections': 0, 'current_password': 'wtrc5', 'running': True, 'current_port': 47838} )
And stopped via:
invoke "/<driver_name>/proxy/stop" (None, None)
Get port of proxy server:
read "/<driver_name>/proxy/current_port" (None, 49465)
Get state of proxy server:
read "/<driver_name>/proxy" (None, {'connections': 0, 'current_password': 'wtrc5', 'running': True, 'current_port': 47838})
The <config> can contain a 'port' and/or 'password' field which will override default settings.
Pretty similar to the default bus access, this method should be used when someone tries to avoid delays cos of the bus. The system simply returns the last read value and starts a new reading in the background.
Read a register, cached:
read "/<driver_name>/_cached/<slave>/<reg_type>/<register>" (None, {'t_added': 1394753565.617762, 't_read': None, 'value': None}) read "/<driver_name>/_cached/<slave>/<reg_type>/<register>/" (None, {'response_code': 0, 't_added': 1394753565.617762, 't_read': 1394753566.226623, 'value': [4]}) read "/<driver_name>/_cached/<slave>/<reg_type>/<register>/value" (None, [4]) read "/<driver_name>/_cached/<slave>/<reg_type>/<register>" (None, [4])
Some newer RTD- devices have a so called „Vortex“ filesystem which contains a lot of pointers and virtual objects which can be read and written.
If enabled the driver provides access to these objects.
#<slave_address> is the slave address as hex, for example 0f for device 15 /<driver_name>/<slave_address>/vortex/<...>
Typical requests look like this: Get a list of Vortex object types:
read "/<driver_name>/<slave_address>/vortex/" (None, '<VortexFS 0x7f04e017dc20>')
List „Site“ objects:
read "/<driver_name>/<slave_address>/vortex/Site/" (None, [0])
List objects of first „Site“ object:
read "/<driver_name>/<slave_address>/vortex/Site/0/" (None, ['NV']) read "/<driver_name>/<slave_address>/vortex/Site/0/NV/" (None, ['Site ID', 'Site Name'])
Read „Site ID“:
read "/<driver_name>/<slave_address>/vortex/Site/0/NV/Site ID" (None, [1, 0, 0, 0])
Read „Site Name“:
read "/<driver_name>/<slave_address>/vortex/Site/0/NV/Site Name" (None, 'FooBar')
Write „Site ID“ (data=[2,0,0,0]):
write "/<driver_name>/<slave_address>/vortex/Site/0/NV/Site ID" [2,0,0,0] (None, True) read "/<driver_name>/<slave_address>/vortex/Site/0/NV/Site ID" (None, [2, 0, 0, 0])