LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Value changes after it goes through case structure tunnel

I think this is probably a pretty simple problem. Basically I've got a case structure and I tunnel in some values from a control and sim loop. When I probe the wires in the case structure after the tunnel and the wire before the case structure they are completely different. It makes no sense to me at all. What is even more wierd is that the program seems to be having the desired effect (well very nearly), which indicates to me that the probe is messed up, but I've restarted the program and the laptop but to no avail. I have attached a picture. Probe 7 and Probe 8 should be the same number.

 

Any help will be greatly appreciated.

0 Kudos
Message 1 of 24
(3,371 Views)

When I suspect weird probing issues I typically try two things:  1) Connect temporary indicators instead of probes.  2) Put breakpoints on each of the probes.

Message 2 of 24
(3,361 Views)

There is one obvious case where the two probes should not necessarily have the same value, though it is impossible to see if that is whats going on in your case:

 

If you have a case with, for example true and false case, if you have a probe in the false case, but the code is currently executing in the true case, then the probe outside the case could be different than the probe inside the case.

The fast way to check for this would be to also probe the input to your case diagram and make sure you are probing the currently active case in your case structure.

 

That said, I have had one time were something was just not right similar to what you describe and the fix ended up being a mass recompile of the vi.lib. You may get away with only forcing a recompile of your project and/or VI's. The quickest (but most local) recompile is to hold ctrl and shift on the keyboard and clicking the run arrow. (I Think thats the shortcut for forced recompile.. someone will correct me if I'm wrong..) 

QFang
-------------
CLD LabVIEW 7.1 to 2016
0 Kudos
Message 3 of 24
(3,359 Views)

Thanks, I did this and it turns out the probes are just acting dodgy... God knows why.

0 Kudos
Message 4 of 24
(3,352 Views)

Thanks for the reply. That isn't the case in my one. Shouldn't rebooting my laptop make the program recompile too? I did that and I still get the same problem.

0 Kudos
Message 5 of 24
(3,349 Views)

no, rebooting has nothing to do with recompiling or re-linking your source code or libraries.

QFang
-------------
CLD LabVIEW 7.1 to 2016
Message 6 of 24
(3,346 Views)

@VicMackie wrote:

Thanks, I did this and it turns out the probes are just acting dodgy... God knows why.


 

I reported a bug re: the probes not updating.

 

Ben

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 7 of 24
(3,345 Views)

Ahh I see, thank you.

 

I have another simple (I think) question. The same case structure as before, however the problem now is I want it to do nothing if the case is false. When I run the program, eventhough the case is false it runs the the true case. No idea why. I've again atached an image, probe 1 shows the case value and I set a breakpoint on the first division in the true case.

 

Thanks for all your help so far.

0 Kudos
Message 8 of 24
(3,339 Views)

This is now pretty much identical in behavior to what I saw about a year ago. I had some boolean logic and a case structure, and the case structure did not execut the case the boolean selector indicated (I replaced probes with indicators too, thinking the problem was with the probes).

 

If I remember correctly, what fixed it for me was essentially to delete the case structure and re-create it from the palette.

 

You may want to try this in an iterative fashion.. ie. copy your case the way you have it for reference, delete the case, draw a new case from the palette, then just select and drag-drop the code from your "backup". I know it sounds crazy, but this fixed it for me when I was thinking I was going mad.

 

Again, forcing a re-compile of your vi.lib/NI folder may also fix this without deleting and re-doing code. You would do this from Tools menu in a project, and browse your your version of LabVIEW's vi.lib folder. It can take quite a bit of time to complete though. 

QFang
-------------
CLD LabVIEW 7.1 to 2016
0 Kudos
Message 9 of 24
(3,330 Views)

Possible race conditions because of the way you are using local variables?

 

There are some funny boolean operations in there too that should be cleaned up.  There is no need to compare a boolean value to True.  The value is already true.  No need to compare a value to False, just put a Not function in there.

0 Kudos
Message 10 of 24
(3,327 Views)