LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic Events Problem

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?
0 Kudos
Message 1 of 3
(2,685 Views)

I can't tell you how to solve you problems - without code this is always quite tricky.

But in case you want to log messages to a log file, have a look at this thread
http://forums.ni.com/ni/board/message?board.id=170&message.id=172117&view=by_date_ascending&page=1
 where I posted a logging-library.

Maybe it is a useful help for you.

Thomas

Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 2 of 3
(2,679 Views)
Hmm, that's strange. I could have sworn I attached the code. Oh well , here goes again.
0 Kudos
Message 3 of 3
(2,657 Views)