LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

XControl Race Condition

I have an XControl called "Super Variant".

In the frame on the left, writing an error cluster to a local variable of an instance of "Super Variant" causes the facade's "Data Change" event to be triggered (which updates the "SubCtl" property.

Unfortunately, the Facade.vi doesn't get called until after the frame on the right starts running; so the "SubCtl" property returns the previous value.

I'm looking for some kind of synchronization trick to get the Read SubCtl Property to wait for the facade (if necessary).

 

paul_cardinale_0-1664560222144.png

 

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 1 of 3
(945 Views)

I might be on the wrong track here, but are you sure that the Facade.vi is actually being called when you write to the XControl's local variable?

There is a note in the LabVIEW help on XControls which suggests that you may need to use the Value (signalling) property instead.

 

Note  LabVIEW does not call the Facade VI on every write to the terminal or local variable. LabVIEW calls the Facade VI when the XControl requires an update. You cannot build an XControl that logs data written to its terminal because not every value is reported to the Facade VI. Use the Value (Signaling) property to write values if you want the Facade VI to update on every value written to the XControl.
0 Kudos
Message 2 of 3
(912 Views)

Yes, the facade is definitely being called.  But it runs asynchronously.  

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 3 of 3
(891 Views)