LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to generate variable delay to turn on/off the led?

Solved!
Go to solution

Hello Everyone

I need your help in doing a simple project.

I have to turn-on and off a led connected to NI USB-6501 (turning on and off led using this is done), but with variable time duration, and description is as follow.

* Led turned on for 10 seconds

* Led turned off for 50 milli-seconds

* Led turned on for 10 seconds

* Led turned off for 60 milli-seconds

* Led turned on for 10 seconds

* Led turned off for 70 milli-seconds

.

.

* Led turned on for 10 seconds

* Led turned off for 500 milli-seconds

* Go back to step-1

 

Basically Led will remain On for 10 seconds and will remain off for 50ms + step_count * iteration.

I am new to LabVIEW and really don't understand how to do this.

Right now I am able to turn on/off using fixed delay and the block diagram is as follow.

BlockDiagram.PNG

I didn't have any clue how to implement this step counting and changing the off delay time with iterations.

I am also attaching the VI file.

Thanks in Advance

0 Kudos
Message 1 of 3
(2,577 Views)
Solution
Accepted by topic author xpress_embedo

So your off time, you need to start with 50 milliseconds and add 10 milliseconds each time.

 

Put that integer into a shift register.  Wire it through the False case.  In the true case, add 10 milliseconds before you put it back in the shift register.

 

(You can also use a feedback node,  then it can be contained withing just the one case and you won't have to feed wires across the loop or through the other case.)

Message 2 of 3
(2,559 Views)

Thanks for suggestion, finally I am able to do it.

The Block Diagram is as follow:

True CaseTrue CaseFalse CaseFalse Case

 

Thanks again, i appreciate if you have any other comments on this.

VI is also attached.

0 Kudos
Message 3 of 3
(2,520 Views)