10-17-2005 01:02 PM
10-17-2005 01:52 PM
10-17-2005 01:58 PM - edited 10-17-2005 01:58 PM
Message Edited by tbob on 10-17-2005 01:00 PM
12-15-2011 06:22 AM
I've been using this structure successfully for several implementations. However, now I want the while loop to run through a set of values (6 out of range values for voltage reading). Any tips on what data type I should input to the shift register? Or should I use a for loop instead?
12-15-2011 10:09 AM
@livermor wrote:
I've been using this structure successfully for several implementations. However, now I want the while loop to run through a set of values (6 out of range values for voltage reading). Any tips on what data type I should input to the shift register? Or should I use a for loop instead?
If you will be using 6 known values, put the values into an array and use a For loop. Wire the array into the For loop with indexing enabled (which is the default setting). No need for start, stop, or increment.
12-19-2011 05:49 AM
Ok, tried that. But now it looks as if the value is passed into N and the shift register, but the loop does not execute. (Have highlighted it a couple times to see the flow)
12-19-2011 03:19 PM
The "N" input of a For Loop tells the For Loop how many times to run.
Your Enum item called "0.125" probably has a numeric value of "0".
12-20-2011 01:36 AM - edited 12-20-2011 01:42 AM
So I should use some kind of size of array thing and wire that to N maybe? I'll try to do something like that.
EDIT:
Changing the enum to an array and then using the size thing worked.
12-20-2011 10:15 AM
If you are using an array, just wire the array to the For Loop border and you will see a hollow box on the border. This means that indexing is enabled. This means that the For loop will index each element out of the array on each iteration, and it will run until the last array element is processed. You don't need the size thing and you don't need to wire anything to the N. Try it. If the hollow box is solid instead, right click on the box and select Enable Indexing. This turns a solid box to a hollow one. When indexing is disabled (solid box), the entire array is passed inside the loop instead of just one element at a time.