LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Data line rotation being read into Labview via an RS232 serial cable and USB converter

Solved!
Go to solution

I have a program to read a string of data from a 2B Technologies Ozone Monitor Model 202.  The program does not come up with an error message but every 30 to 40 hours Labview will rotate my data line.  For example if a normal data line is 34.5, 37.5, 812.0, 934.0, 11/07/14, 11:52:38 and is coma delaminated, then the problem is the ozone reading (first number) will read zero, then the seconds reading off the time will move into the ozone spot in the data file and the line will rotate from there.  I have tried changing the bytes being read to the Labview program and multiple ways of flushing the buffer but the problem is still there.  I attached an example data file in which the problem took place and a screen shot of my labview program.  I am a fairly new labview user so descriptive help would be appreciated very much.  Thank you!

Download All
0 Kudos
Message 1 of 6
(2,596 Views)
Solution
Accepted by topic author LDurett

When using a termination character, do not use Bytes at Port. Just wire a constant to Byte Count which is larger than the largest possible message.

 

Lynn

Message 2 of 6
(2,587 Views)

When I delete the Bytes at Port and input a high enough constant I get the error -107380733 VISA Read.  The program still runs and collects data though.

 

0 Kudos
Message 3 of 6
(2,582 Views)

What does Explain Error say about that? When I look it up, I get undefined error. Did you possibly transpose a digit when posting?

 

Read may return a Warning (not an error) because the termination and the byte count do not match. I do not have hardware to test right now so am not sure of the warning number. The warning is expected and can be ignored. When that warning occurs, Explain Error will say something like more bytes may be available...

 

If it is returning reasonable data, I suspect that you have a warning and not an error. I would expect VISA REad to return and empty string in read buffer if an error occurred. In the error out cluster an error has occurred if the status boolean is True. A warning has occurred if status is False AND error code <> 0.

 

Lynn

0 Kudos
Message 4 of 6
(2,571 Views)

The warning it seems Lynn is remembering is the "Number of Requested bytes was returned.  More data may be available".  That warning is common when using the Byte At Port.  Try setting the number of bytes to read a lot higher and see what happens (since you are using the termination character).


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 5 of 6
(2,564 Views)

That was my mistake; I missed the last digit of the error when I was typing.  The explain error box said Error -1073807339 occurred, Possible Reasons: VISA: (Hex 0xBFFF0015) Timeout expired before operation completed.  However, my program is collecting good data and the problem seems to have gone away.  Thank you so much for your help!

 

LDurett

0 Kudos
Message 6 of 6
(2,550 Views)