LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Modify Shift Register

Solved!
Go to solution

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!

0 Kudos
Message 1 of 10
(3,943 Views)
I'm not completely sure what you are asking.  Based on "At CNT, I want it to start at zero entering the nested loop", it sounds like you want to initialize that shift register.  Right click on the left hand side shift register and select Create Constant.  It will wire a constant of 0 to it.  Now, that For Loop will have that shift register start at 0 on the first iteration every time that For Loop is called.  Otherwise it will retain the value from the last iteration of the last time it was called.
0 Kudos
Message 2 of 10
(3,921 Views)

Just left click the left side of the shift register and press:

Create >> Constant

 

 

Message Edited by Cory K on 12-18-2008 02:35 PM
Cory K
0 Kudos
Message 3 of 10
(3,913 Views)
Solution
Accepted by topic author csk

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

 

Message Edited by MAshraf on 12-18-2008 02:42 PM
Message Edited by MAshraf on 12-18-2008 02:44 PM
Eng. Mohammed Ashraf
Certified LabVIEW Associated Developer
InnoVision Systems Founder, RF Test Development Engineer
www.ivsystems-eg.com
0 Kudos
Message 4 of 10
(3,906 Views)

I added the local variable but it doesn't like it.

 

I understand exactly what your doing but its not liking it.

 

Chet

Message Edited by csk on 12-18-2008 03:21 PM
Download All
0 Kudos
Message 5 of 10
(3,883 Views)
would you please put the mouse pointer on the broken wire and tell me what does the message says ?
Eng. Mohammed Ashraf
Certified LabVIEW Associated Developer
InnoVision Systems Founder, RF Test Development Engineer
www.ivsystems-eg.com
0 Kudos
Message 6 of 10
(3,878 Views)
obviously because you have to (right click) the Local variable with the broken wire and change to Read
Eng. Mohammed Ashraf
Certified LabVIEW Associated Developer
InnoVision Systems Founder, RF Test Development Engineer
www.ivsystems-eg.com
0 Kudos
Message 7 of 10
(3,875 Views)

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 

Message 8 of 10
(3,871 Views)

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.

0 Kudos
Message 9 of 10
(3,868 Views)

NB here.

 

Forgot to change to read.

 

It works!

 

Thankyou

0 Kudos
Message 10 of 10
(3,864 Views)