07-22-2010 08:14 AM
Hello world,
I can't put multiple parameters in SetCtrlVal function. I wanna switch on 7 leds at the same time. I have tried:
SetCtrlVal(panelHandle, (2,3,4,5,6,7,8), 1);
and another things but I don't success...
Is it posible to give multiple control with that function?
Can anyone help me?
Thank you in advance.
07-22-2010 08:46 AM
Hi,
in the programmers toolbox you can find the command SetAttributeForCtrls which sets the value of a certain control attribute in each of the specified controls.
07-22-2010 09:03 AM
I see:
int SetAttributeForCtrls (int panel, int attribute, int value, int numberOfCtrls, . . .);
But what is the attribute of a state led?
I try something like that but without sucess....
SetAttributeForCtrls(panelHandle, ????, 1, 7, PANEL_LED_1, PANEL_LED_2, PANEL_LED_3, PANEL_LED_4, PANEL_LED_5, PANEL_LED_6, PANEL_LED_7);
07-22-2010 09:06 AM
It's ok sorry...
I have found ATTR_CTRL_VAL
Thank you !!!
07-22-2010 09:09 AM
One possibility is using ATTR_CTRL_VAL.
In any case you can just use the help of a function, say SetCtrlAttribute, where you can change the control type to LED (or anything else) and you will see all the attributes available.
07-22-2010 09:10 AM
The equivalent to SetCtrlVal is SetCtrlAttribute (..., ... ATTR_CTRL_VAL, ...): you can try using this attribute also for SetAttributeForCtrls. For led controls this may be successful, but I seem to remember that SetAttributeForCtrls only accepts integer values so you should not be able to use it to set numeric controls vith different data types and the possibility to use it to set Led state is to be verified.