08-16-2022 11:19 AM
I am starting with a very basic program to test TCP write/read functionality before I make it more complicated. It appears that I can send commands OK to my DUT (device under test) , I am having problems with reading back responses from the device. Using Wireshark, I can see that the 3-bytes are actually received by the host computer (0x02 0x06 0x03 Acknowledge) , so firewall is not an issue, but they are not making it into labview read field. I have tried the different modes for read (standard, buffered, immediate) but none of these modes bear any fruit. Any ideas on how to fix this issue or debug this issue would be appreciated.
Solved! Go to Solution.
08-16-2022 11:57 AM
You should be using the "standard" mode, as that will wait up to the timeout for the number of bytes you specify.
08-16-2022 01:00 PM
Unfortunately, standard mode does not work.
08-17-2022 12:19 AM
@Froboz wrote:
Using Wireshark, I can see that the 3-bytes are actually received by the host computer (0x02 0x06 0x03 Acknowledge) , so firewall is not an issue
Maybe a software firewall? I don't know at what level they operate compared to Wireshark, but it certainly seems possible that Wireshark would be able to see packets which a software firewall then prevents another application from seeing.
08-17-2022 01:38 PM
Labview appears to be allowed in all cases:
but would there be a different layer I could be missing that would prevent data from coming through?
08-17-2022 02:08 PM
An Error 66 accompanies the failed read. This is what I came across regarding Error 66.
https://lavag.org/topic/13678-tcpip-error-code-66/
In the case of this individual, they get this error sporadically. In my case, I get it all the time when I attempt a read.
08-18-2022 02:12 AM - edited 08-18-2022 02:13 AM
To further debug the problem, it could be useful to bisect the problem. In the example library, there is a TCP Host/Listener example - can you get that to work? What if you create the socket outside of LabVIEW, e.g. from powershell (https://stackoverflow.com/questions/29759854/how-to-connect-to-tcp-socket-with-powershell-to-send-an...)? Can you use powershell to send packets to LabVIEW or receive packets from the device?
08-18-2022 11:01 AM
No, don't use power shell to create the connection and pass data to LabVIEW via that. You have a very clear error which indicates what is happening. Error 66 means the other side of the connection closed the connection. Why is the device you are connecting to closing the connection? In terms of your application you would need to handle this error and open a new connection to the device.
08-18-2022 04:18 PM
The issue with just using the Labview listener is that the code needs to be compatible with the device I am testing. The device requires a command to be sent to it. In this case the device will respond with 3-bytes which corresponds to an acknowledge.
I did download VS Code with Powershell and tried running a modified version of the link you sent. It's complaining the connected host has failed to respond 192.168.100.118:9760. Address and port look right. Something else to try to figure out.
08-18-2022 04:21 PM
Trust me, LabVIEW will be more than capable of communicating with that device. You do need to know and implement the device protocol correctly.