NUERA project template offers readily available data server, command server, PLC server, image server in
order to exchange different type of information through TCP Communication.
Follow simple steps given below to configure Command Server.
Step 1: Enable Command Server (if not already enabled)
The command server can be enabled or disabled by using the definition CMD_SERVER_ENABLED in sys_constants.hpp.
Step 2: Configure Command Server (if needed)
In TCP, the server listens for connection requests from clients at a specific port. By default, the Port Number for the Command server is given in sys_constants.hpp. Navigate to file src >> system_configurations >> sys_constants.hpp. Many constants are defined in this header file. Find CMD_SERVER_PORT. By default, it is defined as 7893. This can be changed as per your requirement. Remember that in Step 4, we will use this port number as the TCP client end to connect to this command server. The Buffer Size and Data Timeout of the data server can also be changed in this file.
Step 3: Add code to Receive Command
Navigate to file src >> application >> application.cpp. Find and open the manage_cmd_srvr(). The Command server can be used to receive commands from the user, and perform the command appropriately. The code is shown below:
Call the recv_data() , passing the character array as first parameter and number of characters as second parameter, to receive a command through the network from the other device using TCP.
Step 4: Observe Output (on Hercules)
Connect a Windows System to the same network as NUERA. Open Hercules on the Windows System. Go to the TCP Client pane. Set the Module IP as the IP address of the NUERA camera. Set the Port field according to the data port as set in Step 2. Then, click Connect
button. After a “Connected” message, the data we are sending from Hercules will be received by the NUERA camera and the threshold value is updated as can be seen in the images in web GUI.
For any further assistance, please contact our application engineer at email@example.com