LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

loops, timers and errors

Use this timer, u wont miss the events.
Balaji PK (CLA)
Ever tried. Ever failed. No matter. Try again. Fail again. Fail better

Don't forget Kudos for Good Answers, and Mark a solution if your problem is solved.
0 Kudos
Message 21 of 35
(1,418 Views)
Ravens Fan: Is this an ordinairy case structure? I don't recognize the green frame.
0 Kudos
Message 22 of 35
(1,410 Views)
Ravens Fan: No need to reply, I figured this one out myself 🙂
0 Kudos
Message 23 of 35
(1,406 Views)

Baji:

About the "First Misstake". If I insert the instrument as you describe I get stuck in an infinite loop, as the program will never read anything. Occasionally I will get a warning saying that there might be more bytes at port than I requested to read.

0 Kudos
Message 24 of 35
(1,399 Views)

I hav made a new version of getstring.vi. It checks for errors, but it still gets stuck in the second loop, despite getting an 'Á', indicating EOF.

 

I have put the indicator withthe read string inside the case structure. Is this the right thing to do?

0 Kudos
Message 25 of 35
(1,392 Views)
Baji: I can't open timer.vi. I use LabVIEW 8.5.
0 Kudos
Message 26 of 35
(1,383 Views)
Timer Vi in 8.5
Balaji PK (CLA)
Ever tried. Ever failed. No matter. Try again. Fail again. Fail better

Don't forget Kudos for Good Answers, and Mark a solution if your problem is solved.
0 Kudos
Message 27 of 35
(1,372 Views)
First check the available bytes in the port, Read the port if available bytes are more than zero (Implement this using the functions - Bytes at port,Greater than zero and a cade structure).Dont read the port if no bytes are available.
Balaji PK (CLA)
Ever tried. Ever failed. No matter. Try again. Fail again. Fail better

Don't forget Kudos for Good Answers, and Mark a solution if your problem is solved.
0 Kudos
Message 28 of 35
(1,369 Views)

I thought the function you inserted were supposed to do that. Do I need to change it further?

 

The timer.vi is still in 8.6.

0 Kudos
Message 29 of 35
(1,347 Views)

I think I figured this one out. Connecting the numeric wire from Bytes at Port to the VISA read function seems clever, but that makes it incompatible with getstring. The way getstring works it is supposed to only read one character at a time, looking for EOF, which it won't find, since it keeps getting larger chunks of text, hence infinite loop.

 

I include new version of serial port control.

0 Kudos
Message 30 of 35
(1,344 Views)