LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Table not updating while command button is held down

Solved!
Go to solution

Hi guys,

 

My application obtains data and then outputs this into a table which updates after each set of data is read. This part works fine, however I also require the user to be able to hold down one of two buttons to control control the function of an actuator (forwards and rearwards). To explain this further, when one of these buttons are pressed a voltage is output, when released the voltage is reset to zero. However, while the button is held down the table does not continue to update, when the button is released the table then updates through all the queued values. I understand that this is most likely a problem with the holding of the button causing the other user interface events to not be processed. I have therefore tried using ProcessSystemEvents(), ProcessDrawEvents(), and experimented with using an async timer to control the updating of the UI through the use of PostDeferredCallback(), all without success.

 

If anyone can help with a solution that would allow me to perform both of these required functions simultaneously it would be greatly appreciated!

 

Thanks in advance

 

Ben

0 Kudos
Message 1 of 4
(3,228 Views)

Could you use a toggle button instead of a simple button to be hold down? If yes, then in the button callback you could simple test the value of the toggle (1 if pressed, 0 if released) and operate turn on/off the output voltage to the actuator. You'll have a commit event every time the operator changes button state. (you may need to apply some security limit switch or timeput on the control in case the user forgets to turn the toggle off: the situation is similar to a three-state switch that controls a motorized window blind).



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,224 Views)

Thanks Roberto, I have previously experimented with a toggle button for this application but wanted to avoid it as I found that when handing the application over to others they found it far less intuitive and tried using it like a press and hold button. I would therefore like to avoid having to click a toggle button once to start and again to stop if at all possible.

0 Kudos
Message 3 of 4
(3,217 Views)
Solution
Accepted by topic author cottonb

Problem solved, by simply just swallowing the event I am able to achieve the desired functions!

 

Cheers

 

Ben

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