06-13-2025 03:39 PM
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!
Solved! Go to Solution.
06-13-2025 04:06 PM - edited 06-13-2025 04:07 PM
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.
06-13-2025 04:41 PM
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.
06-13-2025 04:51 PM - edited 06-13-2025 05:22 PM
Assuming "VI Phase 2" is the top-level and "Manche" is the subVI, I seem some glaring errors:
Also:
06-14-2025 07:56 AM
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 !
06-14-2025 08:40 AM
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.
06-14-2025 09:42 AM
LabVIEW "wires" (as you know) carry data. The Wire appearance changes with the type of data. Here is a partial summary:
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
06-14-2025 09:59 AM
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 !
06-14-2025 10:45 AM
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 !