#This script shows the use of the serial tester via TCP #Create a tcp serial tester and assign it to the server variable #To use RS-232 change this to "rs232" server = new Serial("TCP") #open server port 65500 # - To use RS-232 change this to , e.g. 1,115200 # - If you want flow control on the RS-232 comms use ,,"CTS" server.open(65500) #Create another tcp serial tester and assign it to the client variable #To use RS-232 change this to "rs232" client = new Serial("TCP") #connect to the server on the localhost port 65500 # - To use RS-232 change this to , e.g. 2,115200 # - If you want flow control on the RS-232 comms use ,,"CTS" client.open("localhost",65500) server.send("Hello from the server\n") client.waitfor(10,"Hello from the server") client.send("Hello from the client\n") server.waitfor(10,"Hello from the client") server.send("10.3 11\n") val = client.scanf(10,"%g %d\n") client.close() server.close() delete server delete client if (val[0] == 10.3) and (val[1] == 11) then result "Received values from server correctly" passed else result "Received values from server correctly" failed endif sleep(2)