08-03-2017 04:56 AM
Hi,
I'm currently using TCP functions to communicate with my mbed, which is sending bytes of data regarding the current temperature to my vi and storing them as unsinged 8-bit integers in an array. This is working, and when the program terminates, the array displays numerous temperatures such as 20 degrees, 19 degrees, etc. However, even though this is working, I still get the error above (error 56: occurred at TCP read: the network operation exceeded the user-specified or system time limit. I have tried increasing the timeout on the second TCP read but to no avail. I'm really confused, because the data is sending to the VI however I am still receiving an error?
Also, a bonus question, is there anyway to store the temperature data one byte at a time? Currently, when the program sends the above error code, the array is filled with temperature data, but if I want to see them in real time and plot this on a waveform graph?
Thanks in advance
Joel
Solved! Go to Solution.
08-03-2017 08:23 AM
Looks like one of the examples from LabVIEW, you will need to adjust it a little.
The reason the example has two separate reads, is to do with how the "server" in the same example sends the data. It sends a single byte which contains the length of the remaining data. You will see that the first read just reads this byte, and uses it to request exactly that many more data bytes from the 2nd read. The function writing Q back the device at the end is also only part of the example, and not needed in your case.
In your case, I would guess that this probably isn't the format the data is being sent by the mbed (I'm not familiar with it).
There are some options:
1) Choose a number of bytes to read which corresponds to 1 datapoint (or a multiple of datapoints if you want to read more than 1 at a time). I recommend trying this option first, it will probably work.
2) See if the device sends some sort of termination character to signify the end of a datapacket, and set up labview to recognise this (Mode:CRLF for example) Only really needed if your data packets are unknown lengths.
Either way, delete the first TCP read function, and the TCP write which follows the loop. Remove the case structure (keep what was in the default case). Consider whether you need the 100ms wait function (TCP waits up to your timeout amount anyway)