Example for MovingCap turnTRACK349 Ethernet or other rotary actuators
Here is a simple example of a rotary motor that is to work with angular coordinates (360° correspond to one revolution):
#id driveSimplePosTest.py 2025-02-04 oh
# This is a simple positioning demo for a MovingCap turnTRACK 349 rotary drive.
import sys
import mcdrive as mc
def WaitTargetReached():
# Check statusword for "target reached"
while (mc.ChkReady() == 0):
sys.wait(1)
# only continue if no error
while (mc.ChkError() != 0):
sys.wait(1)
# check digital input IN2 - if low, add a second of pause/delay time
if mc.ChkIn(2) == 0:
sys.wait(1000)
# initial wait, don't surprise me with immediate movement
sys.wait(2000)
# Set 6092h.01h Feed constant to 360 --> one turn = 360°
mc.WriteObject(0x6092, 0x01, 360)
# general init
mc.EnableDrive()
mc.SetAcc(500)
mc.SetDec(500)
mc.SetPosVel(360)
# and go...
while(1):
# set digital output OUT1 to high during move to position 0
mc.SetOut(1)
mc.GoPosAbs(0)
WaitTargetReached()
# reset OUT1 to low
mc.ClearOut(1)
mc.GoPosAbs(1000)
WaitTargetReached()
mc.GoPosAbs(180)
WaitTargetReached()
•Save this program in a .py file, e.g. as driveSimplePosTest.py.
•Open the Code (Python) area in the MovingCap web interface
•Select this file via Browse... and click on the Upload button to the right of it.

•Ensure that the drive can start up safely and start the program with the Run button
Example program for a linear axis with preset travel limit (soft limit)
Here is an alternative demo program, suitable for a linear drive with micrometer position units. The speed mc.SetPosVel(150000)used below corresponds to 15cm/second.
#id driveSoftlimitBackForth.py 2025-05-10 oh
# simple MovingCap flatTRACK application demo
# precondition: softlimit objects 607Dh.1h and 607D.2h set
import sys
import mcdrive as mc
def ChkReady():
# Check statusword for "target reached"
while (mc.ChkReady() == 0):
sys.wait(1)
# only continue if no error
while (mc.ChkError() != 0):
sys.wait(1)
# safety: only run this script if softlimit objects are set up properly
softLimitMin = mc.ReadObject(0x607d, 1)
softLimitMax = mc.ReadObject(0x607d, 2)
if ((softLimitMin == 0 and softLimitMax == 0) or softLimitMax <= (softLimitMin + 1000)):
print("flatTRACK demo abort. Check softlimit objects 607Dh.1h and 607D.2h!")
else:
# initial wait, don't surprise me with immediate movement
sys.wait(5000)
# general init
mc.EnableDrive()
mc.SetAcc(10000) # 6083h.0h profile acceleration = 10000 * 1000 μm/s²
mc.SetDec(10000) # Note: With RABBIT position control, the decelation is symmetrical / same as acceleration and the SetDec value has no effect.
mc.WriteObject(0x60A4, 0, 500000) # 60A4h.0h profile jerk = 500000 * 1000 μm/s³. A good default is 50x the acceleration.
mc.SetPosVel(150000) # 150000 μm/s (150 mm/s) maximum speed.
# and go...
while(1):
mc.GoPosAbs(softLimitMin)
ChkReady()
mc.GoPosAbs(softLimitMax)
ChkReady()
•Save this program in a .py file as described above and run it in your MovingCap flatTRACK linear actuator.