12
OPERATION MANUAL
2: Includes the Python library into the time functions. This sample requires it for the Sleep function
at the end of the script.
4: This line defines a function that contains the sequence of the test program. The name is freely se-
lectable.
6: Creates a Com object.
Caution! This call must be made before opening the interface.
7 – 10: Opens the interface for communication with the device. These lines list various examples for
the communication options available.
11: Specifies the timeout. The script generates an error message and aborts if no character is re-
ceived from the interface during the read operation within the set time - in this example, after 2.3
seconds.
17, 24, 30, 35: Sends a string via the interface. This example queries the internal temperature.
18: Displays the response received from the interface at the console.
25: Reads a message from the interface and checks whether it matches {S01.
31: Reads a message from the interface and checks whether it matches the transferred regular ex-
pression.
36 – 38: Receives a string from the interface and stores it in the variable “answer”, removes \r\n at
the end of the line and writes the response to the console.
40: Wait 5 seconds before another cycle is started.
41: Closes the interface. This function must be called at each exit of the script or before terminating
the script.
43: Calls the test function itself. The call must use the exact name defined in line 4.
pySoftcheck
Liability for errors and misprints excluded.
pySoftcheck.01.20171002.2