LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Missing User Events in parallel running VIs

Solved!
Go to solution

Hi all,

 

We have an architecture where multiple VIs will be running simultaneously and have some common controls. The value change in a VI has to be reflected in other VIs too. So we decided to generate an user event with the corresponding case and value. About 70% of the times this works correctly i.e. if there are 3 VIs configured for this user event, all 3 VIs respond about 70% times. The remaining 30% of the time just a single VI responds. What could be the problem?

 

Thanks,

Priyadarsini

0 Kudos
Message 1 of 13
(4,545 Views)
Did you independantly register the event to each loop? You can not create the event once and and connect it to each loop you must creat the event for each loop and register it for each loop. so you can not have one x to multiple ys you must have an x for each y. Where x is the event and y is the loop.
Tim
GHSP
Message 2 of 13
(4,541 Views)

Do you have a unique Event Registration Refnum for each VI?

 

Felix 

Message 3 of 13
(4,539 Views)

F. Schubert wrote:

Do you have a unique Event Registration Refnum for each VI?

 

Felix 


 

 

For a better understanding of Felix' answer have a look here.

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 4 of 13
(4,537 Views)

Thanks for your reply. But if we register separately in each VI the refnums turn out to be different and the VIs are no more synchronized. Could you post a sample code to get better understanding?

0 Kudos
Message 5 of 13
(4,535 Views)

They should get the event with the same time stamp.

 

Ton

Message Edited by TCPlomp on 14-10-2009 03:16 PM
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 6 of 13
(4,531 Views)
Solution
Accepted by topic author Priyadarsini
You register the event with each loop. When the event is fired it registers in each loop and will exicute in that loop. If you register it once and connect it to all of the loops then the first loop that exicutes the event will clear it and the rest will never see the event. That is why you see it work sometimes and not other times. You need to make the X event for each loop and register it. When you fire the X event as long as you have registered it in each loop it will be acknologed by each loop. If you have three loops you have to tell each loop to expect this event. If you tell them all to expect this event with one instance then as soon as one loop see it it is cleared.
Tim
GHSP
Message 7 of 13
(4,512 Views)

Or use one event and use another architecture such as quees to handle the event reading ???

 

Maybey 🙂

LabVIEW 2012
0 Kudos
Message 8 of 13
(4,508 Views)

Thanks everybody for your response. Having an unique Event Registration Refnum for each event structure solved the problem. But here we have to note that the User Events refnum and other controls refnum used for this registration are the same for all the VIs. Just the registration refnum varies.

 

Thanks once again.

Priyadarsini

0 Kudos
Message 9 of 13
(4,478 Views)

Platform = LabVIEW2011 Win7 64BIT

Topic = Using Dynamic Events

..

Question = When I create an event, and wire that same event to 4 separate "register for event" expandable pull down VIs, then wire each registered dynamic event to its own event structure and send a dynamic event, can I expect all 4 of those event structures respond?

..

Actual behavior = The first two responded perfectly, when adding a third event structure to recieve the same event within its own register of events, one of the other previous two event structures fails to respond.

..

Purpose = Provide a shell program as simple as possible, but not simpler, to ease the creation and use of cooperative parallel tasks in LabVIEW, without the clutter wires to the left and right of the block diagram.  The asynchronous parallel tasks are subVI on the block diagram of the main VI to start simple.

..

Background = I have created all the events and registered them all in a "creator" style VI.  The output is a single cluster with 6 created events and 5 registrations made from groupings of them.  I also have a "destroyer" style VI which takes the same cluster and unregisters then destroys the events.  Between the creator and destroyer I have my main program which is a JKI state machine.  This main program sends out a single dynamic command event.  All four of the other parallel tasks are supposed to respond when commanded to initialize or shutdown various functions.  These functions are generic such as init hardware, close hardware, pause, resume, and exit.  The four parallel tasks are DI, DO, AI, and AO for my program.  I want to make a generic shell program that allows adding various hardware asynchronously under the control of a main program.  In the past I have done this with Notifyers and Queues mostly.  I heard that events are supposed to work like a notify at the sender because it broadcasts, while the event structures provide their own queues, if that is true, and it works well, is efficient, and not too many events are used at once, then it will make a good generic structure for many uses.  After this program works I will add more types of asynchronous tasks for communication protocols etc.. 

..

0 Kudos
Message 10 of 13
(3,964 Views)