Solution
There are many issues that can cause the expected data to not be received by the Instrument Addon Custom Device:
Connection settings
Double-check that you have specified the correct connection settings for the instrument you are trying to communicate with.
- For the TCP protocol, check that the IP address and remote port are configured correctly. If the VeriStand project is deploying without error, that means that VeriStand was able to establish the TCP connection with the instrument since you would get a connection error during deployment otherwise.
- For the RS-xxx protocol, ensure you are using an available COM port and that the serial configuration matches what the instrument expects.
- For the VISA protocol, check that the VISA Resource is configured correctly and matches what you have defined in NI MAX.
Command settings
- Check that the command you are sending is correct according to the device's user manual, including any required termination characters.
- To add a termination character to every message sent, go to the main page of the Instrument Addon in the System Explorer and check the box Append Write Termination Character. Make sure the correct termination character is specified in the Termination Character box. 0xA indicates the Line Feed character while 0xD indicates the Carriage Return character.
Response settings
- If Wait Type is set to "Wait sec", make sure the Wait sec Value is long enough for the instrument to respond.
- If you are still not getting a response, try setting Wait Type to "Byte Count" and specify the correct number of bytes expected from the instrument.
- Check that the Response Format matches what the instrument is sending and that you have correctly specified any response variables and data channels.
Other troubleshooting tools
In addition to the above steps, you can use other troubleshooting tools to narrow down the cause of the communication problem:
- Each Message you have defined in the custom device contains Message Channels. Some of these channels can be used to get diagnostic information from the custom device, such as Error Code, Message Status, and Timestamp. Refer to the custom device help in the System Explorer for more information on those channels.
- You can use Wireshark to view network communication for TCP and UDP sessions. If the project is deployed to a Linux RT Target, you can open an SSH session to the target, then install and use the TShark CLI utility to capture network communication. Filtering by the instrument's IP address and port will allow you to see communication between the custom device and the instrument.
- Use the VISA Test Panel in MAX to test communication with a VISA serial or TCP instrument.
- Serial port sniffers can help determine if serial commands and responses are being sent/received correctly.