7
OPERATION MANUAL
3
Command reference
The actual scripting language is Python. Additional commands have been added to the Python library
to facilitate communication with the Huber thermostats and to make these independent from the in-
terface. This chapter describes these additional commands and their function.
3.1 Com object
The Com object manages the interfaces. A Com object must be created to select an interface.
Parameter 1 specifies the interface, e.g. “ethernet”, “modbustcp” or “serial”.
Parameter 2 specifies the timeout in seconds.
Parameter 3 specifies the “Verbosity Level”. “1” (default) specifies that a message is generated when
something goes wrong, i.e. when an error occurs. “2” additionally reports the sent and received
strings and “3” also reports the time of reception.
Parameter 4 specifies whether an error throws an exception (True - default) or whether the program
should continue (False).
The Com object only works with strings. To make it more comfortably when directly working with the
instruction set, please use the respective objects described below (e.g. the PbCom object for the re-
commended PB instruction set). However, if the Com object is used with modbustcp as interface,
bytearrays have to be used.
Examples:
com = Com("ethernet", 2.5)
generates a Com object for Ethernet with a timeout of 2.5 s.
send
The
send(message)
command sends the string contained in “message” to the selected interface.
Example:
com.send("{M00****\r\n")
queries the current setpoint.
send_bytes
The
send_bytes(message)
command sends the bytearray contained in “message” to the selected in-
terface.
Note: This should only be used for ModbusTCP.
Example:
com.send_bytes(bytearray([0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xFF, 0x41])
calls the
modbus communication test function.
check
The
check(expression)
command receives a string up to an End of Line from the selected interface
and verifies it against the text contained in expression. If these two do not match, an error message
is generated and the script currently running is terminated.
Only the number of characters in expression is verified. Other characters received from the inter-
face are ignored.
Examples:
com.check(’{M01’)
checks whether the first four characters of the character string “{M01” match.
com.check("\[S01G")
checks whether the character string starts with “[S01G”. (LAI instruction set).
pySoftcheck.01.20171002.2
Liability for errors and misprints excluded.
pySoftcheck
Summary of Contents for Pilot ONE
Page 1: ...Operation Manual ...
Page 2: ......