LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Monitoring long times

which is the best option to monitor a process time each hour throughout the whole week?

I am making a vi that have to do the next:

* Monitor every hour the status of a device,

* When the time has arrived, write down to the data base the status of the device

 

Coul you tell me which is the best option to monitor this kind of time (hours)? And whic is the best option to implement it, I am using 2 while loops, one to monitor the status of the device and other to monitor the time. In this way, when the time has arrived then I write to the data base.

 

Thanks

0 Kudos
Message 1 of 11
(3,559 Views)

You don't need separate loops, put both equipment acquisition and time/compare into 1 loop....shift register stores current and previous 'hour' values, when the hour changes>>compare: if not equal then do your acquisition code.... Smiley Wink  also, please do not post multiples of the same question. eventually someone will answer soon...if not , just bump it

time_VI_BD.png

Message 2 of 11
(3,551 Views)

Alternately you could use something like the attached vi which is even simpler and uses practically no resources from the computer! 🙂  It goes to "sleep" for an entire hour yet it will respond right away when you hit the stop button...  Only thing is that if you have other controls also tied in the event structure then Apok's approach works more consistently even through it uses some resources.

 

-DP

 

BatchTest Corp.

NI Alliance Partner

--------------------------------------------------------

New Controls & Indicators made using vector graphics & animations? Click below for Pebbles UI


0 Kudos
Message 3 of 11
(3,518 Views)

Note that the tick counter - which is used by the event structure timeout - is driven by a different oscillator than the Time of Day clock. Before relying on that you may want to check to see how much error you have over a week. The Time of Day clocks are usually synchronized to a network time server so any errors in the on-board clock oscillator are corrected over whatever time server correction interval is used.  The tick counter oscillator has no such correction.

 

Also be aware that any other event will reset the timer.  The Stop event does not matter of course.  If other events are to be used, careful planning and possibly a second event structure (which is normally NOT recommended) may be appropriate.

 

Lynn

Message 4 of 11
(3,510 Views)

Actually the Time of Day clocks are more inaccurate (several mSec inaccuracy) than event timeouts which I believe are based on a free running counter on hardware level. So if the user needs better accuracy, he/she would have to use RT or some sort of more accurate hardware-based counter/clock (maybe an add-on board).  However, for practical purposes I don't know why a user would take data only every hour and worry about a few milliseconds of inaccuracy.

 

Regarding timeout prematurely occuring due to any other event, true, and that's what I mentioned in my previous note too - in which case other posted vi would be more appropriate.

 

-DP

 

BatchTest Corp.

NI Alliance Partner

--------------------------------------------------------

New Controls & Indicators made using vector graphics & animations? Click below for Pebbles UI


0 Kudos
Message 5 of 11
(3,499 Views)

Hi,

Thanks for your answers, please tell me If the code that I am attaching will work properly. I want to stop the monitoring when an event occurs. Regards

0 Kudos
Message 6 of 11
(3,421 Views)

it is hard to understand the whole picture, with just a picture...post the vi please

0 Kudos
Message 7 of 11
(3,408 Views)

If the job is to monitor something once an hour, do 5ms or even a second make a tangible difference?

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 8 of 11
(3,395 Views)

Hi,

I am attaching the vi. Also, a few seconds make no a difference due the monitoring is each hour.

 

Thanks

0 Kudos
Message 9 of 11
(3,386 Views)

@IronFer wrote:

Hi,

Thanks for your answers, please tell me If the code that I am attaching will work properly. I want to stop the monitoring when an event occurs. Regards


what event are you waiting for? you need to put the event structure in a separate loop, otherwise your current loop hangs waiting for an user interface....then you can send a dynamic event to that separate event structured loop

Monitoring_and_Events[1]_BD.png

0 Kudos
Message 10 of 11
(3,373 Views)