17
OPERATION MANUAL
As 3rd parameter the verbosity level can be given. "1" means that the program ex-
plains what goes wrong in case of an error.
4th parameter: When set to True (default), the program throws an exception in case of
an error, otherwise the program goes on.
int2hex:
converts a value to a LAI hex string (without 0x and leading zeros)
The 1st parameter is the value that is given (integer)
The 2nd parameter are the number of bytes the result should use
As return value one can get the hex string without leading 0x and leading zeros
lai.int2hex(1500, 2)
hex2int:
converts a LAI hex string (value) to an integer
The first parameter is the hex string that is to be converted to an int (e.g. re-
ceived from peer)
If the second parameter is True the returned value will be signed (default), if False
it will be unsigned
the return value is the int value of the given hex string
lai.hex2int("A012") # signed value
lai.hex2int("A012", False) # unsigned value
send:
sends a LAI command with a certain value
The first argument is the LAI command to send, the second one the value.
lai.send("G", "E0****")
check:
checks if the value of a LAI command is like expected
The first argument is the command to check, the second the value of the LAI command
expected.
Return value True if check is o.k.
lai.send("V")
lai.check("Pilot ONE-Trainee V1.0")
check_regex:
checks if the value of a LAI command is like expected
The first argument is the command to check, the second the regular expression of the
LAI command expected.
Return value True if check is o.k.
lai.send("G", "C0****")
# O: off, 0: no Alarm, tttt: setpoint, iiii: internal temp., dddd: external temp.
lai.check_regex(r"O0[0-9A-F]{4}[0-9A-F]{4}[0-9A-F]{4}")
check_hex:
checks if the hex value (string) of a lai command is like expected
The first argument is a hex value (part of the LAI command) to check, the second the
int value to compare against the hex_string
Return value True if check is o.k.
lai.send("G", "C0****")
# O: off, 0: no Alarm, tttt: setpoint, iiii: internal temp., dddd: external temp.
lai.check_regex(r"O0[0-9A-F]{4}[0-9A-F]{4}[0-9A-F]{4}")
string = lai.get_last_value()
lai.check_hex(string[2:6], 1500)
check_hex_range:
checks if the hex value (string) of a lai command is in the range expected
The 1st argument is a hex value (part of the LAI command) to check
The 2nd parameter is the minimum value allowed and the 3rd parameter is the maximum
value allowed
Returns True if everything is o.k., False otherwise
lai.send("G", "C0****")
# O: off, 0: no Alarm, tttt: setpoint, iiii: internal temp., dddd: external temp.
lai.check_regex(r"O0[0-9A-F]{4}[0-9A-F]{4}[0-9A-F]{4}")
string = lai.get_last_value()
lai.check_hex_range(string[6:10], 1000, 3000)
get_last_value:
Returns the last value received. This can be useful if one sends a string with
"send", checks the received string with "check" and wants to use the answer further.
see above
pySoftcheck.01.20171002.2
Liability for errors and misprints excluded.
pySoftcheck
Summary of Contents for Pilot ONE
Page 1: ...Operation Manual ...
Page 2: ......