LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Best way to monitor the ON time of something in a minute ?!

Greetings everybody,
 
I first have to thank everybody offers help to others here.
 
I have a question regarding the Best way to monitor the ON time of something in a minute.
 
Say I have an On/Off switch that I want to know how many seconds that it was ON in the last minute (say) .. and reports that to a file or database each minute. So every minute I send a report to the DataBase with the number of seconds the switch was ON in the last minute.
 
I already made a solution, But it's not that good I think and there is a problem there .. Please check my VI as it describes the solution more than my words here.
 
Any comment is appreciated.
 
Thanks in advance.
-----------------------------
Ayman Mohammad Metwally
Automation Engineer
Egypt - Cairo
0 Kudos
Message 1 of 12
(3,765 Views)
Hello Ayman,

I attached a changed version of your vi. It uses two parallel loops. The communication is made via local variable and controled by a flag. Just have a look to get the idea.

You can do the communication also on different ways like queues...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 12
(3,749 Views)
Hi Ayman,
 
here´s my trial.
 
regards timo
---
Message 3 of 12
(3,746 Views)
Hi Timo,

could you please send an LV7.1 version as well?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 12
(3,741 Views)
I can 😉
 
 
---
Message 5 of 12
(3,736 Views)
Here is a modification of Timo's VI which uses an Event structure, no local variables, and only one loop. (LV 7.1).

Lynn
Message 7 of 12
(3,724 Views)
GerdW,
 
Thanks a million .. This is the best for me .. Actually I was looking for something like the lower while loop in your code ..
 
 
-----------------------------
Ayman Mohammad Metwally
Automation Engineer
Egypt - Cairo
0 Kudos
Message 8 of 12
(3,706 Views)

TimoSchott ,

Thanks alot .. Very good idea .. but I think it needs some modifications to suit my needs ... The indicator holding the (ON seconds) must be initialized each interval (one minute second in our example).

Thanks again .. I appreciate it.

-----------------------------
Ayman Mohammad Metwally
Automation Engineer
Egypt - Cairo
0 Kudos
Message 9 of 12
(3,705 Views)

johnsold ,

Thanks alot toy you too .. But I think your solution also needs some modifications for the same reason in Timo's solution.

But I really appreciate your help.

-----------------------------
Ayman Mohammad Metwally
Automation Engineer
Egypt - Cairo
0 Kudos
Message 10 of 12
(3,701 Views)