LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Boolean value fails using reference and global variable

My sub vi executes commands over a Modbus connection, staying in the sub vi for about 15 seconds and sending 5 differrent Modbus commands. I need the user to see the progress of that communication and have two staus LED on the main panel. In the sub vi, (Calibration_Stack_01.vi) I set up a global variable vi (Cal-1.vi) with two references, one for low calibration and one for high calibration. In the main program, (OxiFTE V6002.vi) the global variables go through a property node to convert the reference to an ordinary Boolean for the pront panel LED property node. The code executes just fine, except that the value between property nodes in the main program never changes from False to True. (see probe image that was caught while the LED should have been ON)

Is there something simple that I have missed, or am I way off base? 

Download All
0 Kudos
Message 1 of 9
(3,294 Views)
You are way off base. Your subVI just needs to write to the reference's property. No globals required in the subVI or main.
0 Kudos
Message 2 of 9
(3,277 Views)

When I set up the references like this, the property node in the main vi does not update until the sub vi is finished.

0 Kudos
Message 3 of 9
(3,244 Views)
You don't appear to have any understanding of references. You need to pass the reference of a main's indicator to the subVI via the connector pane. On the subVI, you take that reference and wire it to a property node set for write. Write the value to that property node. You are doing everything backwards. Look again at the examples.
0 Kudos
Message 4 of 9
(3,232 Views)

If I understood references, I wouldn't be here. Thanks for telling me I'm an idiot.

 

Message 5 of 9
(3,225 Views)

And BTW, your explanations are nowhere near helpful.

0 Kudos
Message 6 of 9
(3,220 Views)
I didn't say you were an idiot. I said your code does not do anything like the examples do. Are you actually passing the references to the subVI? The images don't show that and you need to start there.
0 Kudos
Message 7 of 9
(3,208 Views)

Running this VI lets the sub VI do whatever it wants with the boolean indicators.

Example_VI_BD.png

 

This VI is the sub of the first one.  It blinks the indicators on the FP.

sub_BD.png

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 8 of 9
(3,200 Views)

Thank you, Jim.

0 Kudos
Message 9 of 9
(3,184 Views)