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

Data do not pass through case structure

Jacobier_1-1604104080861.png

Jacobier_2-1604104235989.png

 

I am using shift register to store some data into arrays. There is something wired happen and I could not figure out why. In the first figure, appended array and y32 are connected. However, their value is not the same (see second figure). Can someone tell me why data do not pass through the case structure and how to fix this please?

0 项奖励
1 条消息(共 27 条)
3,267 次查看

It is extremely difficult to find the "mis-wiring" from a picture (a tiny one, at that).  You should attach the actual VI, so that we can "play" with it (I'd straighten out the wires, make sure all are connected, take a look at the "hidden" Case code, make sure I can "see" the functions you are using, etc.).

 

Please attach the actual VI.  [How would you like to debug a picture of a 500-line listing of a C++ program?  Wouldn't you really rather have the .cpp file?]

 

Bob Schor

0 项奖励
2 条消息(共 27 条)
3,259 次查看

You shouldn't expect them to be the same.  "appended array" is inside a case structure, "y 3 2" is outside.

"If you weren't supposed to push it, it wouldn't be a button."
0 项奖励
3 条消息(共 27 条)
3,238 次查看

Sorry. I actually circumvented the problem with a very wired solution, although I di not solved it. think the problem could be caused by upper the level VIs, because I saw a strange issue in another VI at the same level as well.  The program is pretty big. Do I need to attach everything?

 

I attached my modified file here. I only changed other places, the place I am confused with remained there. 

0 项奖励
4 条消息(共 27 条)
3,235 次查看

You've use local variables to create a bunch of race conditions.  The behavior is unpredictable.

"If you weren't supposed to push it, it wouldn't be a button."
0 项奖励
5 条消息(共 27 条)
3,223 次查看

I have another similar code. It works. I think the issue is caused somewhere else.  This is my upper level code. Do you think it could be the root of the problem?

0 项奖励
6 条消息(共 27 条)
3,222 次查看

Paul

 

This is the way I circumvent the problem. Is there any better solution?

0 项奖励
7 条消息(共 27 条)
3,219 次查看

@Jacobier wrote:

I attached my modified file here. I only changed other places, the place I am confused with remained there. 


All you probably need is a single shift register with a 2D array.

 

Your use of local variables is completely misguided. These local variables on the right will be read once at the start of the program an then ever again. This means you are operating on values that that nothing to do with the final content. They are NOT needed. Did you do  some of the basic tutorials about dataflow?

 

 

0 项奖励
8 条消息(共 27 条)
3,217 次查看

That is what happen to my original code (as shown in the figure 1). The shift register enter the case structure. Then it is refresh to 0. 

0 项奖励
9 条消息(共 27 条)
3,214 次查看

The local valuable does make something wired in other places. I removed them and directly connect to the shift register. But nothing comes out.

0 项奖励
10 条消息(共 27 条)
3,212 次查看