LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

XControls - traps for race condition ?

I recently created my first XControl by following the recipe in the temp-example.
It worked nicely, but for one thing. When I initialized my XControl in my LabVIEW program via
a local variable, this would not work, except when I run the program under highlighted execursion.
After some back and forth with NI, I've been informed that this is becuase of a race condition.
My local is written to, but immidiatley after, it is overwritten by the XControls initialization routine.
 
Possible fixes are, as NI correctly has informed me, to either put a wait x ms in the beginnning
of the main program, or to use a notifier function in the XControls initialization, and check this in the beginning of
the main program.
 
In my opinion, ideally this should be handled internally in the XControl ONLY in some way, and be
transparent to the program using the XControl.
And I would like to ask NI to consider this problem before next release.

Other comments ?
  
Martin
Message 1 of 2
(2,594 Views)
Exactly the same problem i've been breaking my head over for the last two hours. Thanks for posting the solution, now my Xcontrol works.
0 Kudos
Message 2 of 2
(2,482 Views)