LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Event Structure Problems

Solved!
Go to solution
If you are intent on receiving a lot more criticism for impropper coding, just go ahead with that stacked sequence structure.
0 Kudos
Message 11 of 25
(1,409 Views)

winterfresh - 

 

the State Machine i've given you can do all of that. Have a go and see what you can make of it.

 

David.

Message 12 of 25
(1,397 Views)

I haven't had a chance to look at it yet as I'm not on my computer that has labview on it, but ill check it out. Thanks!

0 Kudos
Message 13 of 25
(1,389 Views)

Thanks for the replys David but I'm still using LabView 13 and can't open your file,

0 Kudos
Message 14 of 25
(1,351 Views)

I can't open LV14 either but here is the very simple case structure method.  Whether or not you decide (or need) to use a more advanced architecture like a state machine is irrelevant.  You should still understand the basic structures in LabVIEW.

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 15 of 25
(1,334 Views)

ah, okay, not a problem. LV13 saved version attached.

0 Kudos
Message 16 of 25
(1,301 Views)

why are we making this issue so difficult?

event.png

 

Message 17 of 25
(1,275 Views)

 

thanks Apok, I think you have quite nicely proven to us that there are many ways to do the same thing.

0 Kudos
Message 18 of 25
(1,249 Views)

David this appears to work, but it runs extremely slow for me, the graph moves every few sconds at best. Is that a function of my computer?

0 Kudos
Message 19 of 25
(1,198 Views)

Hi winterfresh - 

 

The graph is only updated each time that particular case is called, which is when the Timeout event occurs. The timeout event is called when the front panel hasn't generated an interrupt or registered event within a particular timeout period. This period is defined by the number wired to the hour glass on the top left fo the event structure. Currently it is the value you originally used, which 10,000 ms, or 10 seconds.

 

The most obvious approach to resolve the issue would be to reduce that number right down. If you don't have anything you need to handle in other cases or event then you can make the timeout to be quite quick - say, 100ms. You'll just need to play around a little here.

 

I don't know the full extent of your code but you do have the option in moving your stepper-motor and peak detection code into the timeout event - thus removing the need to have a separate case to 'get value'. If this is a main part of the program and is something you need to happen every timeout period then it isn't a bad idea.

0 Kudos
Message 20 of 25
(1,181 Views)