Basic simulator of the Haas NGC machine data collection protocol.
The Haas NGC controllers use a TCP server to communicate over networks. The NGC controller accepts queries in the format: ?Q### where ### is the query number.
The controller responds with a message starting with > and ending with \r\n
More detailed information about Haas NGC protocol can be found here
The simulator can be used to test data monitoring applications. The simple_server creates a socket that listens on port 5051, the default port for NGC protocol. The simple_server responds to queries with the example query response as per the machine data collection document
Run the simple_server python script:
python3 simple_server.py
>intializing...
>Haas server initialized at: 192.168.137.226 on port: 5051
>Waiting for incoming connections...
Then, from a different terminal, run:
telnet 192.168.137.226 5051
Once connected, query at will.
?Q100\n
>SERIAL NUMBER, 1234567
?Q200
>TOOL CHANGES, 35
The simple_client interacts with the simple_server by using Telnetlib and opening a Telnet session to interact with the server.