06-27-2008 09:23 AM
06-27-2008 09:40 AM
06-27-2008 09:45 AM
06-27-2008 10:03 AM
Actually, I would like to stick with using the change value events so that the vi could be run from another vi if desired. The only event that gets passed by variables or by using vi static address references is the change value event.
I used to put all my controls in a for loop with a wait for front panel activity. I used to have all the mechanical action be "press on - press off" (the first option in the mechanical action selections.) This caused me to have to do the following things.
Within each event, include a case structure for finding out the state of the switch. (If new value true do what you want, then reset the button using a property node value(signaling)...which did not have any effect on the switch until I included the "Cause Front Panel Activity". ) If the value was false, then don't do anything. But the changing of the button on the front panel caused another event...so on and on.
Altenbaugh (sp...please forgive ... not worthy of valuable advice from this real pro) and Lynn have convinced me that using the latch action with the switch inside the event simplifies things greatly...and it does...(only one event ... button status gets cleared when the event fires, no need to sort out T/F status of the switch with Case structure...and so on)...there is just this little nagging problem left by this arrangement...
As to the producer consumer architecture...I don't want to go there, yet. Ultimately, I will build state machines for the management of all this stuff using the state module with the developer suite we have, but ... first things first...just a simple little problem to get my head straight before moving on to the fun stuff.
Thanks.
Never wear sandles in a rock garden....the Hummm
06-27-2008 10:25 AM
06-27-2008 10:31 AM
06-27-2008 10:32 AM
06-27-2008 10:34 AM
06-27-2008 01:14 PM
interesting example...it is simple and does what is needed.
It works.
I did a simular thing, but did not have any data passing through the while or event boundaries. My while consumed the entire processor. So I added the polling timer...thing...to keep the machine cycles down...then I though of adding the wait for front panel activity which led me to moving all the buttons out front with a wait for front panel activity...which lead me to what Altenbach and Lynn found and helped me with.
I note that your while runs only once when each button is pressed...Guess I'm confused about that. I modified mine to do the same thing and it seems to work as well. Why doesn't the while loop spin at machine speed rather than waiting for each event to fire?
I think I almost have a handle on it now.
Thanks
Here's my latest...see if that matches what you are thinking.
06-27-2008 01:35 PM