LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Arbitrary Line State

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.

0 Kudos
Message 1 of 4
(2,556 Views)

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

0 Kudos
Message 2 of 4
(2,547 Views)

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.

0 Kudos
Message 3 of 4
(2,528 Views)

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

0 Kudos
Message 4 of 4
(2,512 Views)