LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to write text file containing event times

Hello!

I would like to write a text file containing event times (e.g button push)

When there is a new boolean event occuring, a new line containing the time should be written.

I already found a appropiate VI, adjusted it by adding a new line string, and a case structure, but it only writtes the actual time or overwrites the last one, if an event is happening.

How can I make this work?

Thanks a lot in advance!
a labview rookie
0 Kudos
Message 1 of 6
(3,060 Views)

Hi tomsee,

see the attached example. Hope it helps.

Mike

0 Kudos
Message 2 of 6
(3,046 Views)
Thanks a lot for your help, Mike! The case structure is working perfectly to timestamp a button press event. I tried to melt this part with my data aquisition process, which is checking a digital input line for signal change. Every time the signal changes, a boolean led is blinking. So I tried to connect the boolean led in my daq while loop to the write loop containing the case structure. I´ve got two boolean leds now, one in the daq while loop and one in the case structure. If I got a signal change on my digital in port, only the one in my daq while loop is blinking, the one in the case structure for timestamping this event is not blinking, and so no timestamp data is written. I tried a to use only one while loop for both daq aquisition and write, but it didn´t work. How can I send the boolean event (led blink) in my while loop to the case structure? Can anyone tell me what I´m doing wrong or how to accomplish this task? Kind regards, Thomas
0 Kudos
Message 3 of 6
(3,011 Views)
Ok I guess I found the error! I just hadn´t enough knowledge about case structures. I mustn´t add a switch to my case structure. I can select any booleon value change by event configuration. It doesn´t matter where this button or led is located! Tomorrow I will see if everything is working fine - I hope so! Will tell then. Comments are welcome greets, Thomas
0 Kudos
Message 4 of 6
(3,004 Views)

Hi tomsee,

if you connect both loops with a wire, the second one first starts if the other is ready. Here is another example for you. Hope it helps.

Mike

0 Kudos
Message 5 of 6
(2,995 Views)
Hello Mike! Thanks again for your very good help. You made it possible that now everything is running like it should. Like you suggested, I inserted the true/false case structure into my daq data read and write while loop and connected both loops. Writing the time of events on my digital in was a little bit tricky, but I found a solution that counts everytime if the old signal is 0 and the new one 1, and connected the two lines with an AND. By just comparing the first value of the while loop and the following the Time was always written 2 times with an delta t of my daq while loop. My next task is to extent the hole thing for writing time events of three different digital channels to one file. Maybe its easier to run the vi 3 times parallel, but I will try to get all data into one file. I wish you the best, Thomas
0 Kudos
Message 6 of 6
(2,981 Views)