Difference between revisions of "Program Examples:Create Motion:Torque Mode"
Line 1: | Line 1: | ||
+ | {{Languages|Program_Examples:Create_Motion:Torque_Mode}} | ||
The following example demonstrates how to issue a TORQUE command to two axes in Torque Mode, using a [[MC-Basic:TORQUE|TORQUE Command]].<br/> | The following example demonstrates how to issue a TORQUE command to two axes in Torque Mode, using a [[MC-Basic:TORQUE|TORQUE Command]].<br/> | ||
Please notice the invocation of the subroutine [[EtherCAT:EC_SET_MOTION_OPMODE|EC_SET_MOTION_OPMODE]] that sets the axis and the drive to | Please notice the invocation of the subroutine [[EtherCAT:EC_SET_MOTION_OPMODE|EC_SET_MOTION_OPMODE]] that sets the axis and the drive to |
Latest revision as of 05:51, 17 July 2017
Language: | English • 中文(简体) |
---|
The following example demonstrates how to issue a TORQUE command to two axes in Torque Mode, using a TORQUE Command.
Please notice the invocation of the subroutine EC_SET_MOTION_OPMODE that sets the axis and the drive to
'Torque Mode'.
Refer to Axis Setup Procedure for an explanation and an example of how to set up an axis.
program
attach a3
attach a5
call EC_SET_MOTION_OPMODE(a3, TORQUEMODE)
call EC_SET_MOTION_OPMODE(a5, TORQUEMODE)
a3.en=1
a5.en=1
sleep 1000
while 1
TORQUE a3 40 starttype=immediate abs = 1
TORQUE a5 -40 starttype=immediate abs = 1
sleep 3000
TORQUE a3 0 starttype=immediate abs = 1
TORQUE a5 0 starttype=immediate abs = 1
sleep 3000
end while
detach a3
detach a5
end program
The example corresponds to commit SHA-1: ba574128b365aebcd34f706e4c3a2c90762f7636 in GIT.