LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

While loop never stops after reading the result

I 'amattaching the program with thismessage in which while loop never stops, going on continuing until I stops it manualy using the off button What i have to do to get it off automatically afetr execution and reading the query and getting the result in Read in Front panel

0 Kudos
Message 1 of 6
(2,721 Views)

Hi Perumpadapu,

 

- when you don't need that loop then you should remove it.

- when you're using a newer LV version than 6.0 then you should use VISA instead

 

Best regards,
GerdW


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

You have to set a condition and check it whether it has met or not and wire the boolean to the stop/continue terminal of the while loop. Better go for the LabVIEW Basic materials for more details.

-----

The best solution is the one you find it by yourself
0 Kudos
Message 3 of 6
(2,712 Views)

The loop does in fact stop and is also completely unnecessary. Don't do something as dumb as using the run continuous buttton.

 

Rude of you to start yet another thread on the same subject.

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

But the while loop I need to read the command .It's going on reading not stopping until I press the button so without while loop how can I read this command, I tried for loop all not at working so what to do

0 Kudos
Message 5 of 6
(2,662 Views)

Your stop condition is "continue if true". This means that, unless you press the button, the while loop will stop after one iteration.

 

  • First, you should change the termination condition to "stop if true".
  • Then you should make the stop button "latch when released" (right-click..mechanical action). Else you don't have a well defined state after the program stops.
  • You should decide on a reasonable loop rate and enter it for the wait control. (beter use a diagram constant if the value is always the same).
  • Why do you need to continue reading in a loop? Are you expecting the response to change over time?
  • Do you want to keep appending to the string indicator or only show the latest characters received?
  • Maybe you also need a wait between the writing and reading?
  • Delete the ms timer value indicator, it is completely useless.
  • Do you get any error codes?
  • Don't use the run continous button. Use the plain run button.

What device are you communicating with? Do you have documentation?

 

 

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