I have a question about task control button. In my project, I would like to disable the arm for a bit and show the button. The task can continue only after click continue button. So my question is can the control button stop the process and restart it as soon as the continue button is clicked.
Without knowing exactly what you’re trying to do, task control buttons can be used to control your task in any way. For instance, you can use the Position Control block to keep hold the subject’s arm at a position and use the task control button to turn Position Control on and off.
Let me know if that answers your question!
I noticed that there are enable events and disable events in the task control button. How does it turn Position Control on and off. I read the book, but do not understand the principle. When the button enable, does the process stay at this state and wait until user click button?
The enable events and disable events defined in the task control button section of the Parameter table are for controlling the button. For example, in Fig 7-4 in the Creating Task Programs for Dexterit-E 3.6 user guide, when event code 2 is sent to the DataLogging block, button #10 is enabled. Likewise, when event code 3 is transmitted to the DataLogging block, button #10 is disabled and button #11 is enabled.
Control the task state has to be done through Simulink and Stateflow. When a button is clicked, the button ID is transmitted via the task_control_button From tag. You can use that signal to transition to a Stateflow state where you want the position controller block to maintain the arm position. Then you can use another button click to exit that Stateflow state.
Enabling and disabling the position controller block is demonstrated in the “Position controller enable/disable” sample task. It demonstrates how to ramp up and ramp down the forces coming from the position controller block to make the movement feel more natural.