10-29-2007 01:21 PM
10-29-2007 01:46 PM
nvm.... figured out
PANEL_bs is a pointer(altho i couldnt dereference it wit *)...I found i could display the values using getctrlval to a variable then use that variable. isn't there a direct way to do it ?
10-29-2007 03:36 PM
In fact, PANEL_bs and PANEL_N22 are constants (not pointers); you will find them #define'd in the header file which is automatically generated by the UIR editor, and included in your program.
You need to get the switch state into a variable, and use that variable to set the indicator, something like this:
int switchState;
...
GetCtrlVal (panelHandle, PANEL_bs, &switchState);
SetCtrlVal (panelHandle, PANEL_N22, switchState);
I believe that's about as direct as it gets ![]()
Regards,
Colin.
10-29-2007 07:52 PM
btw im a noob in labwindows, altho i love coding in C, matlab.
the weird part is you can use setctrlval to toggle the switch using 1 or 0 directly, or a variable.
SetCtrlVal (panelHandle, PANEL_bs, (1 or 0 or temp) ); // temp =1 or 0
soit seems logical to handle PANEL_bs as an int variable which changes while toggling.
10-30-2007 05:43 AM