I am fairly new to LabVIEW and I am trying to make a GUI that uses
events to pass messages between three separate event loops, GUI,
Messaging and Logging. GUI controls the state of the other two event
loops by generating control events and using semaphores. While the
messaging semaphore is released by the GUI, Messaging generates
messages and raises them as events. Some message events are handled by
the GUI event loop and others by the Logging event loop. Logging, once
it receives a 'logging ON' control event dynamically registers for
certain message events and logs the message events it handles to file.
When Logging receives a 'logging OFF' control event, it dynamically
unregisters the message events. The logging control events are
registered for the life of the Logging event loop.
I have created a cut-down version of my GUI that exhibits the same
problem. The problem is that after I have turned Logging on and off
once, it no longer responds to logging control events from the GUI.
Even though the GUI is still generating the events. I have looked at
the dynamic logging example in LabVIEW and thought I did the same sort
of thing but I just can't get it to work that way. The only way I got
it working was by creating a clean event registration with all events
each time I want to change the event registration. This is how I have
done it in the example file and it works. But I don't want to use this
method, I don't want to have to re-register the control events each
time I unregister/register message events.
If anyone knows what I'm doing wrong please edit the example vis and post them back.
Notes for the example:
- Files are LabVIEW 7.1.1
- Just open the front panels for all the vis before running the GUI vi.
- The Display vi just does the same thing as the logging vi.
- Run the GUI vi and turn on Messaging then turn Logging on and off a few times.
- The example works, but if you wire the event registration refnum
input when doing dynamic event registration, Logging will only turn on
and off once, then no longer respond to log control events... what's
going on?