LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

CVICALLBACK, Constant name

Solved!
Go to solution

hi

 

i have declared a same callback function (edit control << call back function) for few controls (x,y,z) in the *uir file.

 

am able to execute the same callback function when the control is operated. but i am unable to find which control is operated (either x, y or z)

 

please suggest a solution

 

regards

phani

phani srikanth
0 Kudos
Message 1 of 4
(3,765 Views)
Solution
Accepted by topic author PhaniChillara

switch (control) {

  case PANEL_COMMANDBUTTON:

    break;

  case PANEL_NUMERIC:

    break;

 

//... and so on

}



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 2 of 4
(3,764 Views)

this code looks like after knowing control is opearated, we can implement this. but how to know which control is operated.

 

For example

we have controls name x,y,z with same callback funtion "xyz"

 

if any of the control is operated, the "xyz" function is going to execute. at the point i would like to know which contorl is operated. either x, either y or either z.

 

 

 

phani srikanth
0 Kudos
Message 3 of 4
(3,759 Views)

Seems you are missing some basic concept on CVI callback mechanism.

 

When executing, each callback function receives some parameters that you may want / need to use in your code. Specifically:

-  'panel' parameter holds the handle of the panel the control is on

- 'control' parameter is the ID of the control that issued the callback

 

That is: whichever control is calling the callback, you may test the value of 'control' parameter at callback beginning and decide what to do based on this value. The control ID can be identificated based on the PANEL_CONTROL constant names you assign in the UIR editor, which is automatically generated and stored by CVI in the include file associated to the UIR file.



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 4 of 4
(3,751 Views)