LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

event structure /dataflow issue)

I came once more with an "stop button" problem, handled with an "Event Structure". I really don´t like to use them, but I see no other way...
 
Well, now I abort my program whenever I want, but at the same time I can´t finish it: the event structure doesn´t allow me to arrive to the end....
 
So, I attach an example of my code, sure it will help much more to explain the point.
 
Any solution will be much preciated. 
Message 1 of 9
(3,604 Views)

Nothing wrong with the Event Structure it is just the way you are using them.  For your program I would NOT use an event structure because it is not needed.  See attached example.

Matt

Matthew Fitzsimons

Certified LabVIEW Architect
LabVIEW 6.1 ... 2013, LVOOP, GOOP, TestStand, DAQ, and Vison
0 Kudos
Message 2 of 9
(3,590 Views)
yeah, I see your proram getting stuck in the test sequence (sequence #1)
 
The problem is that you have a while loop that never terminates.  It's not the event structure.  My suggestion for terminating this loop it to add some communication between the for loop and the while loop. You could use a boolean and local variable, or add an event that you programatically trigger within the for loop. I've reattached my edits to your VI.
 
-Jared
 
Message 3 of 9
(3,584 Views)

Thanx to both for the quick answer!

Unfortunately, mfitzsimons, I´m not able to open your proposed VI (no error message, it just doesn´t works)

0 Kudos
Message 4 of 9
(3,572 Views)

Sorry LV 8.0 I can save it off to 7.1 if any help to you.

Matt

Matthew Fitzsimons

Certified LabVIEW Architect
LabVIEW 6.1 ... 2013, LVOOP, GOOP, TestStand, DAQ, and Vison
0 Kudos
Message 5 of 9
(3,557 Views)
Your problem is the fact that your FOR loop and event structure block each other. A FOR loop is not interruptable without using a stop node.
 
You should not use a FOR loop, but a single while loop with a single big event structure. The timeout should initially be infinite and the OK button should set the timeout to zero triggering the timeout case. The timeout case then steps through your tests, incrementing the counters as needed until all is done.
 
Please try the attached quick modification. You'll be surprised how simple this is. (no sequences, no search array, etc.) 😄

Message Edited by altenbach on 03-03-2006 09:13 AM

Message 6 of 9
(3,553 Views)

There was a minor issue synchronizing the test events with the counter indicators (They seemed off because the 500ms event wait is between the indicator update and the test display update). If you place the counter terminals inside the timeout case, it looks a bit better. (with the disadvantage that the counters only reset once you start the test unless you do it manually with local variables at the start of the program).

I any case, make sure to adjust for such "edge effects". Your real test probably takes some time, thus you could also keep the timeout at zero inside the timeout structure. As always, modify as needed. 🙂

0 Kudos
Message 7 of 9
(3,534 Views)
Yes, would be nice u store it in v7.1. Anyway, I don´t understand why LabView doesn´t show any advisory flag, saying is an unsuported version...
 
Thanx in advance, Matt!
0 Kudos
Message 8 of 9
(3,509 Views)


@Gatet wrote:
Yes, would be nice u store it in v7.1. Anyway, I don´t understand why LabView doesn´t show any advisory flag, saying is an unsuported version...

It usually does!
 
However certain LV8.0 vi's seem not to create the advisory dialog when you try to open then in LV7.1 for some strange reason. I have reported this to NI long ago, so hopefully this will get fixed in the future. 😉
0 Kudos
Message 9 of 9
(3,494 Views)