LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Boolean 'value change' Event is occasionaly missed/locks front panel

Hi Folks,
 
I am running a process control application in which I have multiple parallel loops controlling/monitoring various aspects. I'm slowly trying to restructure it to make better use of Events and parallel architecture communication techniques.
 
Anyway, one very simple while loop previously polled 4-5 booleans to run various configuration sub-vi's. Each subvi was contained within a case selector, which was simply linked to the boolean. They are very simple 'functional' sub-vi's that only output an array, string, whatever.
 
Recently i placed an event structure inside of the while loop. It contains a case for each boolean (latched when released) value change. Within each case is simply the sub-vi and the boolean control. 99% of the time I can click a configure button, the subvi runs, I finish it, it closes, and I can rappidly re-click the configure button (or an another one). Response is very quick and no hick-ups.
 
*However*, I notice that sometimes when I click on one of the configure buttons, it will remain depressed but not load the sub-vi sub-panel. My process continues to run, but the front panel is locked against any mouse clicks. It seems the event was 'missed', and the boolean can't release it's latch because it was never 'read' (in the block diagram).
 
Each boolean option button is read in within each corresponding event case. The outer while loop has a delay of 1000mS. This 'glitch' is not easily repeatable. Any thoughts? What could cause an event to be missed, or lost?
 
Thanks kindly,
Jamie


Message Edited by slipnfall on 03-22-2008 11:15 AM
0 Kudos
Message 1 of 16
(4,551 Views)

You talks about "parallel while loops" and "outer while loop", etc. So I have a hard time imagining the program architecture. can you attach a VI or at leat an image of the diagram?

Does the "process" run in a parallel loop to the event loop? Events never get missed, it seems more that the event structure sometimes cannot execute (e.g. by poor dataflow design). Is the event structure inside case structures or inner loops for example? Are you sure all events complete successfully?

Are your configuration VIs modal? If not, it could be that while the FP of a subVI loads, you place focus on the toplevel VI and the subVI is covered up and remains open? This will prevent the event from completing. Have you tried switching to execution highlighting when it gets stuck to see what's going on on the diagram?

Where exactly is the 1000ms delay? If this is inside the event loop you might delay the event from executing. An event loop should not have any delays. If you need to spin it at regular intervals in the absence of events, use the timeout event. Are you locking the front panel until events complete?

Message 2 of 16
(4,543 Views)
Hi,
 
Unfortunately I do not have access to the file at the moment. Basically the while loop for the event structure is on the top-most level. It is not contained within anything else. The even structure is the only thing it handles. The other loops I mention do various functions: one reads data from the serial port, another handles the main process (sends data to serial port), and yet another communicates with fieldpoint.
 
I'll certainly double check on the modal setting: I didn't turn it off, and i believe modal is the default (LV8.5 by the way).
 
I did switch to execution highlighting but just to see that the program was still running. I did note that when I open the subvi panel that caused the lock-up, it is always simply waiting to run. Whenever I set a breakpoint on that subvi I can never seem to induce the problem. Again it is random and has only happened 3-4 times, so it is hard to catch.
 
The 1000mS delay is indeed inside the while loop containing the event handler. Initially I thought this would control how fast the user would be able to click multiple buttons, but I noted that it didn't work. I'll be sure to remove it.
 
Honestly I'm not sure on the locking of the front panel.
 
Thanks for the quick reply: it will be Monday until I'm able to really test some of these ideas.
 
Kindly,
Jamie
0 Kudos
Message 3 of 16
(4,537 Views)
Adding a small detail: Note that normal events (not dynamic) are registered  when the vi starts. So if you have the "Lock front panel until the event comletes" checked, you get your vi hanged, in case you trigger an event, before your program reaches to the event structure.

Message Edited by Pnt on 03-22-2008 07:14 PM
Message 4 of 16
(4,532 Views)
Is it possible that the Boolean Event is not at fault, but that the SubVI that ran previous to it hasn't exited?  This would tie up your event structure (because the event case couldn't complete due to a hung SubVI) which in turn wouldn't read your latched Boolean.
0 Kudos
Message 5 of 16
(4,502 Views)

Hi Jamie,

As PNT mentioned, the front panel becomes locked during execution if you have it set to "lock front panel until event completes".  The fact that the front panel remains locked when it hangs implies that the event is being triggered but not completing.  In addition, you noted that the event occurs but stops at the entrance to the sub VI while using Highlight Execution.

What I think is happening is that the sub VI must be running elsewhere, as Jeff mentioned, and thus cannot be accessed from within the event structure.  If you cannot figure out a way to close it, you can set the VI property to "reentrant", meaning that the VI can be accessed from multiple places at once.

I hope this helps a little.  Regards,

Lauren

Applications Engineering
National Instruments
0 Kudos
Message 6 of 16
(4,487 Views)
This is slipnfall BTW: I didn't realize I have two accounts here.
 
Anyway the problem seemed to be that the one particular (it was isolated to one sub-vi) wasn't configured as modal. As soon as I changed this everything seems to work perfectly! Very responsive and works every time.
 
Thanks for all your thoughts and suggestions.
 
Kindly,
Jamie
v2009 devel. w/RT
Message 7 of 16
(4,471 Views)

Hi

I have an event structure inside the while loop.In the event structure i have a case where the event to happen when the ok button value changes(placed ok button between while loop and event structure).In the FP i changed the mechanical action to latch when pressed.

My problem is once i start the program at the moment i need to press the Ok  for the event to happen.Pls suggest why is it like that

Thanks

0 Kudos
Message 8 of 16
(4,264 Views)
First, new questions like this should be in new threads.  Second, you are describing exactly what an event structure is for.  When a user presses a button, the event case executes.
0 Kudos
Message 9 of 16
(4,262 Views)

sorry i forgot to add a word in the previous message

Hi

I have an event structure inside the while loop.In the event structure i have a case where the event to happen when the ok button value changes(placed ok button between while loop and event structure).In the FP i changed the mechanical action to latch when pressed.

My problem is once i start the program at the moment i need to press the Ok twice  for the event to happen.Pls suggest why is it like that

Thanks

0 Kudos
Message 10 of 16
(4,260 Views)