LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Notifier help

I need to update time in hh:mm:ss format from one place in my program to
another. I am trying to uise notifier but just can't figure it out. I am
including a VI which updates time but now I would like to start measuring
time when I send "10" to my notifier and stop measuring time when I send
"20" to the notifier.

vishi




[Attachment TestTime_New.vi, see below]
0 Kudos
Message 1 of 5
(3,168 Views)
I don't know the task of your application, but the kind of triggering you mention about is much better to do with occurencies.
Anywere, if you prefere to use notifications you can do this by placing your counting loop in a frame of state machine, where first frame waits for first notification ("10"), and in the second you place time-counting loop and in the same loop _queries_ (not waits) for second notification. But this approach is not at all time-precios in its second step - so its better to devide two tasks of updating time indicater and measuring final time (if the last one is more important).
Also, it's not always a good practice in sending a notification and destroing the notifier immedeately after this (vi's quering this notifier risks not to receive th
e last one).
And, BTW, there is a good Format To Date/time function in time/dialog palette that you can use in place of all mathematics you use to format a time string.
Message 2 of 5
(3,168 Views)
OK, so how would I do it using occurences. Let us take a simple case. When I
get a trigger from one part of my code, I need to start updating a counter,
say every 500msec. When the next trigger comes, I need to stop this counter.
I don't want to do it using polling of any kind. Any help is appreciated.

If LV had timers, I could just set the timer to 500msec. with initial state
disabled. Then when I want to trigger it, I just change its property to
Enable, timer will do the work, and then disable it later when I am done.


vishi


"defuflo" wrote in message
news:50650000000500000008F20000-1042324653000@exchange.ni.com...
> I don't know the task of your application, but the kind of triggering
> you mention about is much better to do with occu
rencies.
> Anywere, if you prefere to use notifications you can do this by
> placing your counting loop in a frame of state machine, where first
> frame waits for first notification ("10"), and in the second you place
> time-counting loop and in the same loop _queries_ (not waits) for
> second notification. But this approach is not at all time-precios in
> its second step - so its better to devide two tasks of updating time
> indicater and measuring final time (if the last one is more
> important).
> Also, it's not always a good practice in sending a notification and
> destroing the notifier immedeately after this (vi's quering this
> notifier risks not to receive the last one).
> And, BTW, there is a good Format To Date/time function in time/dialog
> palette that you can use in place of all mathematics you use to format
> a time string.
0 Kudos
Message 3 of 5
(3,168 Views)
You say - "I don't want to do it using polling of any kind"...

Ok, as I understand, you want to have some kind of software time "gate" signal. LV doesn't have counters like you want.
May be I'm wrong and experts will correct me in this case, but to perform any task UNTIL an event occurs you will be obliged to use polling/quering of some kind (directly or indirectly). It's like a pretriggered acquisition using an oscilloscope - scope aquires data continiusly while looking on trigger input - but it cannot "predict" the exact time of its appearence.
In other words, you have some task enclosed in a loop, and you can do this task one, two ore more times, but you can not do this task "one and a half" times. And at the start (or end) of each cycle yo
u can query a notifier, variable or anything else you prefere.
0 Kudos
Message 4 of 5
(3,168 Views)
Just a few more words -
Ok, you can wait for a second notifier ("20") outside of your loop (in parallel) and upon receiving it change some local variable associated with loop stop condition. But this will be also the case of polling, but this time of a local variable somewere inside the loop but also only once for each iteration.
0 Kudos
Message 5 of 5
(3,168 Views)