LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Cluster value lost when leaving case structure

Solved!
Go to solution

Hello all,

 

I am having an issue with a particular VI I am working on. (FYI this is in Labview 8.0)

 

The VI is set up to run a current source, voltmeter, and thermometer and then record and graph data in various ways that are selectable by the user.

 

Everything seems to be working fine except one particular graphing method. When I try to graph Current vs. Voltage, the current value is gettiing lost. Within a case structure the current and voltage are combined into a cluster and then exit the case structre to be later appended to a cluster array.

 

However, the value of the cluster is being lost when the graph is set for Current vs. Voltage. Any other method and it is working properly.

 

I can't seem to figure out why this is happening as it does not make much sense that the other methods of graphing work but this one doesn't when it is coded the exact same other than having different variables.

 

I have attached the VI with added indicators showing that the cluster value is being lost once it exits the case structure. Any help would be much appreciated.

 

Thank you very much and I apologize for my extremely messy VI.

 

- Nathan Cernetic

0 Kudos
Message 1 of 5
(2,597 Views)

I don't see a current vs. voltage, but I do see a voltage vs. current in a case "2"?

 

There is no way for me to decod what you are trying to do.  I don't know if anyone else could.

 

You'll have to figure this one out yourself.  I recommend dropping probes on wires, along with additional indicators.  Set breakpoints  and use highlight execution to step through the code and watch the data flowing down the wires until you can figure out where and why your data is disappearing.

0 Kudos
Message 2 of 5
(2,590 Views)

Sorry, yes it is case 2 that I am having an issue with. I have already determined where the data is lost. It occurs when the cluster within case 2 leaves said case structure. I have indicators showing the cluster value both inside and outside the case and that value resets to 0 it seems once it leaves the case structre.

 

The other cases do not have this problem and the cluster values pass through properly.

 

I was wondering if anyone know of any instance where this has happened to someone else?

0 Kudos
Message 3 of 5
(2,587 Views)

Hi Nathan,

 

"I apologize for my extremely messy VI" - you really have to...

 

First:

Could you attach a stripped down version of this vi with only the problematic part using constants as input and without all those missing subvis! I couldn't spot the part you were speaking of, there's a "voltage vs. current"but no "current vs. voltage"?

 

Second:

Clean up the vi. Use autoindexing instead of "index array" and loop iterator. Use "+1" and "-1" functions. Use integer datatypes for case selector inputs. Your for loops used for building the file content don't make much sense without auto-indexing. You surely have more problems than just a graph "method"!

 

Edited:

I find only one case "2", but there is no cluster "leaving" that case, only inputs to that case...

Message Edited by GerdW on 06-19-2009 11:18 PM
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 5
(2,584 Views)
Solution
Accepted by topic author Saros

You really need to boil this down to something we can run and reproduce the issue.

 

Have you tried to break a few relevant connections and rewire? Maybe something is corrupt.

 

Beside being a mess, your VI has quite a few glaring mistakes.

 

Let's have a look at the structures in the upper right:

 

  • 90% of the code is the same in all three case structures, so all that needs to be inside the case structure is the small part where you built the 2D array. Everything else belongs outside the case.
  • The sequence structure has no useful function.
  • Why do you need to reverse the array with each iteration of the small FOR loop? Once before the loop would be enough. Right?
  • Why do you use built array inside the small FOR loop, but don't autoindex at the loop boundary? All you ever get is an array with exactly one element, no matter how much the loop runs. Seems useless! (see below image for an alternative).
  • You would not even need to reverse if you would use "built array" instead of "insert into array at position 0" in the central part.

 

 

 

Others: You constantly hammer all your property nodes. The only need to be called when things change. Again, you have way too many instances. For example in the case structure where you are having problems, the same property nodes exist in all cases. A single instance of the property node belong outside the case and only the string constants inside each case. Whenever code is the same in all cases of a case structure, that code belongs outside!

Message Edited by altenbach on 06-19-2009 03:39 PM
Message 5 of 5
(2,565 Views)