LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Wrong data from VISA

I reading data from a balance.

The balance is set to auto print which means that I print continually.

My data should look like “ 182.12 g”. The string should start with a space and end with a carriage return.

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

The RS232 settling for the balance should be 2400,none,7,1

What am I doing wrong?Capture.PNG

0 Kudos
Message 1 of 15
(1,351 Views)

increase your wait time step by step  untill you get no wired data also attach byte at port to number of byte to read instead of 200

0 Kudos
Message 2 of 15
(1,321 Views)

Hello mkoppelgaard,

 

why are you reading 200 bytes with the function VISA read? I think you don't need to read so much bytes.

 

Kind regards.

 

0 Kudos
Message 3 of 15
(1,318 Views)
The VISA Bytes at Serial Port should not be needed at all and specifying 200 bytes to read is perfectly fine. Neither of you must have much experience with serial communication.

mkoppelgard,

Do you see the same behavior when you use MAX or a program such as Putty?
0 Kudos
Message 4 of 15
(1,301 Views)

Try attached vi... I added a VISA CLEAR after initialisation. I hope the rubbish data disappears that way...  

 

Then I wait for the buffer to be 5> bytes before reading.   “ 182.12 g”   , but it should be 9 if your Visa-input is always 9 bytes... Smiley Happy

 

 

0 Kudos
Message 5 of 15
(1,294 Views)

When your data ends with a carriage return, then you should use it.  Make sure you enable the termination character in the Serial Configure and that you set it to carriage return (13 or x0D).  By default it is enabled but is linefeed (10 or x0A).  Then you can use a sufficiently large number (200 being just fine) with your VISA Read.  And as Dennis said, you don't need the "Bytes at Port" property.

Message 6 of 15
(1,254 Views)

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?

0 Kudos
Message 7 of 15
(1,231 Views)

please try this one. I made some corrections on it. I hope, I will work.

Ermaksan Machine R&D
Electronics Engineer
0 Kudos
Message 8 of 15
(1,216 Views)
The VISA Configure Serial Port has an input for the termination character. Clearly visible in the Context Help. Right click on the input and select Create Constant.

You don't have an error, it's a warning and caused by the incorrect termination character specified.
0 Kudos
Message 9 of 15
(1,204 Views)

Erdalozandilek: The previous version was better. Now I get wrong results again. 
Dennis: Since the sting ends with 0D 0A I guess the default settling is okay?? But do the settling course the string to be cut after 0D0A or…?

0 Kudos
Message 10 of 15
(1,186 Views)