Showing results for 
Search instead for 
Did you mean: 

Flash Leds



I want to control the on / off of 3 leds.


led 1  led 2   led 3

on      off       off

off      on       off

off      off       on


Then repeat this sequence from a slow start and ramp up to say 3hz over say 20 seconds and then stay at that level untill stopped


Can anyone advise how this might be done ?   I would then like to use this to try and control a 3 ph stepper motor.


I am using Version 8.0 if any body can give me some example code to work on.



0 Kudos
Message 1 of 10

Try something like this, perhaps? Just plug in your desired numbers.



Message Edited by altenbach on 02-06-2009 12:19 PM
Message 2 of 10

Hi Altenbach,


Thanks thats exactly what i am trying to do..Perfect.


Just to take things a little further i would like to plot the three led digital signals 0 or 1 ( True or False) seperately on a graph.


I have tried using digital waveform but as usual i always have major ploblems with data types and converting

or matching up data types for each Vi.


For this example the output from the array is a 1D Array of boolean (true or false).The Vi DWDT Boolean array to digital uses a 2D array.

Checked out the examples but still don't see how to make it work for this example.Tried converting boolean to 1 or 0 and using other graphing

Vi's  but still there is a data mis-match.


Any suggestions would be appreciated.




0 Kudos
Message 3 of 10

Since the points are not equally spaced in X, you would typically need an xy graph.


Another option would be to run a chart in a parallel loop at regular intervals and read the data via a local variable. See attach example.

Message 4 of 10

Hi Altenbach,


The program below works exactly as planned but i want to modify to get another 3 combinations.Can you help for this combination of flashing Leds ?

I can't quite get it working..


I want to control the on / off of 3 leds for the 6 states below:


led 1  led 2   led 3

on      off       off

on      on       off

off      on       off

off      on       on

off      off       on

on      off       on

Then repeat






0 Kudos
Message 5 of 10

You can create an array constant containing all of your combinations in order and iterate through them.


0 Kudos
Message 6 of 10

Hi Ravens Fan,


Thanks for the solution it works as requested.


The problem i have is i have based the original code on a larger program i have written to control real Leds through a DIO card.

The original code was a 1D Array and i could feed this more or less directly to the card without any problems.The code you have

given me uses a 2D Array and i can't feed this directly to the card in the same way without changing alot of the other code i have.

I get an error with data types.


Is there another solution you can think of that uses a 1D Array or is there a way to convert the 2D data ?  





0 Kudos
Message 7 of 10

It's always a risk that when you start adding new requirements that you didn't originally plan for, you'll be forced to modify more code than you intended.Smiley Wink


Notice that I am only sending a 1-D array of the booleans to the indicator.  I'm using index array to get out a particular state of booleans (1-D array coming from 2-D array) on any give loop iteration.  I'm not saying you should be sending a 2D array directly to a card.


I can't comment on how you should handle it because I haven't seen our your program architecture is working now.

0 Kudos
Message 8 of 10

From the Index Array output i am taking a wire to Boolean Array to Number ........from this output i can send this to my DIO Card

which outputs this as a Byte to the card output bits 0,1,2.

Unfortunately with this new version using the 2D array this set of wires brings up an error due to a data mismatch.


Thanks for your help.



0 Kudos
Message 9 of 10

As I said, there is nothing I can comment on unless I see your code.


Preferably the VI itself and not just a screen shot so I can play with it.

Message Edited by Ravens Fan on 03-03-2009 04:49 PM
0 Kudos
Message 10 of 10