LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Event Structure doesnt dequeue Events after generating an Event in a SubVI

Solved!
Go to solution

Hello,

I'm relatively new to LabVIEW but already got a big project going on in which i have to create an interface with an SIEMENS PLC where a lot of handshakes going on for an industrial application. I'm using the NI OPC Functionality for this. 
My Problem is concerning the producer loop of an QMH which should be firing events when PLC Varaiables changing values or other User Events are created. The varaible change events are firing perfectly well after program start. But i get a problem when ich fire my user made event which is created in a SubVI (see the pictures below)



Producer LoopsProducer Loops

 

Sub Vi with User Event generationSub Vi with User Event generation

 

Log of EventsLog of Events

 

So basically when the polling in my SubVI (red arrow in the Producer Loop Right) Generates the event Test 1 True the event structure won't work anymore after this (i see that it has a different Registration Refnum as the PLC Signals coming before) That is obvious but i dont really see an option to force it to the same Refnum (is this really necessary?)
I read several times that if you use multiple Event Structures you should use individual User Reg. Refnums. But in my case it is just the ONE Event Structure so i don't really see a problem here. But like said the Events getting kept in the unattended events above from that point on.. Somebody know where i went wrong here ?  

And of course i want to fire User Events from all over the place in my programs like SubVI and "special polling while loops waiting just for multiple PLC signals"
You could ask why i dont react to the Variable Changed event (PLC Variables are registered as "shared variables") directly.. But this was quite disappointing because the Variable Change event comes before the actual change of the value of the "network variable"... so i can't poll the variable values in the Value changed event like i wish to.

0 Kudos
Message 1 of 3
(653 Views)
Solution
Accepted by topic author DRobin

When the event structure receives the user event, the loop stops (because there's a TRUE wired to the stop condition).

 

0 Kudos
Message 2 of 3
(646 Views)

Yes of course..
I totally didnt see that ! Shame Shame Shame ... 😅
Thank you for your answer really helped me out and reenabled my trust in event structures 👌

Message 3 of 3
(615 Views)