09-20-2011 09:15 AM
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
09-20-2011 09:41 AM
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