LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Trouble using enums to source data from a cluster inside a loop

Solved!
Go to solution

Hello! I'm new to LabVIEW, and I'm having trouble using enums and accessing the data afterwards. More specific, I'm trying to make a subVI to read information from a cluster, and then unbundle it by name and display it on a simple numeric display. 

 

On Untitled 3 I've done a state machine, that has 3 options: "Initialize" (where the cluster and the information is being stored), then it's respective cases "price" (which it's a simple index array and an unbundle by name) and "count" (same things as in price). My problem is it won't display the data, I've tried executing by step several times and it doesn't exit the loop, I'm trying to make sense out of it with no success. 

 

On Untitled 4 it's a simple for loop that executes the subVI (untitled 3), I place a probe right after the subVI and it's never executed ... 

 

I am aware it's a simple problem but a little bit of help would be very useful. 

 

Kind Regards! 

Download All
0 Kudos
Message 1 of 7
(934 Views)

Two quick words of advice:

 

  • Save for previous so more people can actually see your VIs (most don't have LabVIEW 2021 yet).
  • Give your VIs a reasonable and unique name. (untitled 3.vi and untitled 4.vi are not reasonable names because most download folders already have files with that name, so the browser will rename "Untitled 3.vi" as e.g. "Untitled 3 (2).vi" and your caller will open the wrong subVI!!!) causing confusion.
Message 2 of 7
(929 Views)

Oki, I saved for LabVIEW 2019 and they are renamed. 

 

 

Download All
0 Kudos
Message 3 of 7
(871 Views)
Solution
Accepted by topic author Blancoys

Your SubVI loop is running forever instead of only once. You have to change 'false' constant to 'true'. 

Message 4 of 7
(861 Views)

That was the whole issue, thank you! 

 

Now I'm able to read what's in the cluster.

0 Kudos
Message 5 of 7
(850 Views)

If you would replace your shift register with a feedback node, you would not even need a loop!

 

altenbach_0-1649088074332.png

 

In any case, the architecture is questionable and not really scalable.

 

Message 6 of 7
(827 Views)

You're right, I hadn't thought of doing it with a case structure. 

 

I'm new to it so I'm a bit limited in the different ways of approaching it, but you've been very helpful, thank you so much 😁

0 Kudos
Message 7 of 7
(804 Views)