12-18-2008 02:07 PM
Hopefully someone can direct me on this. I'm stuck.
At CNT, I want it to start at zero entering the nested loop
and when the case statement equals one, add 3000 to it,
so I effectively shift over 'unwanted' elements in the 1D
array I am parsing...
TIA!
Solved! Go to Solution.
12-18-2008 02:31 PM
12-18-2008 02:35 PM - edited 12-18-2008 02:35 PM
Just left click the left side of the shift register and press:
Create >> Constant
12-18-2008 02:41 PM - edited 12-18-2008 02:44 PM
the nested loop shift register is not initialized , it is prefered to initialize it with a 0 constant
next, the Array subset function index input is connected after or before the incriment function ? i can't decide..
anyhow , if it is connected before the incremint function then the nested loop 1st iteration will send a 0 to the index input of the Array subset function.
eww ! , lots of inputs, functions words in the above paragraph lol 🙂 , can u get me here ?
now i just can't figure out the problem exactly you are talking about. the sequence of events for your code will be like this :
after the nested loop finishes, the output will be available (1D array of the Add Array Element function) to the case structure where you want to add 3000 to the value of the shift register and start the nested loop again with initialized registers with value = 3000? am i right ?
if i was right then you need to reinitialize the shift register using a control , creat a local variable from it and place it in the case structure then manipulate it there as shown below :
Since the numeric control "N" default data type Value is 0 , then initially the shift registers will be initialized with 0 as the guys stated above
Thanks
12-18-2008 03:12 PM - edited 12-18-2008 03:21 PM
I added the local variable but it doesn't like it.
I understand exactly what your doing but its not liking it.
Chet
12-18-2008 03:20 PM
12-18-2008 03:21 PM
12-18-2008 03:23 PM
Chet,
Both copies of the local are data sinks like an indicator. Change the one on the left to read rather than write. Do you have the Context Help on? Hovering over a broken wire with the wiring tool will give an explanation of what is wrong.
You could put a shift register on the outer loop and then no locals would be needed. Just wire straight through the other cases.
Lynn
12-18-2008 03:25 PM
You have connected an input of Add to an input of Local Variable.
Change one to an output
A wire must be connected to one and only one data source, such as a control's terminal or a function output. This wire is connected to two data sinks but zero sources. You must add a source, perhaps by changing an indicator to a control.
12-18-2008 03:28 PM
NB here.
Forgot to change to read.
It works!
Thankyou