11-27-2018 04:33 AM
Hey Guys!
I'm using an Arduino Due to send measurement data to my myRIO1900 via the UART Port. The setup worked when I had the Arduino connected to my PC via USB cable and my LabVIEW code run on my PC as well. I then transferred the LabVIEW VI to the myRIO and changed the Serial port. I connected the Arduino Due with the RX/TX Pins and unplugged the USB cable. The Arduino shows at first the expected behaviour and displays my measurement data. After a while (10s) it seems like the RX Port of the myRIO stops reading new data (its Buffer is not full - I check that with the "bytes at Port" Node). When I restart the VI it does exactly the same and stops in lack of data after approx. 10s again.
Does anyone have an idea what is the reason for my data stopping after that short period?
Thanks for your help!
Tobi
Solved! Go to Solution.
11-27-2018 06:11 AM
@Tobyphone67 wrote:
Does anyone have an idea what is the reason for my data stopping after that short period?
Most likely a bug in your code. Unfortunately, we cannot check that since you did not supply your code.
11-27-2018 06:22 AM
Here is the part of the code in which the problem occurs. The same part works on my PC but on the myRIO, like described above, after ca. 10s the data stream to the UART Port stops. I hope this helps?
12-04-2018 08:57 AM
Hey Guys!
I have now discovered that my Arduino keeps sending data. So the problem must be on the myRIO side. It simply stops receiving the data at the Port. The buffer is just empty at a certain point. Does anyone have any idea? The code where this happens is still the same (see above).
12-05-2018 01:00 AM
Okay I think I was able to solve the problem though I don't really understand my solution. I did change the required number of bytes at the port to read the port. I changed it to >0 and works now. I am still reading 6 bytes in my serial read part though.
I am expecting packages of 6 bytes each. That's why I used the "bytes at port" node to check if everything has arrived prior to reading all 6 of them. Obviously my understanding was incomplete at this point. It still reads 6 bytes at a time which makes it working for my solution.
I couldn't answer one question though: why, if bytes keep arriving, does my "bytes at port" node say (at a certain point) that there are no new bytes at the port?