04-23-2014 02:45 PM
What the heck it was fun to code up
04-23-2014 02:57 PM
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.
04-23-2014 03:04 PM
@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
04-23-2014 03:25 PM
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.
04-23-2014 03:34 PM - edited 04-23-2014 03:42 PM
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.
04-23-2014 03:55 PM - edited 04-23-2014 03:57 PM
@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.
I aslo added a debug boolean - there are some interesting things going on that are not really well covered in the help.
04-23-2014 05:47 PM
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.
04-23-2014 06:40 PM
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.
04-23-2014 06:59 PM - edited 04-23-2014 07:08 PM
"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:
There is still something else odd about how that boolean array fails to light but leaving that.....
04-23-2014 07:28 PM
@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?