07-14-2011 06:28 PM
I am trying to light LED at different timed intervals. This is my only goal. How can I change the line state at any desired time and create different timed based sequence. I have attached the code, but the digital pulses are just shown for illustration actual intervals do not reflect that. Thanks.
07-14-2011 07:02 PM
One way is to create an array of boolean values at equally spaced time intervals. Then put the Digital Write inside a for loop with a Wait function set to the time interval.
Lynn
07-15-2011 01:59 PM
OK I have used numeric array and array of boolean type to run different lines. Now how can I permanently store these values to arrays. I have used "Data Operations" > "Make current value default" but it doesn't work for just one element but rather sets a value for a whole column. Any way around this I have attached my code.
07-15-2011 05:45 PM
I think your problem may be related to the different lengths of the arrays. You are using autoindexing at the loop boundary, which is generally a good thing. When the arrays have different length, what happens on the iteration after the last element in the shortest array has been "consumed?" Run your VI with Highlight Execution (light bulb on block diagram toolbar) enabled and watch the behavior.
It is not clear what should happen in those cases. You may need separate loops or some test to see if an array is empty or something else.
The waits will run in parallel so the timing may not be what you want.
Lynn