Ano Ano Posted May 15, 2012 Report Share Posted May 15, 2012 Hello, I am trying to measure the time that a LED stays on. There is something similar at: http://forums.ni.com/t5/LabVIEW/Measuring-time-between-activation-of-two-boolean/td-p/1727822 The problem with the above example is that its not displaying the time dynamically, i.e. as it passes, but only showing the time when the LED switches off. Any ideas? Quote Link to comment
Ano Ano Posted May 15, 2012 Author Report Share Posted May 15, 2012 Hello, I managed to do something about the timer: http://www.imagebam.com/image/c6866e190354656 Now I want to use a boolean array and a For Loop in order to record the time that each of these LED stayed on Any ideas? Thank you in advance Quote Link to comment
jcarmody Posted May 15, 2012 Report Share Posted May 15, 2012 I can't see your image because my company blocks most outside stuff. Maybe you could put your image directly in your post... Quote Link to comment
Jon Kokott Posted May 15, 2012 Report Share Posted May 15, 2012 Be careful measuring timings using the tick counter like that. Remember that unless you are using labview RT, the timer value will be somewhat of a suggestion. A better way to measure things like this is to use a piece of hardware to capture the waveform. Quote Link to comment
asbo Posted May 15, 2012 Report Share Posted May 15, 2012 (edited) Are you actually watching a physical LED or do you mean an LED indicator on the front panel? If it's the former, what are your criteria for on/off? Current? Luminance? Based on that answer, you're going to want to use different hardware to detect the change. If it's the latter, you can use an event structure to catch Value Change events. The event case will automatically provide a "Time" terminal. Be wary, though, it is not directly comparable to Tick Count or Unix Time (off hand, I don't exactly remember its significance beyond relative comparisons). Edit: I see your snippet now, so I'm assuming the latter case. However, it's not entirely clear what you're going for. You just want to time the duration between user input or something? If it's going to be staged (multiple sets of inputs) I would probably use an array of control references. I would still use an event structure instead of polling. Edited May 15, 2012 by asbo Quote Link to comment
Ano Ano Posted May 16, 2012 Author Report Share Posted May 16, 2012 Hello, Thank you for your replies. jcarmody: I havent mastered yet on how to add images on forum replies! Any suggestion would be most welcomed:) Jon Kokott & asbo: The LED are in the front panel and are turned on by code. When an acquisition event takes place and two conditions are met then a boolean LED turns on; there are 50 LEDs in total this is why I am looking for a For Loop. These conditions may or may not be valid after a while, hence the LEDs may stay on or may switch off. Hence I want to display, in real time, and log the time it stays on and when the LEDs turned on in the first place (as compared to a global timer (when the measurement initialised). I hope this clears things Quote Link to comment
asbo Posted May 16, 2012 Report Share Posted May 16, 2012 Is there a way to make your timing code proactive instead of reactive? That is, time the LED states in the code which actually changes the LED states. A parallel loop which uses an array of the references of your LED controls could build an array of timestamp and state for each control. It will be more difficult and messier to try and use terminals or locals. Quote Link to comment
Ano Ano Posted May 17, 2012 Author Report Share Posted May 17, 2012 Not sure how this can be done! Quote Link to comment
asbo Posted May 17, 2012 Report Share Posted May 17, 2012 I finally looked at the VI you linked originally. It's extraordinarily close, just wire a constant timeout to the event case. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.