Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Arduino Serial Communication - I am not able to view the complete string!

Solved!
Go to solution

Here I am not able to read the complete string. My string is 44 character long from arduino. But whenever I run the program the length I observe is random but never 44

 

Serial Port Communication.png

 

Front Panel

Where it can be seen that length of the string is not 44.

Serial Port Communication Front Panel.PNG

0 Kudos
Message 1 of 2
(166 Views)
Solution
Accepted by topic author BhargavRJ

DO NOT USE THE BYTES AT PORT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! (still not enough emphasis)

 

Simply put, just tell the VISA Read to read more bytes than you expect in a message.  In this case, I would probably use 100 just to be safe.  With the termination character enabled, the read will end when the Line Feed (by default) is read.

 

For more information go watch this: VIWeek 2020/Proper way to communicate over serial


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 2
(138 Views)