Hello,
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.
Labtech5555
Try something like this, perhaps? Just plug in your desired numbers.
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.
Labtech5555
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.
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
Thanks,
Labtech5555
You can create an array constant containing all of your combinations in order and iterate through them.
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 ?
Labtech5555
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.![]()
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.
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.
Labtech5555
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.