LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA Read gets incorrect data from serial connection

Okay, would you be able to point me in the right direction for how to keep up with the flow of data? 

 

I've added a simple error handler at the end of the error stream. It can be seen in the attached. 

0 Kudos
Message 11 of 18
(2,143 Views)

If your buffer is getting stuffed that much I would really like to see a sippet of the code with the strings shoing display style (running 2013sp1 at work so I can't open the vi)  I expect there are some 0x0A's and some unprintable chars in the data.

 

@ Kelly-  Why are you "Opening" an open VISA session?  Select that Ctrl+Space Ctrl+Shift+R.  You don't need it


"Should be" isn't "Is" -Jay
0 Kudos
Message 12 of 18
(2,142 Views)
Assuming that the device is streaming data continuously and you have 1stop bit, 8 data bits and no parity, 12000 characters is about 12.5 seconds of data. Did you have execution highlighting turned on by any chance?

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 13 of 18
(2,139 Views)

@hp43 wrote:

One thing I've used to try and detect what's going on is the VISA Bytes At Serial Port property node within the while loop, and it is about 12,000. Not sure is this is expected / okay? 


If you are actually using the termination character, get rid of that wait in the loop.  The VISA Read waiting for data will limit the rate of the loop, so there is no need to have the wait.  That wait is likely what is keeping you from being able to keep up with the data stream.


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
0 Kudos
Message 14 of 18
(2,137 Views)

@Jeff,

 

I was just showing error handling.  I didn't even look at the rest of the code closely enough to notice the VISA Open not needed.

 

Kelly Bersch
Certified LabVIEW Developer
Kudos are always welcome
0 Kudos
Message 15 of 18
(2,113 Views)

@crossrulz wrote:

@hp43 wrote:

One thing I've used to try and detect what's going on is the VISA Bytes At Serial Port property node within the while loop, and it is about 12,000. Not sure is this is expected / okay? 


If you are actually using the termination character, get rid of that wait in the loop.  The VISA Read waiting for data will limit the rate of the loop, so there is no need to have the wait.  That wait is likely what is keeping you from being able to keep up with the data stream.


Ok, when I remove the Wait funciton the number of bytes at serial port reduces to 0 (though there are still erroneous measurements). However, the program is also unstable and causes my computer to blue screen. Should the Baud rate be reduced further? 

 

Mike - execution highlighting is not on. 

 

 

0 Kudos
Message 16 of 18
(2,106 Views)

Exactly what instrument are you using this with?

 

Kelly Bersch
Certified LabVIEW Developer
Kudos are always welcome
0 Kudos
Message 17 of 18
(2,100 Views)

@kbbersch wrote:

Exactly what instrument are you using this with?

 


It is a Freescale FRDM-KL25Z, using the OpenSDA port, communicating with a Kinetis K-series serial to usb chip. 

0 Kudos
Message 18 of 18
(2,095 Views)