19
OPERATION MANUAL
request_echo_check:
sends the MbTCPCommand object as a byte array and waits for the received MbTCPCommand
after that the received MbTCPCommand object is compared with the expected object
send_obj = MbTCPCommand(bytearray([0x41]), 0xFF)
expected_recv_obj = MbTCPCommand(bytearray([0x41]), 0xFF)
Example: ret = mb.request_echo_check(send_obj, expected_recv_obj)
MbTCPCommand object
Namespace: from softcheck.mb_commands import MbTCPCommand
To construct a new MbTCPCommand class - which is used for ModbusTCP commands - the
following arguments are needed:
The 1st parameter is the bytearray of user_data. This must be at least the modbus
function code.
As 2nd parameter the unit identifier (1 byte) has to be set.
As 3rd parameter the transaction identifier (2 bytes) can be specified.
As 4th parameter the protocol identifier (2 bytes) can be specified. ModbusTCP needs
0x0000 for protocol identifier.
Example: mb_command = MbTCPCommand(bytearray([0x41]), 0xFF)
MbFunc object
Namespace: from softcheck.mb_commands import MbFunc
Class contains static methods specially for the huber defined modbus functions
5.6 ComStore Object (storing information from a device in a
file)
Namespace: from softcheck.logic import ComStore
With this object data traces can be stored in a file.
Example:
comstore = ComStore(fi ".txt")
com.send("TI?\r\n")
com.store_string(comstore, "TI?\r\n")
com.store_answer(comstore)
store_string:
This command saves a arbitrary string in a file maintained by the ComStore object.
com.store_string(comstore, "TI?\r\n")
store_answer:
This command saves the answer from a device in a file maintained by the ComStore ob-
ject.
com.store_answer(comstore)
pySoftcheck.01.20171002.2
Liability for errors and misprints excluded.
pySoftcheck
Summary of Contents for Pilot ONE
Page 1: ...Operation Manual ...
Page 2: ......