LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Updating a numeric control does not cause an event

Solved!
Go to solution

I am updating the value of a numeric control using setctrlval() function.  I have a callback for the control that will read the value of the control and set a string value in another control.  When the control is updated using the setctrlval() function it does not cause an event.  I need the update of the value to trigger a function.  any suggestions?

0 Kudos
Message 1 of 4
(3,308 Views)
Solution
Accepted by topic author Joncombat

The Programmer's Toolbox has a CallCtrlCallback() function that you can use right after setting the value.

Message 2 of 4
(3,274 Views)

That is what I used to work around the issue.  The ATTR_VAL_CHANGED only faults when you manually type in a change into the control.  If you update it using setctrlval() it does not.  I am surprised they do not have an update event.  Thank you! 

0 Kudos
Message 3 of 4
(3,262 Views)

If you update it using setctrlval() it does not.  I am surprised they do not have an update event.

That is normal behavior, otherwise setting a value from that control's callback would loop endlessly. Without having to use CallCtrlCallback, you can simply call the callback function directly and pass it the proper event.

0 Kudos
Message 4 of 4
(3,102 Views)