LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to display and record elapsed time during instrument reading

Solved!
Go to solution

Hi Dave,

 

I modified your code and have reattached it.  I added a bit of logic to your code.  You are looking for you program to only post a time stamp only when the state of the LED changes from false to true.  To do this I used a shift register to store the previous state of the LED and then used a comparison to check if the previous state is false and the current state is true.  If that comparison is true/or false it will activate the code in the case structure.

 

The next step is for you to add in your time stamp code and some data processing.

 

Hope this was helpful!

 

Regards,

 

Mike Altmann

Applications Engineer

National Instruments 

Regards,

Mike Altmann
Product R&D
NI
0 Kudos
Message 21 of 22
(1,251 Views)

Hi Mike,

Thanks so much for the modifcation.  After I posted this one, I thought some more about it, and did essentially the same thing you did, but, I used the 0 and 1 instead of TRUE FALSE, but, my vi is not working, and I am struggling to debug it.  Mine puts the "0" and "1" value in the shift register and subtracts them, so that in the case where it changes from 0 to 1, then, 1-0=1 activates a TRUE case structure.  If it doesn't change 0-0 is not equal 1, and 1-1 does not equal 1, and 0-1 does not equal 1. However, I have a bug where I cannot see the code in the case structure functioning properly.  Let me study yours and see if I can find clues to repair mine.  Equally good would be to simply adapt your TRUE/FALSE to my application. 

Dave

0 Kudos
Message 22 of 22
(1,247 Views)