LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple Events in Event Structure timeout

Solved!
Go to solution

What the heck it was fun to code up !1.png


"Should be" isn't "Is" -Jay
0 Kudos
Message 11 of 23
(1,257 Views)

What if you just ignore previous? for the Wait on Multiple?  Then you know both pieces of data would have had to come in after you started waiting.

0 Kudos
Message 12 of 23
(1,247 Views)

@RavensFan wrote:

What if you just ignore previous? for the Wait on Multiple?  Then you know both pieces of data would have had to come in after you started waiting.


Not quite how it works Bill.  And, one of the reasons I actually coded it up to play with.   The Wait on multiple with history will only return a notification once and returns when the first notifier recieves a notification it hasn't seen before.  The trick is that it does not remove the notification so the wait on notification with ingnore previous T will return the last data put into the notifier


"Should be" isn't "Is" -Jay
0 Kudos
Message 13 of 23
(1,240 Views)

 


LabVIEW Help says:

notifiers out returns an array of the notifier references from which messages were received.


 

You know what that means?  If you didn't get the second notification in time, you will never close it out.  You are then stuck with being unable to stop that heartbeat.  so instead of the FOR loop, just use the notifications output since you should get the same data anyways (unless another notifiation was recieved between the Wait with History and the Wait for Notification.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 14 of 23
(1,231 Views)

Nothing is behaving at all the way I would expect it to.

 

Even yours is acting odd to me at times, sometimes only spitting one notifier out of the Wait for Multiple.

(EDIT:  While composing my message and playing with the code, Crossrulz posted a pretty important comment that may explain what I was seeing.)

 

This bugs me and I'm going to wind up wasting more time playing with it some more.

 

If this was my project, I'd probably create a FGV that keeps track of multiple timestamps from different sources, and performs calculations to determine when the time between successive timestamps is too long.  The monitoring loop of the FGV becomes a true watchdog and doesn't get help up at notifiers and polls as needed.

0 Kudos
Message 15 of 23
(1,225 Views)

@crossrulz wrote:

 


LabVIEW Help says:

notifiers out returns an array of the notifier references from which messages were received.


 

You know what that means?  If you didn't get the second notification in time, you will never close it out.  You are then stuck with being unable to stop that heartbeat.  so instead of the FOR loop, just use the notifications output since you should get the same data anyways (unless another notifiation was recieved between the Wait with History and the Wait for Notification.


Right you are! small mod required to fix the potential shutdown problem.

!1.png

 

I aslo added a debug boolean -  there are some interesting things going on that are not really well covered in the help.


"Should be" isn't "Is" -Jay
0 Kudos
Message 16 of 23
(1,219 Views)

Ok Jeff.  Now kill one of your heartbeats.  You will find that you need a timout on those notifiers inside of the FOR loop.

 

It is getting to the point where you might as well just use two Wait For Notifications in parallel.  They should output the last value in the notification if you had a timeout (don't have LabVIEW right now to make sure).  It would make things a lot simpler.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 17 of 23
(1,198 Views)
Solution
Accepted by topic author martian101

Thank you everyone for you responses. I ended up finding example code (Find Examples -> Wait For All Notifications Demo) that I could mofify for my use.

0 Kudos
Message 18 of 23
(1,192 Views)

"They should output the last value in the notification if you had a timeout."

 

Sounds like a good Idea Exchange post but such is not the case.

 {EDIT: which explains the ancient and venerable example here I assume this is what Martian found}

So now that I'm not distracted by paying bills etc.... a bit of rethinking is needed.  What we need is a data transport mechinism to put latest data somewhere our monitor loop can always get latest data regardless of how old it is or when it was last read..

 

Per the suggestions from the cheap seats a mod is needed:

!00.png

 

 

There is still something else odd about how that boolean array fails to light but leaving that.....


"Should be" isn't "Is" -Jay
0 Kudos
Message 19 of 23
(1,181 Views)

@martian101 wrote:

Thank you everyone for you responses. I ended up finding example code (Find Examples -> Wait For All Notifications Demo) that I could mofify for my use.


I didn't see that within Find Examples.  But going to the ni.com link from within there, I found this

 

http://www.ni.com/example/29469/en/

 

Is that the one?

0 Kudos
Message 20 of 23
(1,172 Views)