LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

event structure new value

Hello,

I cannot find the error in this VI, I am trying to stop the VI through the button after pressing Go but the VI does not stop.

Can anyone tell me where the problem is.

Thanks,

Zied

0 Kudos
Message 1 of 9
(2,939 Views)

I can not see your vi , have 2009.

but did you register for go event and passed true from this case to while loop, are you just placing the stop button outside the event structure and do not have any timeout event also.( just guessing )

0 Kudos
Message 2 of 9
(2,927 Views)

Sorry I saved for version 9.

zied

0 Kudos
Message 3 of 9
(2,913 Views)

Run in highlight mode and you'll see the problem. The bottom right loop will never stop since you send a False to it when you press Go.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 4 of 9
(2,911 Views)

Check your VI Data Flow. Once your pressing “go” , it’s going to True case. In your 2nd case structure 2nd while loop will run continuously. You should stop somewhere.

Munna
0 Kudos
Message 5 of 9
(2,908 Views)

Apart from the suggestions given , purpose of your vi is not clear .What exactly are you trying to achive???

Learn data flow, if you are passing the stop values to while loop from outside either they will run once or they will run forever.

and please get rid of CPU hogging loop, put some delay there and repost your vi with changes.

0 Kudos
Message 6 of 9
(2,884 Views)

Sorry but I did not understant your answer, could you clarify it. In this Vi Just I want to use push button to go between event, for a simple example I used Go and Terminate all and the big while loop is just plotting a random number over time.

Zied

0 Kudos
Message 7 of 9
(2,856 Views)

Zied,

 

point is, the computer is only doing what you tell him to do. So there is a difference between what you want to do and what you implemented in the VI.

You are running into some of the caveats of the event structure.

 

I recommend you to think about taking LV classes or work through LV tutorials to increase your awareness of data flow implementation.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 8 of 9
(2,845 Views)

You must understand dataflow, and running the VI in highlight mode is a good way to do just that.

Your main loop wont loop until all included functions have finished, and the bottom right loop wont ever finish since the End loop terminal is permanently false. Thus the stop button will wait forever and the program will be unresponsive.

Your loops runs as fast the CPU can manage, millions of loops per second, just burning the cpu and stealing performance from windows. Add a small wait to them, 10ms is enough to make a huge difference.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 9 of 9
(2,844 Views)