LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

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 Kudos
Message 1 of 27
(437 Views)

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 Kudos
Message 2 of 27
(429 Views)

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 Kudos
Message 3 of 27
(408 Views)

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 Kudos
Message 4 of 27
(405 Views)

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 Kudos
Message 5 of 27
(393 Views)

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 Kudos
Message 6 of 27
(392 Views)

Paul

 

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

0 Kudos
Message 7 of 27
(389 Views)

@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?

 

 


LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
0 Kudos
Message 8 of 27
(387 Views)

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 Kudos
Message 9 of 27
(384 Views)

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 Kudos
Message 10 of 27
(382 Views)