From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

change numeric control mode,it is still the initial mode

Solved!
Go to solution

 In panel.uir, I design an numeric initional control mode as INDICATOR,  then i change it's control mode to be HOT in my panel.c ,but the numeric is still unacceptible.

 

     SetCtrlAttribute(systemp2,SEQUINTERVAL,ATTR_CTRL_MODE,VAL_HOT);
     SetCtrlAttribute(systemp2,RBINTERVAL,ATTR_CTRL_MODE,VAL_HOT);
     GetCtrlVal(systemp2,SEQUINTERVAL,&val);
     GetCtrlVal(systemp2,RBINTERVAL,&rbl);

      both of the values of val and rbl are zero.

 

so how to change the indicator mode to be hot mode in the program?

0 Kudos
Message 1 of 3
(2,776 Views)

Hi,

 

did you check the return value of SetCtrlAttribute to see if the function call was successful? I noticed some non-printable character between M and O in your ATTR_CTRL_MODE, so maybe the function simply doesn't understand the argument?

0 Kudos
Message 2 of 3
(2,768 Views)
Solution
Accepted by topic author anyang

Additionally, SEQUINTERVAL is not in the form PANEL_CONTROLID required by the function so unless it is a variable where you store the correct valua, the function could be unable to translate it in the correct control id. Again, reading SetCtrlAttribute return code should evidence an error in the command. The same applies to RBINTERVAL.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 3 of 3
(2,762 Views)