8
OPERATION MANUAL
check_bytes
The
check_bytes(expected)
command receives a bytearray from the selected interface and verifies
it against the bytearray contained in expected. If these two do not match, an error message is gen-
erated and the script currently running is terminated.
Note: This should only be used for ModbusTCP.
Examples:
com.check_bytes(bytearray([0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xFF, 0x41])
checks
whether received bytearray is equal to the expected bytearray.
check_regex
The
check_regex(expression)
command works like the command
check
, but the difference is that
the passed expression may be a regular expression.
Please note that the string is prefixed with an “r”. A warning is generated if the answer does not
match as intended.
A special feature needs to be considered since regular expressions are valid in LAI commands: The
square bracket [ must be preceded by a backslash (\[) as it otherwise is considered part of the regu-
lar expression and is not sent via the interface. The \ itself is not sent ([ needs to be escaped with \).
Examples:
com.check_regex(r"TI [0-9]")
checks if the first two characters received are TI compliant, fol-
lowed by a space and then a number from 0 ... 9. As the two “[ ]” are part of the regular expression,
they must not be prefixed with “\”.
print_answer
print_answer
receives a string from the selected interface up to an End of Line and outputs it.
Examples:
com.send("SP?\r\n")
queries the current setpoint … (PP instruction set)
com.print_answer()
and displays the answer received at the console.
print_answer_bytes
print_answer_bytes
receives a bytearray from the selected and outputs it.
Note: This should only be used for ModbusTCP.
Examples:
com.send_bytes(bytearray([0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xFF, 0x41])
com.print_answer_bytes()
and displays the answer received at the console.
pySoftcheck
Liability for errors and misprints excluded.
pySoftcheck.01.20171002.2
Summary of Contents for Pilot ONE
Page 1: ...Operation Manual ...
Page 2: ......