LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

SetCtrlVal with multiple parameters

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.

0 Kudos
Message 1 of 6
(4,148 Views)

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.

Message 2 of 6
(4,143 Views)

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);       

 

 

0 Kudos
Message 3 of 6
(4,139 Views)

It's ok sorry...

I have found ATTR_CTRL_VAL

 

Thank you !!!

0 Kudos
Message 4 of 6
(4,136 Views)

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.

0 Kudos
Message 5 of 6
(4,135 Views)

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.



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?
Message 6 of 6
(4,132 Views)