LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to Update Main VI Front Panel from SubVI in Real-Time Using Control/Indicator Reference Cluster ?

Solved!
Go to solution

Hi everyone,

 

I'm trying to make sure that my output cluster gets updated at every state within a SubVI (not just at the end of the loop/state machine).

 

To solve this, I tried using references to update the cluster in real-time. However, I now get this error :


LabVIEW: (Hex 0x41F) Object reference is invalid.

 

Can anyone explain how to handle this correctly, or show best practices for updating a cluster output from within a SubVI at each state?


I can provide my project file if needed.

 

Thank you very much for your help!

0 Kudos
Message 1 of 9
(226 Views)

I looked a bit at your project; but it wasn't obvious where the error is occurring.

And you gave zero information about the location of the error (not even the name of the VI), and no info about the conditions to reproduce it.

Also, your wiring is inexcusably messy.

0 Kudos
Message 2 of 9
(215 Views)

You have attached a pile of VIs scattered over several folders and some controls seems to be missing. It would also really help to tell us the name of the top-level VI.

0 Kudos
Message 3 of 9
(183 Views)

Assuming "VI Phase 2" is the top-level and "Manche" is the subVI, I seem some glaring errors:

 

  • There is only one reference connected, but you have a total of 6 similar (but different!) references, so five are not wired. Only one state (INIT) has a valid reference. You need to delete all the duplicates place the reference before the loop, and wire to all property nodes.
  • Don't use accents in file names, because LabVIEW cannot find them on English computers.

 

altenbach_1-1749852040734.png

 

Also:

 

  • There should be nothing orange anywhere.
  • There is a +1 primitive.

 

0 Kudos
Message 4 of 9
(180 Views)

Thank you for your feedback, and sorry for any confusion.

 

I want to mention that I’m still a beginner with LabVIEW, I’ve only spent about 10–12 hours on the software so far. I’m sure my wiring and practices aren’t up to standard yet, but I’m trying to improve as I learn.

To clarify, the error happens in the interaction between the main VI "VI Phase 2" and the subVI "Manche". If you focus on that part, you should be able to reproduce the issue.

Thank you for taking the time to look at my project and to offer advice !

0 Kudos
Message 5 of 9
(138 Views)

Thank you very much for your detailed answer and suggestions.

 

To be honest, I am not really sure how to implement the logic with references. I have trouble understanding how to set up the reference cluster, pass it to the subVI, and use property nodes could you possibly provide a simple example, or step-by-step instructions for one control/indicator ?

 

Also, regarding the orange wires: the score counting indicators in my VI are themselves orange (probably because they're tied to numeric values), so I don’t see how I can replace the current connections with blue wires or blue constants. Could you clarify what you mean here ? 

 

Finally, I don’t understand what a "+1 primitive" is in LabVIEW.

 

 

Thank you again for your time and help. I really appreciate your guidance as I am still very new to LabVIEW.

AlexAkaDoope_0-1749908628271.png

 

0 Kudos
Message 6 of 9
(131 Views)

LabVIEW "wires" (as you know) carry data.  The Wire appearance changes with the type of data.  Here is a partial summary:

  • Scalar value -- thin wire
  • 1-D Array of values -- thicker wire
  • 2-D Array of values -- pair of thicker wires
  • Cluster (general) -- patterned dark brown (?) wire
  • Error Line ("special" cluster) -- patterned light brown wire
  • Asynchronous Channel Wire -- "pipe" appearance
  • Floating point value (sgl, dbl, others) -- orange wire
  • Integer (signed or unsigned) value -- blue wire
  • Boolean value -- green wire

If you are counting things (like how many times a While or For loop is running, the "index" value), you should use an integer (as the loop runs either 2 or 3 times, never 2.2 times).  If you are asking "is it on or off?", you should use a Boolean, rather than two integers (such as 0 or 1).

 

Generally, it is usually "better" (clearer, faster, etc.) to put values in wires, rather than references to values.

 

Bob Schor

0 Kudos
Message 7 of 9
(114 Views)

Thank you so much for your detailed explanation ! I now have a clear understanding of each wire color and type in LabVIEW.

 

I wasn't 100% certain about the distinction between blue and orange wires before, but your message has clarified this perfectly. The other colors were already clear to me, but having this comprehensive overview is very helpful.

 

I'll make the necessary adjustments to my code based on your recommendations. I also appreciate the advice about using direct values in wires instead of references.

 

Thanks again for taking the time to provide such clear guidance !

0 Kudos
Message 8 of 9
(112 Views)
Solution
Accepted by topic author AlexAkaDoope

I’ve resolved my issue by changing my approach !

 

Instead of retrieving information from each state of the sub-VI, I now directly feed the output of the sub-VI into my indicator cluster (present in the main VI). In my sub-VI, I pass all the data I want to use for displaying on my indicators, and then I manage the display of this data in the relevant states of my main VI. It’s much simpler, easier to implement, and a lot less tedious.

 

Thanks to everyone who replied to my post and contributed to find a solution !

0 Kudos
Message 9 of 9
(97 Views)