LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

appending timestamps and elapsed time interval to.csv file usind digital trigger

Solved!
Go to solution

I am trying to log timestamps and time interval between these timestamps to .csv file. Digital input is used as a trigger.

I want to design logic such that, timestamps gets logged both the times when digital input goes off-on and on-off. Program should also calculate time interval between timestamps and add it to .csv file. Also, this file should be overwritten only after 12 hours. 

please guide me in right direction. I did not post my code because its just a garbage. 

0 Kudos
Message 1 of 4
(3,077 Views)
Solution
Accepted by topic author vinod.4166

Hi vinod,

 

use BooleanCrossing function to detect changes of your "digital input". When there is a state change you store the current timestamp in an array and calculate the difference to the previous timestamp.  Store that difference too…

 

What have you tried so far?

Where are you stuck?

We will be glad to help you, but we will not do your (home)work for you!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 4
(3,049 Views)
Thanks I will try this. I had used while loop and case structure inside loop. Case structure was controlled by boolean, problem was while appending value during either true or false case multiple values get logged. I tried using for loop inside case structure to have 1 loop iteration to log just 1 value but it keeps on adding untill the case is switched.
0 Kudos
Message 3 of 4
(3,042 Views)

I cannot thank you enough for your guidance sir. I had been struggling to make this logic work using various stuctures but  BooleanCrossing function did the trick.

I am sharing my code and would request you to take a look and suggest any optimization changes to it.

Thank you again.

0 Kudos
Message 4 of 4
(3,024 Views)