Inhaltsverzeichnis

drivers:rtd_dsxll_tng

A rebuild of the old asynchronous rtd_dsxll driver with event and abstraction support.

config

abstracts

URI structure

/<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]

additional URI's

examples

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

Bus "blocking"

It's possible to block the bus via invoke:

invoke "/<driver_name>/_bus/block" <bool>

Proxy

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.

Cached reading

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])

"Vortex" - filesystem

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])

special modules / abstracted access