取消
显示结果 
搜索替代 
您的意思是: 

initialize shift register

已解决!
转到解答

Hi,

 

How do you intialize the shift register (inside the second for loop) so that it starts from 0 everytime the program runs. I have tried attaching a 0 constant to the left shift register, but that just resets the register every time it goes through the inner loop.

 

Thanks

0 项奖励
1 条消息(共 5 条)
10,731 次查看
解答
已被主题作者 mnanda98 接受
If you only want to reset it once at the beginning, and not for each iteration of the outer for loop, you need to add another shift register on the outer for loop and wire the 0 to that shift register.

LabVIEW Champion, CLA, CLED, CTD
(blog)
2 条消息(共 5 条)
10,725 次查看

It is not completely clear exactly what you want it to do. You may need an additional shift register on the outer loop. Initialize that to zero. Inside the outer loop wire the inside left terminal to the outside left terminal of the inner loop shift register and similarly wire the outputs.

 

Lynn

3 条消息(共 5 条)
10,723 次查看

You haven't included the rest of your program, so it's hard to tell. You need to set the value on the farthest out loop because everything inside the top level loop will get reset unless you pass that memory space from iteration to iteration.

LoopsInLoops.png

 

 

Follow the dataflow to really understand why you need to do it this way. 

LabVIEW programming is based entirely on dataflow and parallelism. This is incredibly powerful and has lead to its success over the years (coupled with the graphical programming), but is usually one of the first things that new developers stumble over. The Highlight Execution feature is a great way to watch how your application utilizes dataflow.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


4 条消息(共 5 条)
10,714 次查看

There are other ways to do this as well if you really want to avoid data being passed outside your little loop. You can get fancy with a feedback node and an initialization terminal, or your can use a First Call? boolean.

LoopsInLoopsInLoops.png

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


5 条消息(共 5 条)
10,691 次查看