Jump to content

Measure Time of LED turning on


Recommended Posts

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.

Link to comment

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 by asbo
Link to comment

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

Link to comment

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.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.