LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Wrong data from VISA


mkoppelgaard wrote:  Unfortunately my data often looks like this “øø^ñ 182,12 g”

Does it do that with many measurements or just the first one?  It is common to see this on the first reading due to the UART trying to synch up the start and stop bits, especially if the instrument is constantly sending data.


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 11 of 15
(909 Views)
You need to set the termination character to 0A. The string is cut off after 0D with the default and that will leave a character in the buffer which will eventually overflow. Unfortunately, you cannot set more than a single termination character.
0 Kudos
Message 12 of 15
(906 Views)

@Michael.Koppelgaard wrote:

Thank you Xilinx. NSmiley Very Happy

 

RavensFan: My data ends with 13 10.  I dont understand this "Make sure you enable the termination character in the Serial Configure and that you set it to carriage return (13 or x0D)" ? Where do I do this settling?

From time to time I recieve the error 1073676294. What can be the reason?


As Dennis pointed out, check the context help on the Serial Configure.

 

But if your data ends with bytes 13 and 10,  you are getting carriage return line feed.  So line feed (the default in the serial configure) is what you want.

 

That is not an error, but a warning.  The number of bytes transferred is equal to the requested input count. More data might be available.  I consider it an unnecessary message.  A programmer should know that if they get the exact number of bytes they asked for, there is always a chance there are more bytes in the buffer beyond that.  Heck, even if you requested 100 bytes, got 10 because that is where the termination character occurred, there could still be plenty more bytes left in the serial buffer.

0 Kudos
Message 13 of 15
(887 Views)

Dennis - you are right.! I correted it now.
The rubbish data: I dont see et after the VISA CLR have been added, but i still get the error code 1073676294. Maybe I should just ignore it course - the data is okay.

0 Kudos
Message 14 of 15
(883 Views)

As I said, that is a warning, not an error.  And you won't get that if you happen to wire a larger number into your VISA read.

0 Kudos
Message 15 of 15
(878 Views)