MBLogic for an open world in automation
SBPoll is a simple SAIA Ether SBus command line client with the following features:
The following SBus commands are supported:
SBPoll will come as an archive file in "tar-gz" (most platforms) or "zip" (MS-Windows) formats. The MS-Windows version has the special new-line character combination (CR-LF) required by that platform, but is otherwise identical to the standard version.
Extract the archive file into the desired location. SBPoll doesn't care where you place it.
This is the language support for Python which is required for SBPoll to run. SBPoll has been tested with version 2.5 and 2.6. Other versions may work but have not been tested. For Linux, Python is often already installed. If not, it can normally be installed from the distro's package manager. For MS-Windows, Python can be downloaded from http://www.python.org
Address, command codes, and other values are specified by means of command line parameters. If a parameter is omitted, its default value is used. The parameters are:
|h||Host name of the Ether SBus server||localhost|
|p||Port number of the Ether SBus server||5050|
|t||Receive time-out in seconds||60 (minimum = 1)|
Note: -h (host). For SBPoll, this is the IP address or domain name.
|a||Address (SBus memory)||0|
|q||Quantity of addresses||1|
|r||Repeats. Number of times to perform the poll.||1|
|y||Delay time between repeats (in millseconds)||1|
|d||Data to send to the server.||0000|
|s||Silent mode. 'Y' or 'y' will suppress displaying data.||'n'|
Note: Actual delay time is affected by the resolution of the operating system process scheduler.
The following command line return codes are defined:
|2||Bad command line.|
|3||Program was terminated from keyboard.|
|4||Invalid data for SBus command.|
|5||Error communicating with host.|
|6||Invalid SBus parameters.|
SAIA SBus has a number of concepts similar to Modbus, but has several different characteristics.
SBPoll is normally used from the command line. For Linux, the syntax is::
For Microsoft Windows, the syntax is::
c:\python26\python sbpoll.py (parameters)
A typical example is::
./sbpoll.py -h 192.168.10.1 -p 5050 -t 10 -c 14 -a 6789 -q 1 -n 45 -d 0123abcd
The above example polls the Ether SBus server at UDP/IP address 192.168.10.1 using port 5050 and sets a time out of 10 seconds. It requests command 14 (write registers), address 6789, and station address 45. It requests to write data 0123abcd.
Another example is::
./sbpoll.py -h localhost -p 502 -c 2 -a 6 -q 24
The above polls the server at localhost (located on the same computer as SBPoll), port 5050. It requests command 2 (read flags), flag address 6, quantity 24. It uses the default values for all other parameters.