I’m writing an app in C# for Windows 10 IOT on a Raspberry Pi. I have implemented the API command set. The software connects to an FR8x relay board by TCP using one of two different paths that both exhibit the same problem. One path uses the Lantronix communication module directly, and the other uses the RS-232 communications module connected to a Digi PortServer TS. (We have used the Digi products and NCD relay boards successfully for more than a decade.)
The problem I am seeing is that the board intermittently fails to respond to status queries (DEC 124). The fact that the problem exists on both pathways leads me to believe that either (a) the command is being corrupted enroute, or (b) the board is either not receiving the command correctly or just not responding. TCP error detection would seem to make option (a) unlikely.
Is there a way to troubleshoot the problem further? Have you seen this issue before? The status queries are being sent at 2-second intervals to capture any relay settings that may have been changed by software using the alternate port. Is that interval rate too high? I’ve implemented a work-around, but the issue is consistent and I am curious about its origin.
What is the full packet of bytes you are sending to the board to read the status of the relays? A 124 byte by itself is not a valid command for the board. If you want to read the status of all 8 relays then the valid command is 170, 3, 254, 124, 1, 40
Hi, yes, the complete command in API format is six bytes: 170, 3, 254, 124, 1, 40.
What do you have the Digi Adapter baud rate set to and what do you have the Com Port connected directly over RS2323 baud rate set to? The default baud rate of the controller is 115200 so that is what your connections should be set to.
Have you connected to the controller from a Windows Computer and tried controlling the relays using Base Station just to verify there is nothing wrong with the hardware?
Lastly how are you powering the board? It needs to be powered by a regulated 12VDC power supply source.
I’ll answer in reverse order… I’m using a regulated DC power supply set to 12 VDC.
Yes, I’ve been using Base Station on the alternate interface and have noticed that when I click the READ Relay Bank Status (which sends the same command) I get no response (the software displays -1 in that case).
I’m using direct TCP to the Digi, not Realport, so there is no COM port on the computer to deal with. It works the same as the Lantronix interface. The port on the Digi is set to 115200.
I should note that 999 times out of 1000 the command returns a response. It’s just that occasional, intermittent, failure to respond that has me scratching my head.
I’m going to continue testing to try to isolate the problem between the board and the network. My access with the Base Station software is also via the network using the ProXR Command Set.
It’s hard to say what would be causing an intermittent issue like you’re describing. Generally communication with these boards is very reliable. Also a problem that happens that rarely(1 out of 1000) is hard to replicate and nail down for sure. It doesn’t sound like you are sending commands too often(once every 2 seconds), however can you ensure that you always wait for a response/timeout prior to sending another command to the board? If you send back to back commands without waiting for a response from the first occasionally packets can be dropped.