LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to initialize x control to default value

Hi all

 

I have developed the X control in which I have one knob and 1 numeric control.

It is working fine. But when my VI stops , for next run i want my x control to get initialize to default value.

Right now it shows the last values.

How should I initialize X control to default values?

Do i need to do something with the init ctl of X control??

0 Kudos
Message 1 of 4
(3,545 Views)

Hi,

 

I think its not possible to directly initialize the X control to its default value using its property. But you can initialize its value during each run in the X Control itself. You can set the value of each control in the "Exec State Change" event. I have attached an example XControl which has a knob and a numeric control. Have a look at it,

Message 2 of 4
(3,513 Views)

The XCtrl Init ability is only run when a VI is loaded into memory (aka, when you open the VI). Resetting the XCtrl to a default value depends on what you actually want to reset :

- Specific controls from within the XCtrl : follow Citra's post

- The "real" data of the XCrtl : from a local variable or property node from the calling VI. You still can use the aforementioned method for this one (make sure you set the Data Changed flag to True).

 

-Eric

Eric M. - Senior Software Engineer
Certified LabVIEW Architect - Certified LabVIEW Embedded Systems Developer - Certified LabWindows™/CVI Developer
Neosoft Technologies inc.

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

Hi,

 

you might create a property or method for your XCtrl. Then you would call that at the start of your VI...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 4
(3,494 Views)