Calling a LabWindows™/CVI™ Callback Function within Another Callback Function

Updated May 3, 2018

Reported In

Software

  • LabWindows/CVI

Issue Details

When inside a callback function, can I call the code from another callback function? 

For example, if there were two different buttons on the UIR file, button1 and button2, that were related to two callbacks, callback1 and callback2,  how could I call the code from callback1 from a certain section of callback2, without the need to press button1?

Solution

You just need to make a call to the callback1 function from within callback2, making sure to pass the event argument as an EVENT_COMMIT. 

Callback functions are standard C functions, so you can call them from other parts of your program. See Example.zip, attached to this document, for an example.

Attachments

WAS THIS ARTICLE HELPFUL?

Not Helpful