LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

serial read

Hey,

I have a problem with serial read. When I run the programm, this error iterrupts the execution (see the figure bellow).

How can I solve this problem in order to have a countinuous reading until I stop the execution.

Thank you,

Download All
0 Kudos
Message 1 of 11
(2,596 Views)

Read the Help for the second VISA (Serial) command, VISA Read.  It should tell you something about what a Timeout means.  Now ask yourself a question, "Why should the VISA Device be expected to be sending me characters?  Have I asked for any?".  You might also look at some of the Examples (that ship with LabVIEW) concerning VISA Read (read, again, the Help for VISA Read, look for the word "Examples").

 

Bob Schor

0 Kudos
Message 2 of 11
(2,588 Views)

I have already read it, I tried so much times to solve the problem, and I still have the same problem. Can someone help me pls?

Thank you,

0 Kudos
Message 3 of 11
(2,519 Views)

Hi ki4kou,

 

when VISARead gives an timeout error then it didn't receive the requested number of bytes (or the TermChar).

You need to check the device on the other end of the serial connection: does it send any data?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 11
(2,515 Views)

What device are you trying to read from?  What is the format of the data it is sending?  When does the device send the data?

 

Tim Robinson


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 11
(2,502 Views)

Along with what crossrulz has already stated, is your device set up to send continuous data? Or are you trying to read data and expecting termination character at the end? Right now, its set as the default, which is a line feed, and to wait for 10 seconds. If no termination character exists and you're expecting one, after the ten seconds comes and goes, it will timeout. That sounds like what your experiencing.

 

The help file states this. Have you read that AT ALL?

0 Kudos
Message 6 of 11
(2,489 Views)

I use two computers, the first one is where I run my labview programm and I receive data, the second one is the computer where I use "command consol" to write data and send it to my first computer. The problem is I don't receive data in real time, I have this problem of timing out. But, when I stop my programm, I receive data that I wrote on the first computer.

0 Kudos
Message 7 of 11
(2,467 Views)

I send strings and numbers, I write them on real time. Ya I read the help file but I don't find what I search!

0 Kudos
Message 8 of 11
(2,466 Views)

Hi ki4kou,

 

But, when I stop my programm, I receive data that I wrote on the first computer.

I don't believe that: you are receiving data AFTER stopping the VI???

 

What about attaching the current state of your VI?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 11
(2,454 Views)

Ya I receive data after stopping the programm. I don't understand your question!

0 Kudos
Message 10 of 11
(2,438 Views)