LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

XControl Default Values

Solved!
Go to solution

For some XControls, I can easily set the default value for the data in the "Direction Change" event of the Facade.vi.

However for some XControls, that doesn't work because an extra "Data Change" event is received with the data value being the default for the type (not the default of the typedef Data.ctl).

Here is the sequence of events:

Data Change (value received = default for type)
Direction Change
Display State Change
Exec State Change
Timeout

Data Change (value received = default for type)
Timeout

I can't figure out why some XControls get an extra "Data Change" event.

 

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

Can you attach a simple project that shows the behavior?  It would be useful to be able to see the behavior and try to reproduce it.

Ryan D.

Applications Engineering

0 Kudos
Message 2 of 4
(3,884 Views)
Solution
Accepted by paul_cardinale

It turns out that the 'Direction Change' event in the Facade.vi is the wrong place to set the default value.

A 'Data Change' event can happen after 'Direction Change', depending on what's going on in the 'Facade.vi'. The correct place to set the default value is in the 'Init.vi'.  Here is the template I use:init.png

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

Did you just "solve" your own problem?  If so, please mark your post as the Solution to help other Forum readers who might be interested (it's really OK to do that).

 

Bob Schor

0 Kudos
Message 4 of 4
(3,865 Views)