ECMC: EtherCAT open source motion control.
Motion control based on the open source EtherCAT master (www.etherlab.org). The motion package is integerated into the ESS EPCIS environment (E3).
Loading...
Searching...
No Matches
Macros | Functions
ecmcMotion.h File Reference

Motion commands. More...

Go to the source code of this file.

Macros

#define CHECK_AXIS_RETURN_IF_ERROR(axisIndex)
 
#define CHECK_AXIS_RETURN_IF_ERROR_AND_BLOCK_COM(axisIndex)
 
#define CHECK_AXIS_ENCODER_RETURN_IF_ERROR(axisIndex)
 
#define CHECK_AXIS_ENCODER_CFG_RETURN_IF_ERROR(axisIndex)
 
#define CHECK_AXIS_CONTROLLER_RETURN_IF_ERROR(axisIndex)
 
#define CHECK_AXIS_DRIVE_RETURN_IF_ERROR(axisIndex)
 
#define CHECK_AXIS_TRAJ_RETURN_IF_ERROR(axisIndex)
 
#define CHECK_AXIS_SEQ_RETURN_IF_ERROR(axisIndex)
 
#define CHECK_AXIS_MON_RETURN_IF_ERROR(axisIndex)
 

Functions

int moveAbsolutePosition (int axisIndex, double positionSet, double velocitySet, double accelerationSet, double decelerationSet)
 Move axis to an absolute position.
.
 
int moveRelativePosition (int axisIndex, double positionSet, double velocitySet, double accelerationSet, double decelerationSet)
 Move axis to a relative position.
.
 
int moveVelocity (int axisIndex, double velocitySet, double accelerationSet, double decelerationSet)
 Move axis in a constant velocity.
.
 
int stopMotion (int axisIndex, int killAmplifier)
 Stop axis.
.
 
int moveHome (int axisIndex, int nCmdData, double homePositionSet, double velocityTowardsCamSet, double velocityOffCamSet, double accelerationSet, double decelerationSet)
 Execute homing sequence.
.
 
int setPosition (int axisIndex, double homePositionSet)
 set position.
used by epics autosave to restore axis value after ioc reboot.
 
int getAxisError (int axisIndex)
 Get axis error state.
.
 
int getAxisErrorID (int axisIndex)
 Get axis error code.
.
 
int getAxisCycleCounter (int axisIndex, int *counter)
 Get axis execution cycle counter.
Can be used for checking that logic for an axis object is executing.
.
 
int getAxisDebugInfoData (int axisIndex, char *buffer, int bufferByteSize)
 Get axis debug information string.
.
 
int getAxisStatusStructV2 (int axisIndex, char *buffer, int bufferByteSize)
 Get axis status structure V2.
.
 
int getAxisExecute (int axisIndex, int *value)
 Get axis execute bit.
.
 
int getAxisCommand (int axisIndex, int *value)
 Get axis command word.
.
 
int getAxisCmdData (int axisIndex, int *value)
 Get axis command data word.
.
 
int getAxisReset (int axisIndex, int *value)
 Get axis reset bit.
.
 
int getAxisEnabled (int axisIndex, int *value)
 Get axis amplifier state bit.
.
 
int getAxisEnable (int axisIndex, int *value)
 Get axis amplifier command bit.
.
 
int getAxisBlockCom (int axisIndex, int *block)
 Get axis block external com.
If true the axis will not take any active commands via cmd
parser (statuses can still be read).
.
 
int getAxisBusy (int axisIndex, int *value)
 Get axis busy bit.
.
 
int getAxisEncVelo (int axisIndex, double *velo)
 Get axis act velo.
.
 
int getAxisTrajVelo (int axisIndex, double *velo)
 Get axis traj velo.
.
 
int getAxisID (int axisIndex, int *value)
 Get axis index.
.
 
int getAxisEnableAlarmAtHardLimits (int axisIndex, int *value)
 Get enable alarms at limits bit.
.
 
int getAxisSoftLimitPosBwd (int axisIndex, double *value)
 Get backward soft-limit position.
.
 
int getAxisSoftLimitPosFwd (int axisIndex, double *value)
 Get forward soft-limit position.
.
 
int getAxisEnableSoftLimitBwd (int axisIndex, int *value)
 Get backward soft-limit enabled state of an axis.
.
 
int getAxisEnableSoftLimitFwd (int axisIndex, int *value)
 Get forward soft-limit enabled state of an axis.
.
 
int getAxisAcceleration (int axisIndex, double *value)
 Get axis acceleration setpoint.
.
 
int getAxisDeceleration (int axisIndex, double *value)
 Get axis deceleration setpoint.
.
 
int getAxisTargetPos (int axisIndex, double *value)
 Get axis target position setpoint.
.
 
int getAxisTargetVel (int axisIndex, double *value)
 Get axis target velocity setpoint.
.
 
int getAxisDone (int axisIndex, int *value)
 Get axis done bit.
.
 
int getAxisAtHardFwd (int axisIndex, int *value)
 Get state of forward hard limit.
.
 
int getAxisLimitSwitchFwd (int axisIndex, int *value)
 Same as getAxisAtHardFwd() but better name.
.
 
int getAxisAtHardBwd (int axisIndex, int *value)
 Get state of backward hard limit.
.
 
int getAxisLimitSwitchBwd (int axisIndex, int *value)
 Same as getAxisAtHardBwd() but better name.
.
 
int getAxisEncHomed (int axisIndex, int *value)
 Get encoder homed bit.
.
 
int getAxisEncPosAct (int axisIndex, double *value)
 Get actual encoder position.
.
 
int getAxisEncVelAct (int axisIndex, double *value)
 Get actual encoder velocity.
.
 
int getAxisAtHome (int axisIndex, int *value)
 Get state of reference/home switch.
.
 
int getAxisCntrlError (int axisIndex, double *value)
 Get actual pid controller error.
.
 
int getAxisHomeVelOffCam (int axisIndex, double *value)
 Get off cam referencing/homing velocity setpoint.
.
 
int getAxisHomeVelTowardsCam (int axisIndex, double *value)
 Get Towards cam referencing/homing velocity setpoint.
.
 
int getAxisEncScaleNum (int axisIndex, double *value)
 Get the numerator part of the encoder scale.
.
 
int getAxisEncScaleDenom (int axisIndex, double *value)
 Get the denominator part of the encoder scale.
.
 
int getAxisEncPosRaw (int axisIndex, int64_t *value)
 Get raw unscaled encoder value.
.
 
int getAxisCntrlOutPpart (int axisIndex, double *value)
 Get PID-controller proportional output part.
.
 
int getAxisCntrlOutIpart (int axisIndex, double *value)
 Get PID-controller integral output part.
.
 
int getAxisCntrlOutDpart (int axisIndex, double *value)
 Get PID-controller differential output part.
.
 
int getAxisCntrlOutFFpart (int axisIndex, double *value)
 Get PID-controller feed forward output part.
.
 
int getAxisCntrlOutput (int axisIndex, double *value)
 Get PID-controllegetAxisAtHomer total output part.
.
 
int getAxisDrvScale (int axisIndex, double *value)
 Get the drive output scale factor.
.
 
int getAxisDrvEnable (int axisIndex, int *value)
 Get enable state of drive.
.
 
int getAxisMonAtTarget (int axisIndex, int *value)
 Get at target.
.
 
int getAxisType (int axisIndex, int *value)
 Get axis type.
.
 
const char * getAxisTrajTransExpr (int axisIndex, int *error)
 Get axis trajectory transformation expression.
.
 
const char * getAxisEncTransExpr (int axisIndex, int *error)
 Get axis encoder transformation expression.
.
 
const char * getAxisPLCExpr (int axisIndex, int *error)
 Get axis sync. PLC expression.
.
 
int getAxisTrajSource (int axisIndex, int *value)
 Get axis trajectory data source.
.
 
int getAxisEncSource (int axisIndex, int *value)
 Get axis encoder data source.
.
 
int getAxisAllowCommandsFromPLC (int axisIndex, int *value)
 Get axis allow command from PLC.
.
 
int getAxisPLCEnable (int axisIndex, int *value)
 Get axis enable for axis sync. PLC.
.
 
int setAxisExecute (int axisIndex, int value)
 Set axis execute bit.
.
 
int setAxisCommand (int axisIndex, int value)
 Set axis command word.
.
 
int setAxisCmdData (int axisIndex, int value)
 Set axis command data word.
.
 
int setAxisEnable (int axisIndex, int value)
 Set axis amplifier enable command bit.
.
 
int setAxisEnableMotionFunctions (int axisIndex, int enablePos, int enableConstVel, int enableHome)
 Set enable of motion functions.
.
 
int setAxisEnableAlarmAtHardLimits (int axisIndex, int value)
 Set enable alarms at limits bit.
.
 
int setAxisBlockCom (int axisIndex, int block)
 Block/unblock communicatiom from via cmd parser.
.
 
int setAxisEnableSoftLimitBwd (int axisIndex, int value)
 Set enable backward soft-limit of an axis.
.
 
int setAxisEnableSoftLimitFwd (int axisIndex, int value)
 Set enable forward soft-limit of an axis.
.
 
int setAxisSoftLimitPosBwd (int axisIndex, double value)
 Set backward soft-limit position.
.
 
int setAxisSoftLimitPosFwd (int axisIndex, double value)
 Set forward soft-limit position.
.
 
int setAxisEnableAlarmAtSoftLimit (int axisIndex, int value)
 Enable alarm when at softlimit.
 
int setAxisAcceleration (int axisIndex, double value)
 Set axis acceleration setpoint.
.
 
int setAxisDeceleration (int axisIndex, double value)
 Set axis deceleration setpoint.
.
 
int setAxisEmergDeceleration (int axisIndex, double value)
 Set axis emergency deceleration setpoint.
.
 
int setAxisJerk (int axisIndex, double value)
 Set axis maximum jerk setpoint.
.
 
int setAxisTargetPos (int axisIndex, double value)
 Set axis target position setpoint.
.
 
int setAxisTargetVel (int axisIndex, double value)
 Set axis target velocity setpoint.
.
 
int setAxisJogVel (int axisIndex, double value)
 Set axis jog velocity setpoint.
.
 
int setAxisExtSetPos (int axisIndex, double value)
 Set axis external position setpoint.
.
 
int setAxisEncScaleDenom (int axisIndex, double value)
 Set the denominator part of the encoder scale.
.
 
int setAxisEncScaleNum (int axisIndex, double value)
 Set the numerator part of the encoder scale.
.
 
int setAxisEncInvHwReady (int axisIndex, int invert)
 Invert Encoder Ready bit.
 
int setAxisHomePos (int axisIndex, double value)
 Set axis home reference position setpoint.
.
 
int setAxisErrorId (int axisIndex, int errorId)
 Set axis error code.
.
 
int setAxisEncHomeLatchCountOffset (int axisIndex, int count)
 Set home index pulse count offset.
.
 
int setAxisHomeVelTowardsCam (int axisIndex, double dVel)
 Set Towards cam referencing/homing velocity setpoint.
.
 
int setAxisHomeVelOffCam (int axisIndex, double dVel)
 Set off cam referencing/homing velocity setpoint.
.
 
int axisErrorReset (int axisIndex, int value)
 Set gear ration setting.
.
 
int setAxisPLCTrajVelFilterEnable (int axisIndex, int enable)
 Enables/disables velocity filter of external setpoint.
.
 
int setAxisPLCTrajVelFilterSize (int axisIndex, int size)
 Set size of external trajectory velocity filter.
.
 
int setAxisPLCEncVelFilterEnable (int axisIndex, int enable)
 Enables/disables velocity filter of external actual value.
.
 
int setAxisPLCEncVelFilterSize (int axisIndex, int size)
 Set size of external encoder velocity filter.
.
 
int setAxisEncVelFilterSize (int axisIndex, int size)
 Set size of encoder velocity filter.
.
 
int setAxisEncPosFilterSize (int axisIndex, int size)
 Set size of encoder position filter.
.
 
int setAxisEncPosFilterEnable (int axisIndex, int enable)
 Enables/disables encoder position filter.
.
 
int setAxisTrajSource (int axisIndex, int value)
 Set axis trajectory data source.
.
 
int setAxisEncSource (int axisIndex, int value)
 Set axis encoder data source.
.
 
int setAxisTrajStartPos (int axisIndex, double value)
 Set axis trajectory start position. NOTE: NOT USED!!.
.
 
int setAxisEncOffset (int axisIndex, double value)
 Set encoder offset value.
.
 
int setAxisEncType (int axisIndex, int value)
 Set encoder type.
.
 
int setAxisEncBits (int axisIndex, int bits)
 Set encoder register bit count.
.
 
int setAxisEncAbsBits (int axisIndex, int bits)
 Set encoder register bit count for absolute data.
.
 
int setAxisEncRawMask (int axisIndex, uint64_t rawMask)
 Set encoder raw data mask.
.
 
int addAxisEnc (int axisIndex)
 Add encoder object to axis.
.
 
int selectAxisEncPrimary (int axisIndex, int index)
 Select encoder to be used for control.
.
 
int selectAxisEncConfig (int axisIndex, int index)
 Select encoder to configured.
.
 
int setAxisEncEnableRefAtHome (int axisIndex, int enable)
 Set referance this encoder at homing.
 
int getAxisEncPrimaryIndex (int axisIndex, int *index)
 Get index of current encoder being used for control (PID).
.
 
int getAxisEncConfigIndex (int axisIndex, int *index)
 Get index of current encoder being configured.
.
 
int setAxisEncRefToOtherEncAtStartup (int axisIndex, int encRef)
 Reference this encoder to other encoder at startup.
.
 
int setAxisEncMaxDiffToPrimEnc (int axisIndex, double value)
 Set maximum position deviation between current encoder and primary encoder.
.
 
int setAxisCntrlKp (int axisIndex, double value)
 Set PID-controller proportional gain.
.
 
int setAxisCntrlKi (int axisIndex, double value)
 Set PID-controller integral gain.
.
 
int setAxisCntrlKd (int axisIndex, double value)
 Set PID-controller differential gain.
.
 
int setAxisCntrlKff (int axisIndex, double value)
 Set PID-controller feed forward gain.
.
 
int setAxisCntrlDeadband (int axisIndex, double value)
 Set PID-controller deadband.
.
 
int setAxisCntrlDeadbandTime (int axisIndex, int value)
 Set PID-controller deadband time filter.
.
 
int setAxisCntrlInnerParams (int axisIndex, double kp, double ki, double kd, double tol)
 Use a differnt set of pid parameters if within a certain distance of target.
 
int setAxisCntrlOutHL (int axisIndex, double value)
 Set PID-controller maximum output value.
.
 
int setAxisCntrlOutLL (int axisIndex, double value)
 Set PID-controller minimum output value.
.
 
int setAxisCntrlIpartLL (int axisIndex, double value)
 Set PID-controller minimum integral part output value.
.
 
int setAxisCntrlIpartHL (int axisIndex, double value)
 Set PID-controller maximum integral part output value.
.
 
int getAxisDrvScaleNum (int axisIndex, double *value)
 Get drive output scale numerator.
.
 
int setAxisDrvScaleNum (int axisIndex, double value)
 Set drive output scale numerator.
.
 
int setAxisDrvScaleDenom (int axisIndex, double value)
 Set drive output scale denominator.
.
 
int setAxisDrvVelSetOffsetRaw (int axisIndex, double value)
 Set drive raw velocity offset.
.
 
int setAxisDrvBrakeEnable (int axisIndex, int enable)
 Set enable of brake.
.
 
int setAxisDrvBrakeOpenDelayTime (int axisIndex, int delayTime)
 Set brake open delay time .
.
 
int setAxisDrvBrakeCloseAheadTime (int axisIndex, int aheadTime)
 Set brake close ahead time .
.
 
int setAxisDrvStateMachineTimeout (int axisIndex, double seconds)
 Set drive timeout .
.
 
int setAxisDrvReduceTorqueEnable (int axisIndex, int enable)
 Set enable of reduce torque functionality.
.
 
int getAxisMonAtTargetTol (int axisIndex, double *value)
 Set drive type.
OBSOLETE COMMAND. USE CREATEAXIS(id,type,drvtype).
 
int setAxisMonAtTargetTol (int axisIndex, double value)
 Set "at target" monitoring tolerance.
.
 
int setAxisEnableCheckEncsDiff (int axisIndex, int enable)
 Set "at target" monitoring tolerance.
.
 
int getAxisMonAtTargetTime (int axisIndex, int *value)
 Get "at target" monitoring time (cycles).
.
 
int setAxisMonAtTargetTime (int axisIndex, int value)
 Set "at target" monitoring time (cycles).
.
 
int getAxisMonEnableAtTargetMon (int axisIndex, int *value)
 Get enable "at target" monitoring.
.
 
int setAxisMonEnableAtTargetMon (int axisIndex, int value)
 Enable "at target" monitoring.
.
 
int getAxisMonPosLagTol (int axisIndex, double *value)
 Get position lag maximum monitoring tolerance.
.
 
int setAxisMonPosLagTol (int axisIndex, double value)
 Set position lag maximum monitoring tolerance.
.
 
int getAxisMonPosLagTime (int axisIndex, int *value)
 Get position lag monitoring time (cycles).
.
 
int setAxisMonPosLagTime (int axisIndex, int value)
 Set position lag monitoring time (cycles).
.
 
int getAxisMonEnableLagMon (int axisIndex, int *value)
 Get position lag monitoring enable.
.
 
int setAxisMonEnableLagMon (int axisIndex, int value)
 Enable position lag monitoring.
.
 
int getAxisMonMaxVel (int axisIndex, double *value)
 Get maximum allowed velocity.
.
 
int setAxisMonMaxVel (int axisIndex, double value)
 Set maximum allowed velocity.
.
 
int setAxisMonEnableMaxVel (int axisIndex, int value)
 Enable maximum velocity monitoring (over speed).
.
 
int getAxisMonEnableMaxVel (int axisIndex, int *value)
 Get enable maximum velocity monitoring (over speed).
.
 
int setAxisMonMaxVelDriveILDelay (int axisIndex, int value)
 Set velocity monitoring interlock delay for drive.
.
 
int setAxisMonMaxVelTrajILDelay (int axisIndex, int value)
 Set velocity monitoring interlock delay for trajectory.
.
 
int getAxisMonLatchLimit (int axisIndex, int *value)
 Get latch on limit settings.
.
 
int setAxisMonLatchLimit (int axisIndex, int value)
 Set latch limit settings.
.
 
int setAxisSeqTimeout (int axisIndex, int value)
 Set sequence timeout time in seconds.
.
 
int setAxisHomeSeqId (int axisIndex, int value)
 Set homing sequence id for current encoder beeing configured.
.
 
int setAxisHomeAcc (int axisIndex, double acc)
 Set homing acceleration for current encoder beeing configured.
.
 
int setAxisHomeDec (int axisIndex, double acc)
 Set homing deceleration for current encoder beeing configured.
.
 
int setAxisHomePostMoveEnable (int axisIndex, int enable)
 Set homing post movement enable.
 
int setAxisHomePostMoveTargetPosition (int axisIndex, double targetPosition)
 Set homing post movement target position.
 
int setAxisMonEnableCntrlOutHLMon (int axisIndex, int value)
 Enable controller output high limit monitoring.
.
 
int setAxisMonCntrlOutHL (int axisIndex, double value)
 Set monitoring controller output high limit.
.
 
int setAxisMonEnableVelocityDiff (int axisIndex, int value)
 Enable monitoring of velocity difference.
.
 
int setAxisMonVelDiffTrajILDelay (int axisIndex, int value)
 Set trajectory interlock filter time in cycles for velocity difference monitoring.
.
 
int setAxisMonVelDiffDriveILDelay (int axisIndex, int value)
 Set drive interlock filter time in cycles for velocity difference monitoring.
.
 
int setAxisMonVelDiffTol (int axisIndex, double value)
 Set maximum allowed difference between setpoint speed and actual speedĀ±n.
 
int setAxisMonEnableExternalInterlock (int axisIndex, int value)
 Enable motion axis interlock from EtherCAT entry.
.
 
int setAxisMonEnableAnalogInterlock (int axisIndex, int value)
 Enable motion axis interlock from analog EtherCAT entry.
A typical usecase is temperature sensors.
.
 
int setAxisMonExtHWInterlockPolarity (int axisIndex, int value)
 Set polarity of motion axis interlock from EtherCAT entry.
.
 
int setAxisMonAnalogInterlockPolarity (int axisIndex, int value)
 Set polarity of motion axis interlock from EtherCAT entry.
.
 
int setAxisMonAnalogInterlockRawLimit (int axisIndex, double value)
 Set analog interlock raw value limit .
.
 
int getAxisMonExtHWInterlockPolarity (int axisIndex, int *pol)
 Get polarity of motion axis interlock from EtherCAT entry.
.
 
int setAxisMonLimitBwdPolarity (int axisIndex, int value)
 Set polarity of hard low limit switch.
.
 
int getAxisMonLimitBwdPolarity (int axisIndex, int *pol)
 Get polarity of hard low limit switch.
.
 
int setAxisMonLimitFwdPolarity (int axisIndex, int value)
 Set polarity of hard high limit switch.
.
 
int getAxisMonLimitFwdPolarity (int axisIndex, int *pol)
 Get polarity of hard high limit switch.
.
 
int setAxisMonHomeSwitchPolarity (int axisIndex, int value)
 Set polarity of home switch.
.
 
int getAxisMonHomeSwitchPolarity (int axisIndex, int *pol)
 Get polarity of home switch.
.
 
int setAxisAllowCommandsFromPLC (int axisIndex, int value)
 Allow commands from PLCs.
.
 
int setAxisPLCEnable (int axisIndex, int value)
 Enable axis sync PLC expression.
.
 
int appendAxisPLCExpr (int axisIndex, char *expr)
 Append axis sync. PLC expression.
.
 
int compileAxisPLCExpr (int axisIndex)
 Compile Axis PLC code
.
 
int createAxis (int axisIndex, int axisType, int drvType, int trajType)
 Creates an axis object at index axisIndex.
 
int linkEcEntryToAxisEnc (int slaveBusPosition, char *entryIdString, int axisIndex, int encoderEntryIndex, int entryBitIndex)
 Links an EtherCAT entry to the encoder object of the axis at axisIndex.
 
int linkEcEntryToAxisDrv (int slaveBusPosition, char *entryIdString, int axisIndex, int driveEntryIndex, int entryBitIndex)
 Links an EtherCAT entry to the drive object of the axis at axisIndex.
 
int linkEcEntryToAxisMon (int slaveBusPosition, char *entryIdString, int axisIndex, int monitorEntryIndex, int entryBitIndex)
 Links an EtherCAT entry to the monitor object of the axis at axisIndex
.
 
int linkEcEntryToAxisStatusOutput (int slaveIndex, char *entryIDString, int axisIndex)
 Links an EtherCAT entry to the an axis object for status output
.
 
int linkEcEntryToAxisSeqAutoModeSet (int slaveIndex, char *entryIDString, int axisIndex)
 Links an EtherCAT entry to the an axis object for
setting drive mode
.
 
int linkEcEntryToAxisSeqAutoModeAct (int slaveIndex, char *entryIDString, int axisIndex)
 Links an EtherCAT entry to the an axis object for
reading actual drive mode
.
 
int setAxisAutoModeCmdHoming (int axisIndex, int cmd)
 Set axis auto mode command for homing.
.
 
int setAxisAutoModeCmdMotion (int axisIndex, int cmd)
 Set axis auto mode command for motion.
.
 
int setDiagAxisIndex (int axisIndex)
 Set axis index for detailed motion diagnostics.
.
 
int setDiagAxisFreq (int freq)
 Set axis frequency of detailed motion diagnostics printouts.
.
 
int setDiagAxisEnable (int enable)
 Enable detailed motion diagnostics printouts.
.
 
int getAxisModRange (int axisIndex, double *range)
 Get axis modulo range.
.
 
int setAxisModRange (int axisIndex, double range)
 Set axis modulo range.
.
 
int setAxisModType (int axisIndex, int type)
 Set axis modulo motion type.
.
 
int getAxisModType (int axisIndex, int *value)
 Set axis modulo motion type.
.
 
int setAxisDisableAtErrorReset (int axisIndex, int disable)
 Disable axis at error reset
.
 
int setAxisAllowSourceChangeWhenEnabled (int axisIndex, int allow)
 Allow change of encoder and trajectory source when axis is enabled.
 
int getAxisValid (int axisIndex)
 Returns 1 if axis index is in use.
 
int setAxisEmergencyStopInterlock (int axisIndex, int stop)
 Init emergency stop ramp for an axis.
 

Detailed Description

Motion commands.

Macro Definition Documentation

◆ CHECK_AXIS_CONTROLLER_RETURN_IF_ERROR

#define CHECK_AXIS_CONTROLLER_RETURN_IF_ERROR ( axisIndex)
Value:
{\
CHECK_AXIS_RETURN_IF_ERROR(axisIndex);\
if (axes[axisIndex]->getCntrl() == NULL) {\
LOGERR("ERROR: Controller object NULL.\n");\
return ERROR_MAIN_CONTROLLER_OBJECT_NULL;\
}\
}\

◆ CHECK_AXIS_DRIVE_RETURN_IF_ERROR

#define CHECK_AXIS_DRIVE_RETURN_IF_ERROR ( axisIndex)
Value:
{\
CHECK_AXIS_RETURN_IF_ERROR(axisIndex);\
if (axes[axisIndex]->getDrv() == NULL) {\
LOGERR("ERROR: Drive object NULL.\n");\
return ERROR_MAIN_DRIVE_OBJECT_NULL;\
}\
}\

◆ CHECK_AXIS_ENCODER_CFG_RETURN_IF_ERROR

#define CHECK_AXIS_ENCODER_CFG_RETURN_IF_ERROR ( axisIndex)
Value:
{\
CHECK_AXIS_RETURN_IF_ERROR(axisIndex);\
if (axes[axisIndex]->\
getConfigEnc() == NULL) {\
LOGERR("ERROR: Encoder object NULL.\n");\
return ERROR_MAIN_ENCODER_OBJECT_NULL;\
}\
}\

◆ CHECK_AXIS_ENCODER_RETURN_IF_ERROR

#define CHECK_AXIS_ENCODER_RETURN_IF_ERROR ( axisIndex)
Value:
{\
CHECK_AXIS_RETURN_IF_ERROR(axisIndex);\
if (axes[axisIndex]->\
getEnc() == NULL) {\
LOGERR("ERROR: Encoder object NULL.\n");\
return ERROR_MAIN_ENCODER_OBJECT_NULL;\
}\
}\

◆ CHECK_AXIS_MON_RETURN_IF_ERROR

#define CHECK_AXIS_MON_RETURN_IF_ERROR ( axisIndex)
Value:
{\
CHECK_AXIS_RETURN_IF_ERROR(axisIndex);\
if (axes[axisIndex]->getMon() == NULL) {\
LOGERR("ERROR: Monitor object NULL.\n");\
return ERROR_MAIN_MONITOR_OBJECT_NULL;\
}\
}\

◆ CHECK_AXIS_RETURN_IF_ERROR

#define CHECK_AXIS_RETURN_IF_ERROR ( axisIndex)
Value:
{\
if (axisIndex >= ECMC_MAX_AXES || axisIndex <= 0) {\
LOGERR("ERROR: Axis index out of range.\n");\
return ERROR_MAIN_AXIS_INDEX_OUT_OF_RANGE;\
}\
if (axes[axisIndex] == NULL) {\
LOGERR("ERROR: Axis object NULL\n");\
return ERROR_MAIN_AXIS_OBJECT_NULL;\
}\
}\

◆ CHECK_AXIS_RETURN_IF_ERROR_AND_BLOCK_COM

#define CHECK_AXIS_RETURN_IF_ERROR_AND_BLOCK_COM ( axisIndex)
Value:
{\
CHECK_AXIS_RETURN_IF_ERROR(axisIndex);\
if (axes[axisIndex]->getBlockExtCom()) {\
LOGERR("ERROR: External Commands Disabled\n");\
return ERROR_MAIN_AXIS_EXTERNAL_COM_DISABLED;\
}\
}\

◆ CHECK_AXIS_SEQ_RETURN_IF_ERROR

#define CHECK_AXIS_SEQ_RETURN_IF_ERROR ( axisIndex)
Value:
{\
CHECK_AXIS_RETURN_IF_ERROR(axisIndex);\
if (axes[axisIndex]->getSeq() == NULL) {\
LOGERR("ERROR: Sequence object NULL.\n");\
return ERROR_MAIN_SEQUENCE_OBJECT_NULL;\
}\
}\

◆ CHECK_AXIS_TRAJ_RETURN_IF_ERROR

#define CHECK_AXIS_TRAJ_RETURN_IF_ERROR ( axisIndex)
Value:
{\
CHECK_AXIS_RETURN_IF_ERROR(axisIndex);\
if (axes[axisIndex]->getTraj() == NULL) {\
LOGERR("ERROR: Trajectory object NULL.\n");\
return ERROR_MAIN_TRAJECTORY_OBJECT_NULL;\
}\
}\

Function Documentation

◆ addAxisEnc()

int addAxisEnc ( int axisIndex)

Add encoder object to axis.
.

Adds another encoder to axis object(max is 8).
After this command have been executed, all following encoder configuration
commands will be applied to the newly created encoder object.
Note: An encoder object will be automatically created when the axis object is created,
this encoder will have index 0. The first "extra" encoder created with addAxisEnc
function will therefore have encoder index 1, the next 2....

Parameters
[in]axisIndexAxis index.
Returns
0 if success or otherwise an error code.
Note
Example: Add encoder to axis object 3.
"Cfg.AddAxisEnc(3)" //Command string to ecmcCmdParser.c.

◆ appendAxisPLCExpr()

int appendAxisPLCExpr ( int axisIndex,
char * expr )

Append axis sync. PLC expression.
.

Add one line to the axis PLC code.
The axis PLC expression is used for enabling and executing of axes based on mathematical expressions. This is useful when synchronizing axes i.e. a slave axis could be enabled and executed at the same time as the master axis.
Example: Enable of axis 2 is related to the enable command of axis 1 and 5. The execute command is related to an expression including the execute command for axis 2 and 7.
"ax2.drv.enable:=ax1.drv.enable or ax5.drv.enable|".
For more syntax help plese view PLC syntax (setPLCExpr()).

Parameters
[in]axisIndexAxis index.
[in]exprPLC expression.
Returns
0 if success or otherwise an error code.
Note
Example: Set PLC expression for axes 5 to ax2.drv.enable:=ax1.drv.enable or ax5.drv.enable|.
"Cfg.setAxisPLCExpr(5)=ax2.drv.enable:=ax1.drv.enable or ax5.drv.enable|" //Command string to ecmcCmdParser.c.

◆ axisErrorReset()

int axisErrorReset ( int axisIndex,
int value )

Set gear ration setting.
.

Note: The gear ratio is only valid during synchronized motions.

Parameters
[in]axisIndexAxis index.
[in]ratioNumGear ratio factor numerator.
[in]ratioDenomGear ratio factor denominator.
Returns
0 if success or otherwise an error code.
Note
Example: Set gear ratio setting for axis 3 to 1/7.
"Cfg.SetAxisGearRatio(3,1,7)" //Command string to ecmcCmdParser.c.
Set axis reset bit.
Parameters
[in]axisIndexAxis index.
[in]valueState of axis reset bit.
Returns
0 if success or otherwise an error code.
Note
Example: Set reset bit for axis 3.
"Main.M3.bReset=1" //Command string to ecmcCmdParser.c.
Todo
"TwinCAT syntax. Needs to be changed.

◆ compileAxisPLCExpr()

int compileAxisPLCExpr ( int axisIndex)

Compile Axis PLC code
.

For more syntax help plese view PLC syntax (setPLCExpr()).

Parameters
[in]axisIndexAxis index.
Returns
0 if success or otherwise an error code.
Note
Example: Compile code for the PLC of axis 5.
"Cfg.CompileAxisPLC(5)" //Command string to ecmcCmdParser.c.

◆ createAxis()

int createAxis ( int axisIndex,
int axisType,
int drvType,
int trajType )

Creates an axis object at index axisIndex.

Parameters
[in]axisIndexIndex of axis to address.
[in]axisTypeType of axis.
type = 1 : Normal axis (drive, encoder, monitor,pid-controller,trajectory).
type = 2 : Virtual axis (encoder, monitor, trajectory).
[in]drvTypeType of axis.
type = 0 : Simple drive (stepper).
type = 1 : DS402 drive.
[in]trajTypeType of trajectory generator.
type = 0 : Trapetzoidal.
type = 1 : Jerk limited (s-curve, ruckig).
Returns
0 if success or otherwise an error code.
Note
Example: Create a normal axis with stepper drive at axisIndex 1.
"Cfg.CreateAxis(1)" //Command string to ecmcCmdParser.c
Example: Create a virtual axis at axisIndex 1 (no drive).
"Cfg.CreateAxis(1,2)" //Command string to ecmcCmdParser.c
Example: Create a normal axis with DS402 drive at axisIndex 1.
"Cfg.CreateAxis(1,2,1)" //Command string to ecmcCmdParser.c
Example: Create a normal axis with DS402 drive and S-curve traj.
"Cfg.CreateAxis(1,2,1,1)" //Command string to ecmcCmdParser.c

◆ getAxisAcceleration()

int getAxisAcceleration ( int axisIndex,
double * value )

Get axis acceleration setpoint.
.

Parameters
[in]axisIndexAxis index.
[out]valueacceleration setpoint.
Returns
0 if success or otherwise an error code.
Note
Example: Get acceleration setpoint for axis 3.
"Main.M3.fAcceleration?" //Command string to ecmcCmdParser.c.
Todo
"TwinCAT syntax. Needs to be changed.

◆ getAxisAllowCommandsFromPLC()

int getAxisAllowCommandsFromPLC ( int axisIndex,
int * value )

Get axis allow command from PLC.
.

An axis can receive commands from PLCs (expressions).
However, the axis must be allow to receive these commands, see command getAxisPLCExpr() for more information.

Parameters
[in]axisIndexAxis index.
[out]valueenable.
Returns
0 if success or otherwise an error code.
Note
Example: Get axis enable command from other axis for axis 3.
"getAxisAllowCommandsFromPLC(3)" //Command string to ecmcCmdParser.c.

◆ getAxisAtHardBwd()

int getAxisAtHardBwd ( int axisIndex,
int * value )

Get state of backward hard limit.
.

Checks state of backward hard limit switch.

Parameters
[in]axisIndexAxis index.
[out]valuestate of backward limit switch.
Returns
0 if success or otherwise an error code.
Note
Example: Get state of backward limit switch for axis 3.
"Main.M3.bLimitBwd?" //Command string to ecmcCmdParser.c.
Todo
"TwinCAT syntax. Needs to be changed.

◆ getAxisAtHardFwd()

int getAxisAtHardFwd ( int axisIndex,
int * value )

Get state of forward hard limit.
.

Checks state of forward hard limit switch.

Parameters
[in]axisIndexAxis index.
[out]valuestate of forward limit switch.
Returns
0 if success or otherwise an error code.
Note
Example: Get state of forward limit switch for axis 3.
"Main.M3.bLimitFwd?" //Command string to ecmcCmdParser.c.
Todo
"TwinCAT syntax. Needs to be changed.

◆ getAxisAtHome()

int getAxisAtHome ( int axisIndex,
int * value )

Get state of reference/home switch.
.

Parameters
[in]axisIndexAxis index.
[out]valuestate of reference/home switch.
Returns
0 if success or otherwise an error code.
Note
Example: Get state of reference/home switch for axis 3.
"Main.M3.stAxisStatus?" //The command returns a complete structure of information including the state of the reference switch //Command string to ecmcCmdParser.c.
Todo
"TwinCAT syntax. Needs to be changed.

◆ getAxisBlockCom()

int getAxisBlockCom ( int axisIndex,
int * block )

Get axis block external com.
If true the axis will not take any active commands via cmd
parser (statuses can still be read).
.

Parameters
[in]axisIndexAxis index.
[out]blockAxis blocked.
Returns
0 if success or otherwise an error code.
Note
Example: Get axis block for axis 3.
"GetAxisBlockCom(3)" //Command string to ecmcCmdParser.c.

◆ getAxisBusy()

int getAxisBusy ( int axisIndex,
int * value )

Get axis busy bit.
.

The axis busy bit is high while an command is executed or while synchronizing to other axes.

Parameters
[in]axisIndexAxis index.
[out]valuestate of axis busy bit.
Returns
0 if success or otherwise an error code.
Note
Example: Get busy state for axis 3.
"Main.M3.bBusy?" //Command string to ecmcCmdParser.c.
Todo
"TwinCAT syntax. Needs to be changed.

◆ getAxisCmdData()

int getAxisCmdData ( int axisIndex,
int * value )

Get axis command data word.
.

The command data word is an argument linked to the axis command. See fbDriveVirtual manual for more information.

Parameters
[in]axisIndexAxis index.
[out]valueaxis command data word.
Command word = 10 (homing):
value 1..6: Different homing sequences.
Command word = 4 (absolute positioning):
value 1: Go to start position of trajectory generator external transformation expressions. This is useful to avoid jumps during start phase when absolute synchronizing.
Returns
0 if success or otherwise an error code.
Note
Example: Get command data word for axis 3.
"Main.M3.nCmdData?" //Command string to ecmcCmdParser.c.
Todo
"TwinCAT syntax. Needs to be changed.

◆ getAxisCntrlError()

int getAxisCntrlError ( int axisIndex,
double * value )

Get actual pid controller error.
.

Parameters
[in]axisIndexAxis index.
[out]valueactual error of pid controller.
Returns
0 if success or otherwise an error code.
Note
Example: Get pid controller error for axis 3.
"Main.M3.stAxisStatus?" //The command returns a complete structure of information including the state of the pid controller error * //Command string to ecmcCmdParser.c.
Todo
"TwinCAT syntax. Needs to be changed.

◆ getAxisCntrlOutDpart()

int getAxisCntrlOutDpart ( int axisIndex,
double * value )

Get PID-controller differential output part.
.

Parameters
[in]axisIndexAxis index.
[out]valuePID-controller differential output.
Returns
0 if success or otherwise an error code.
Note
No command string implemented in the ecmcCmdParser.c parser.

◆ getAxisCntrlOutFFpart()

int getAxisCntrlOutFFpart ( int axisIndex,
double * value )

Get PID-controller feed forward output part.
.

Parameters
[in]axisIndexAxis index.
[out]valuePID-controller feed forward output.
Returns
0 if success or otherwise an error code.
Note
No command string implemented in the ecmcCmdParser.c parser.

◆ getAxisCntrlOutIpart()

int getAxisCntrlOutIpart ( int axisIndex,
double * value )

Get PID-controller integral output part.
.

Parameters
[in]axisIndexAxis index.
[out]valuePID-controller integral output.
Returns
0 if success or otherwise an error code.
Note
No command string implemented in the ecmcCmdParser.c parser.

◆ getAxisCntrlOutPpart()

int getAxisCntrlOutPpart ( int axisIndex,
double * value )

Get PID-controller proportional output part.
.

Parameters
[in]axisIndexAxis index.
[out]valuePID-controller proportional output.
Returns
0 if success or otherwise an error code.
Note
No command string implemented in the ecmcCmdParser.c parser.

◆ getAxisCntrlOutput()

int getAxisCntrlOutput ( int axisIndex,
double * value )

Get PID-controllegetAxisAtHomer total output part.
.

The current total output from the PID-controller (the sum of the P,I,D and FF part).

Parameters
[in]axisIndexAxis index.
[out]valuePID-controller total output.
Returns
0 if success or otherwise an error code.
Note
No command string implemented in the ecmcCmdParser.c parser.

◆ getAxisCommand()

int getAxisCommand ( int axisIndex,
int * value )

Get axis command word.
.

The command word defines different modes of operation for and axis. See fbDriveVirtual manual for more information.

Parameters
[in]axisIndexAxis index.
[out]valueaxis command word.
value = 0: Jog.
value = 1: Constant Velocity.
value = 2: Relative Positioning.
value = 3: Absolute Positioning.
value = 10: Homing.
See manual for fbDriveVirtual for more information.
Returns
0 if success or otherwise an error code.
Note
Example: Get command word for axis 3.
"Main.M3.nCommand?" //Command string to ecmcCmdParser.c.
Todo
"TwinCAT syntax. Needs to be changed.

◆ getAxisCycleCounter()

int getAxisCycleCounter ( int axisIndex,
int * counter )

Get axis execution cycle counter.
Can be used for checking that logic for an axis object is executing.
.

Parameters
[in]axisIndexAxis index.
[out]counterExecution cycle counter.
Returns
error code.
Note
The counter can overflow.
Example: Get cycle counter of axis 3.
"GetAxisCycleCounter(3)" //Command string to ecmcCmdParser.c.

◆ getAxisDebugInfoData()

int getAxisDebugInfoData ( int axisIndex,
char * buffer,
int bufferByteSize )

Get axis debug information string.
.

Parameters
[in]axisIndexAxis index.
[in,out]bufferPointer to char output data buffer.
[in]bufferByteSizeSize of data buffer.
Returns
error code.
Note
Example: Get information of axis 3.
"GetAxisDebugInfoData(3)" //Command string to ecmcCmdParser.c.
Todo
"TwinCAT syntax. Needs to be changed.

◆ getAxisDeceleration()

int getAxisDeceleration ( int axisIndex,
double * value )

Get axis deceleration setpoint.
.

Parameters
[in]axisIndexAxis index.
[out]valuedeceleration setpoint.
Returns
0 if success or otherwise an error code.
Note
Example: Get deceleration setpoint for axis 3.
"Main.M3.fDeceleration?" //Command string to ecmcCmdParser.c.
Todo
"TwinCAT syntax. Needs to be changed.

◆ getAxisDone()

int getAxisDone ( int axisIndex,
int * value )

Get axis done bit.
.

The axis done bit is high when an axis is ready to take a new command (inverse of busy bit).

Parameters
[in]axisIndexAxis index.
[out]valuestate of axis done bit.
Returns
0 if success or otherwise an error code.
Note
Example: Get done state for axis 3.
"Main.M3.bDone?" //Command string to ecmcCmdParser.c.
Todo
"TwinCAT syntax. Needs to be changed.

◆ getAxisDrvEnable()

int getAxisDrvEnable ( int axisIndex,
int * value )

Get enable state of drive.
.

Parameters
[in]axisIndexAxis index.
[out]valueDrive enabled.
Returns
0 if success or otherwise an error code.
Note
No command string implemented in the ecmcCmdParser.c parser.

◆ getAxisDrvScale()

int getAxisDrvScale ( int axisIndex,
double * value )

Get the drive output scale factor.
.

Parameters
[in]axisIndexAxis index.
[out]valueDrive output scale factor.
Returns
0 if success or otherwise an error code.
Note
No command string implemented in the ecmcCmdParser.c parser.

◆ getAxisDrvScaleNum()

int getAxisDrvScaleNum ( int axisIndex,
double * value )

Get drive output scale numerator.
.

Parameters
[in]axisIndexAxis index.
[out]pointerto return value Scale numerator.
Returns
0 if success or otherwise an error code.

◆ getAxisEnable()

int getAxisEnable ( int axisIndex,
int * value )

Get axis amplifier command bit.
.

Parameters
[in]axisIndexAxis index.
[out]valuestate of axis amplifier command bit.
Returns
0 if success or otherwise an error code.
Note
Example: Get amplifier enable command bit for axis 3.
"Main.M3.bEnable?" //Command string to ecmcCmdParser.c.
Todo
"TwinCAT syntax. Needs to be changed.

◆ getAxisEnableAlarmAtHardLimits()

int getAxisEnableAlarmAtHardLimits ( int axisIndex,
int * value )

Get enable alarms at limits bit.
.

Parameters
[in]axisIndexAxis index.
[out]valuestate of enable alarm at limits bit.
Returns
0 if success or otherwise an error code.
Note
Example: Get state of enable alarm at limits bit for axis 3.
"GetAxisEnableAlarmAtHardLimits(3)" //Command string to ecmcCmdParser.c.

◆ getAxisEnabled()

int getAxisEnabled ( int axisIndex,
int * value )

Get axis amplifier state bit.
.

Parameters
[in]axisIndexAxis index.
[out]valuestate of axis amplifier.
Returns
0 if success or otherwise an error code.
Note
Example: Get amplifier actual state for axis 3.
"Main.M3.bEnabled?" //Command string to ecmcCmdParser.c.
Todo
"TwinCAT syntax. Needs to be changed.

◆ getAxisEnableSoftLimitBwd()

int getAxisEnableSoftLimitBwd ( int axisIndex,
int * value )

Get backward soft-limit enabled state of an axis.
.

Parameters
[in]axisIndexAxis index.
[out]valuesoft-limit enabled.
Returns
0 if success or otherwise an error code.
Note
Example: Get soft-limit backward enabled state for axis 3.
"ADSPORT=501/.ADR.16#5003,16#B,2,2?" //Command string to ecmcCmdParser.c.
Todo
"TwinCAT syntax. Needs to be changed.

◆ getAxisEnableSoftLimitFwd()

int getAxisEnableSoftLimitFwd ( int axisIndex,
int * value )

Get forward soft-limit enabled state of an axis.
.

Parameters
[in]axisIndexAxis index.
[out]valuesoft-limit enabled.
Returns
0 if success or otherwise an error code.
Note
Example: Get soft-limit forward enabled state for axis 3.
"ADSPORT=501/.ADR.16#5001,16#C,2,2?" //Command string to ecmcCmdParser.c.
Todo
"TwinCAT syntax. Needs to be changed.

◆ getAxisEncConfigIndex()

int getAxisEncConfigIndex ( int axisIndex,
int * index )

Get index of current encoder being configured.
.

Note
: The returned index starts at 1 (first encoder for axis has index 1).
Parameters
[in]axisIndexAxis index.
Returns
0 if success or otherwise an error code.
Note
Example: Get index of current encoder being configured for axis 3.
"Cfg.GetAxisEncConfigIndex(3)" //Command string to ecmcCmdParser.c.

◆ getAxisEncHomed()

int getAxisEncHomed ( int axisIndex,
int * value )

Get encoder homed bit.
.

Checks if encoder has been homed.

Parameters
[in]axisIndexAxis index.
[out]valuestate of encoder homed bit.
Returns
0 if success or otherwise an error code.
Note
Example: Check if encoder of axis 3 has been homed.
"Main.M3.bHomed?" //Command string to ecmcCmdParser.c.
Todo
"TwinCAT syntax. Needs to be changed.

◆ getAxisEncPosAct()

int getAxisEncPosAct ( int axisIndex,
double * value )

Get actual encoder position.
.

Parameters
[in]axisIndexAxis index.
[out]valueencoder actual position.
Returns
0 if success or otherwise an error code.
Note
Example: Get actual encoder position for axis 3.
"Main.M3.fActPosition?" //Command string to ecmcCmdParser.c.
Todo
"TwinCAT syntax. Needs to be changed.

◆ getAxisEncPosRaw()

int getAxisEncPosRaw ( int axisIndex,
int64_t * value )

Get raw unscaled encoder value.
.

Parameters
[in]axisIndexAxis index.
[out]valueRaw encoder value.
Returns
0 if success or otherwise an error code.
Note
Example: Get raw encoder value for axis 3.
"GetAxisEncPosRaw(3)" //Command string to ecmcCmdParser.c.

◆ getAxisEncPrimaryIndex()

int getAxisEncPrimaryIndex ( int axisIndex,
int * index )

Get index of current encoder being used for control (PID).
.

Note
: The returned index starts at 1 (first encoder for axis has index 1).
Parameters
[in]axisIndexAxis index.
Returns
0 if success or otherwise an error code.
Note
Example: Get index of current encoder being used for control for axis 3.
"Cfg.GetAxisEncPrimaryIndex(3)" //Command string to ecmcCmdParser.c.

◆ getAxisEncScaleDenom()

int getAxisEncScaleDenom ( int axisIndex,
double * value )

Get the denominator part of the encoder scale.
.

The encoder scale factor is divided into one numerator and one denominator part. This function reads the denominator part.

Parameters
[in]axisIndexAxis index.
[out]valueEncoder scale denominator part.
Returns
0 if success or otherwise an error code.
Note
Example: Get encoder scale denominator for axes 8.
"ADSPORT=501/.ADR.16#5008,16#24,8,5?" //Command string to ecmcCmdParser.c.
Todo
"TwinCAT syntax. Needs to be changed.

◆ getAxisEncScaleNum()

int getAxisEncScaleNum ( int axisIndex,
double * value )

Get the numerator part of the encoder scale.
.

The encoder scale factor is divided into one numerator and one denominator part. This function reads the numerator part.

Parameters
[in]axisIndexAxis index.
[out]valueEncoder scale numerator part.
Returns
0 if success or otherwise an error code.
Note
Example: Get encoder scale numerator for axes 3.
"ADSPORT=501/.ADR.16#5003,16#23,8,5?" //Command string to ecmcCmdParser.c.
Todo
"TwinCAT syntax. Needs to be changed.

◆ getAxisEncSource()

int getAxisEncSource ( int axisIndex,
int * value )

Get axis encoder data source.
.

An axis encoder can get actual position from different sources:
source = 0 : Internal (EtherCAT entry).
source = 1 : External from transformation expression (synchronization).

Parameters
[in]axisIndexAxis index.
[out]valueSource type.
Returns
0 if success or otherwise an error code.
Note
Example: Get encoder generator data source type for axis 3.
"GetAxisEncSourceType(3)" //Command string to ecmcCmdParser.c.

◆ getAxisEncTransExpr()

const char * getAxisEncTransExpr ( int axisIndex,
int * error )

Get axis encoder transformation expression.
.

The axis transformation expression is used for synchronization of axes. The expression is a mathematical expression describing relation ship between different axes.
Example: "out:=sin(traj1+enc5)/500;".
traj1 = trajectory setpoint of axis 1.
enc5 = actual encoder position of axis 5.
out = the encoder setpoint for the current axis (axes[axisIndex]).

Parameters
[in]axisIndexAxis index.
[out]errorError code.
error = 0: No error.
error > 0: Error.
Returns
pointer to transformation expression.
Note
Example: Get encoder transformation expression for axes 5.
"GetAxisEncTransExpr(5)" //Command string to ecmcCmdParser.c.

◆ getAxisEncVelAct()

int getAxisEncVelAct ( int axisIndex,
double * value )

Get actual encoder velocity.
.

Parameters
[in]axisIndexAxis index.
[out]valueencoder actual velocity.
Returns
0 if success or otherwise an error code.
Note
Example: Get actual encoder velocity for axis 3.
"Main.M3.fActVelocity?" //Command string to ecmcCmdParser.c.
Todo
"TwinCAT syntax. Needs to be changed.

◆ getAxisEncVelo()

int getAxisEncVelo ( int axisIndex,
double * velo )

Get axis act velo.
.

The axis busy bit is high while an command is executed or while synchronizing to other axes.

Parameters
[in]axisIndexAxis index.
[out]veloAxis velocity.
Returns
0 if success or otherwise an error code.

◆ getAxisError()

int getAxisError ( int axisIndex)

Get axis error state.
.

Parameters
[in]axisIndexAxis index.
Returns
axis error state.
Note
Example: Get error code of axis 3.
"Main.M3.bError?" //Command string to ecmcCmdParser.c.
Todo
"TwinCAT syntax. Needs to be changed.

◆ getAxisErrorID()

int getAxisErrorID ( int axisIndex)

Get axis error code.
.

Parameters
[in]axisIndexAxis index.
Returns
axis error code.
Note
Example: Get error code of axis 3.
"Main.M3.nErrorId?" //Command string to ecmcCmdParser.c.
Todo
"TwinCAT syntax. Needs to be changed.

◆ getAxisExecute()

int getAxisExecute ( int axisIndex,
int * value )

Get axis execute bit.
.

Parameters
[in]axisIndexAxis index.
[out]valuestate of axis execute bit.
Returns
0 if success or otherwise an error code.
Note
Example: Get execute bit for axis 3.
"Main.M3.bExecute?" //Command string to ecmcCmdParser.c.
Todo
"TwinCAT syntax. Needs to be changed.

◆ getAxisHomeVelOffCam()

int getAxisHomeVelOffCam ( int axisIndex,
double * value )

Get off cam referencing/homing velocity setpoint.
.

This velocity setpoint is only used during homing sequence when the reference switch already have been found. See command "getAxisHomeVelTowardsCam()" for more information.

Parameters
[in]axisIndexAxis index.
[out]valueVelocity setpoint.
Returns
0 if success or otherwise an error code.
Note
Example: Get off cam referencing/homing velocity setpoint for axes 3.
"ADSPORT=501/.ADR.16#4003,16#7,8,5?" //Command string to ecmcCmdParser.c.
Todo
"TwinCAT syntax. Needs to be changed.

◆ getAxisHomeVelTowardsCam()

int getAxisHomeVelTowardsCam ( int axisIndex,
double * value )

Get Towards cam referencing/homing velocity setpoint.
.

This velocity setpoint is only used during homing sequence when finding the reference switch. See command "getAxisHomeVelTowardsCam()" for more information.

Parameters
[in]axisIndexAxis index.
[out]valueVelocity setpoint.
Returns
0 if success or otherwise an error code.
Note
Example: Get Towards cam referencing/homing velocity setpoint for axes 3.
"ADSPORT=501/.ADR.16#4003,16#6,8,5?" //Command string to ecmcCmdParser.c.
Todo
"TwinCAT syntax. Needs to be changed.

◆ getAxisID()

int getAxisID ( int axisIndex,
int * value )

Get axis index.
.

This function is only implemented for compatibility reasons with the ESS MCAG TwinCAT implementation. (An TwinCAT plc axis can be linked to different NC-axis).

If the axis at axisIndex exists, axisIndex will be "returned" in the value parameter.

Parameters
[in]axisIndexAxis index.
[out]valueaxis index of chosen axis.
Returns
0 if success or otherwise an error code.
Note
Example: Get busy state for axis 3.
"Main.M3.nMotionAxisID?" //Command string to ecmcCmdParser.c.
Todo
"TwinCAT syntax. Needs to be changed.

◆ getAxisLimitSwitchBwd()

int getAxisLimitSwitchBwd ( int axisIndex,
int * value )

Same as getAxisAtHardBwd() but better name.
.

getAxisAtHardBwd() is kept for backward compatibility

◆ getAxisLimitSwitchFwd()

int getAxisLimitSwitchFwd ( int axisIndex,
int * value )

Same as getAxisAtHardFwd() but better name.
.

getAxisAtHardFwd() is kept for backward compatibility

◆ getAxisModRange()

int getAxisModRange ( int axisIndex,
double * range )

Get axis modulo range.
.

Parameters
[in]axisIndexAxis index.
[out]valuemodulo range.
Returns
0 if success or otherwise an error code.
Note
Example: Get modulo range for axis 3.
"GetAxisModRange(3)" //Command string to ecmcCmdParser.c.

◆ getAxisModType()

int getAxisModType ( int axisIndex,
int * value )

Set axis modulo motion type.
.

Parameters
[in]axisIndexAxis index.
[out]typeModulo type.
type = 0 : ECMC_MOD_MOTION_NORMAL
1: ECMC_MOD_MOTION_FWD (Always forward)
2: ECMC_MOD_MOTION_BWD (always backward)
3: ECMC_MOD_MOTION_CLOSEST (closest path)
Returns
0 if success or otherwise an error code.
Note
Example: Get modulo type for axis 3.
"GetAxisModType(3)" //Command string to ecmcCmdParser.c.

◆ getAxisMonAtTarget()

int getAxisMonAtTarget ( int axisIndex,
int * value )

Get at target.
.

Checks if axis is within a certain tolerance from target position.

Parameters
[in]axisIndexAxis index.
[out]valueAt target.
Returns
0 if success or otherwise an error code.
Note
No command string implemented in the ecmcCmdParser.c parser.

◆ getAxisMonAtTargetTime()

int getAxisMonAtTargetTime ( int axisIndex,
int * value )

Get "at target" monitoring time (cycles).
.

Parameters
[in]axisIndexAxis index.
[out]pointerto return value At target time (cycles) .
Returns
0 if success or otherwise an error code.

◆ getAxisMonAtTargetTol()

int getAxisMonAtTargetTol ( int axisIndex,
double * value )

Set drive type.
OBSOLETE COMMAND. USE CREATEAXIS(id,type,drvtype).

Note
ALL SETTINGS MADE TO THE DRIVE WILL BE OVERWRITTEN.
Parameters
[in]axisIndexAxis index.
[in]typeDrive type.
0 = Stepper drive.
1 = DS402 drive.
Returns
0 if success or otherwise an error code.
Note
Example: Set axis 3 drive type to stepper.
"Cfg.SetAxisDrvType(3,0)" //Command string to ecmcCmdParser.c.
Get "at target" monitoring tolerance.
Parameters
[in]axisIndexAxis index.
[out]pointerto return value At target tolerance.
Returns
0 if success or otherwise an error code.

◆ getAxisMonEnableAtTargetMon()

int getAxisMonEnableAtTargetMon ( int axisIndex,
int * value )

Get enable "at target" monitoring.
.

Parameters
[in]axisIndexAxis index.
[out]pointerto return value Enable monitoring .
Returns
0 if success or otherwise an error code.

◆ getAxisMonEnableLagMon()

int getAxisMonEnableLagMon ( int axisIndex,
int * value )

Get position lag monitoring enable.
.

The position lag monitoring functionality monitors the difference between the actual position and trajectory generated setpoint position. The motion can be interlocked if the difference exceeds a certain tolerance for a certain number of cycles, see command setAxisMonPosLagTime() and setAxisMonPosLagTol() for more information.
A big position lag error during a motion could be generated by bad tuning or mechanical issues.

Parameters
[in]axisIndexAxis index.
[in]valueEnable monitoring.
.
Returns
0 if success or otherwise an error code.

◆ getAxisMonEnableMaxVel()

int getAxisMonEnableMaxVel ( int axisIndex,
int * value )

Get enable maximum velocity monitoring (over speed).
.

Parameters
[in]axisIndexAxis index.
[out]valueEnable monitoring.
Returns
0 if success or otherwise an error code.

◆ getAxisMonExtHWInterlockPolarity()

int getAxisMonExtHWInterlockPolarity ( int axisIndex,
int * pol )

Get polarity of motion axis interlock from EtherCAT entry.
.

The motion can be interlocked based on an EtherCAT entry. See command linkEcEntryToAxisMon() for more information.

Parameters
[in]axisIndexAxis index.
[out]valuePolarity external interlock.
0 = NC (High is OK) Default.
1 = NO (Low is OK).
Note
WARNING: If an error is detected, the enable (power) will be removed from the axis. Please always ensure that the power less state is the safe state.
Returns
0 if success or otherwise an error code.
Note
Example: Get external interlock polarity for axis 7.
"GetAxisMonExtHWInterlockPolarity(7)" //Command string to ecmcCmdParser.c.

◆ getAxisMonHomeSwitchPolarity()

int getAxisMonHomeSwitchPolarity ( int axisIndex,
int * pol )

Get polarity of home switch.
.

Parameters
[in]axisIndexAxis index.
[out]polPolarity.
0 = NC (High is 1) Default.
1 = NO (Low is 1).
Returns
0 if success or otherwise an error code.
Note
Example: Get home switch polarity for axis 7.
"GetAxisMonHomeSwitchPolarity(7)" //Command string to ecmcCmdParser.c.

◆ getAxisMonLatchLimit()

int getAxisMonLatchLimit ( int axisIndex,
int * value )

Get latch on limit settings.
.

Parameters
[in]axisIndexAxis index.
[out]valuepointer to latch on limit setting value .
Returns
0 if success or otherwise an error code.

◆ getAxisMonLimitBwdPolarity()

int getAxisMonLimitBwdPolarity ( int axisIndex,
int * pol )

Get polarity of hard low limit switch.
.

Parameters
[in]axisIndexAxis index.
[out]polPolarity.
0 = NC (High is OK) Default.
1 = NO (Low is OK).
Returns
0 if success or otherwise an error code.
Note
Example: Get low limit polarity for axis 7.
"GetAxisMonLimitBwdPolarity(7)" //Command string to ecmcCmdParser.c.

◆ getAxisMonLimitFwdPolarity()

int getAxisMonLimitFwdPolarity ( int axisIndex,
int * pol )

Get polarity of hard high limit switch.
.

Parameters
[in]axisIndexAxis index.
[out]polPolarity.
0 = NC (High is OK) Default.
1 = NO (Low is OK).
Returns
0 if success or otherwise an error code.
Note
Example: Get high limit polarity for axis 7.
"GetAxisMonLimitFwdPolarity(7)" //Command string to ecmcCmdParser.c.

◆ getAxisMonMaxVel()

int getAxisMonMaxVel ( int axisIndex,
double * value )

Get maximum allowed velocity.
.

The motion will be interlocked if the actual velocity or the velocity setpoint exceeds this value.

Parameters
[in]axisIndexAxis index.
[out]valueMaximum velocity.
Returns
0 if success or otherwise an error code.

◆ getAxisMonPosLagTime()

int getAxisMonPosLagTime ( int axisIndex,
int * value )

Get position lag monitoring time (cycles).
.

Parameters
[in]axisIndexAxis index.
[out]pointerto return value Position lag time (cycles).
Returns
0 if success or otherwise an error code.

◆ getAxisMonPosLagTol()

int getAxisMonPosLagTol ( int axisIndex,
double * value )

Get position lag maximum monitoring tolerance.
.

Parameters
[in]axisIndexAxis index.
[out]pointerto return value Position lag maximum tolerance.
Returns
0 if success or otherwise an error code.

◆ getAxisPLCEnable()

int getAxisPLCEnable ( int axisIndex,
int * value )

Get axis enable for axis sync. PLC.
.

The axis sync. PLC expression can be enabled/disabled. see command getAxisPLCExpr() for more information.

Parameters
[in]axisIndexAxis index.
[out]valueenable.
Returns
0 if success or otherwise an error code.
Note
Example: Get axis enable command transform for axis 5.
"getAxisPLCEnable(5)" //Command string to ecmcCmdParser.c.

◆ getAxisPLCExpr()

const char * getAxisPLCExpr ( int axisIndex,
int * error )

Get axis sync. PLC expression.
.

The axis sync PLC expression is used for enabling and executing of
axes based on mathematical expressions. This is useful when synchronizing
axes i.e. a slave axis could recive an custom trajatory, other enabled based\ on other axes or ethercat data in the form of mathematical expressions.

Parameters
[in]axisIndexAxis index.
[out]errorError code.
error = 0: No error.
error > 0: Error.
Returns
pointer to transformation expression.
Note
Example: Get axis sync. PLC expression for axes 5.
"getAxisPLCExpr(5)" //Command string to ecmcCmdParser.c.

◆ getAxisReset()

int getAxisReset ( int axisIndex,
int * value )

Get axis reset bit.
.

Parameters
[in]axisIndexAxis index.
[out]valuestate of axis reset bit.
Returns
0 if success or otherwise an error code.
Note
Example: Get reset bit for axis 3.
"Main.M3.bReset?" //Command string to ecmcCmdParser.c.
Todo
"TwinCAT syntax. Needs to be changed.

◆ getAxisSoftLimitPosBwd()

int getAxisSoftLimitPosBwd ( int axisIndex,
double * value )

Get backward soft-limit position.
.

Parameters
[in]axisIndexAxis index.
[out]valuesoft-limit position.
Returns
0 if success or otherwise an error code.
Note
Example: Get soft-limit backward position for axis 3.
"ADSPORT=501/.ADR.16#5003,16#D,8,5?" //Command string to ecmcCmdParser.c.
Todo
"TwinCAT syntax. Needs to be changed.

◆ getAxisSoftLimitPosFwd()

int getAxisSoftLimitPosFwd ( int axisIndex,
double * value )

Get forward soft-limit position.
.

Parameters
[in]axisIndexAxis index.
[out]valueSoft-limit position.
Returns
0 if success or otherwise an error code.
Note
Example: Get soft-limit forward position for axis 3.
"ADSPORT=501/.ADR.16#5003,16#E,8,5?" //Command string to ecmcCmdParser.c.
Todo
"TwinCAT syntax. Needs to be changed.

◆ getAxisStatusStructV2()

int getAxisStatusStructV2 ( int axisIndex,
char * buffer,
int bufferByteSize )

Get axis status structure V2.
.

Parameters
[in]axisIndexAxis index.
[in,out]bufferPointer to char output data buffer.
[in]bufferByteSizeSize of data buffer.
Returns
error code.
Note
Example: Get information of axis 3.
"Main.M3.stAxisStatusV2?" //Command string to ecmcCmdParser.c.
Todo
"TwinCAT syntax. Needs to be changed.

◆ getAxisTargetPos()

int getAxisTargetPos ( int axisIndex,
double * value )

Get axis target position setpoint.
.

The target position is the desired end setpoint of a motion.

Parameters
[in]axisIndexAxis index.
[out]valuetarget position setpoint.
Returns
0 if success or otherwise an error code.
Note
Example: Get target position setpoint for axis 3.
"Main.M3.fPosition?" //Command string to ecmcCmdParser.c.
Todo
"TwinCAT syntax. Needs to be changed.

◆ getAxisTargetVel()

int getAxisTargetVel ( int axisIndex,
double * value )

Get axis target velocity setpoint.
.

The target velocity is the desired velocity of a motion.
Note: The actual velocity can be higher than this setpoint.

Parameters
[in]axisIndexAxis index.
[out]valuetarget velocity setpoint.
Returns
0 if success or otherwise an error code.
Note
Example: Get target velocity setpoint for axis 3.
"Main.M3.fVelocity?" //Command string to ecmcCmdParser.c.
Todo
"TwinCAT syntax. Needs to be changed.

◆ getAxisTrajSource()

int getAxisTrajSource ( int axisIndex,
int * value )

Get axis trajectory data source.
.

An axis trajectory generator can get position setpoints from different sources:
source = 0 : Internal (normal trajectory generation).
source = 1 : External from transformation expression (synchronization).

Parameters
[in]axisIndexAxis index.
[out]valueSource type.
Returns
0 if success or otherwise an error code.
Note
Example: Get trajectory generator data source type for axis 3.
"GetAxisTrajSourceType(3)" //Command string to ecmcCmdParser.c.

◆ getAxisTrajTransExpr()

const char * getAxisTrajTransExpr ( int axisIndex,
int * error )

Get axis trajectory transformation expression.
.

The axis transformation expression is used for synchronization of axes. The expression is a mathematical expression describing relation ship between different axes.
Example: "out:=sin(traj1+enc5)/500;".
traj1 = trajectory setpoint of axis 1.
enc5 = actual encoder position of axis 5.
out = the trajectory setpoint for the current axis (axes[axisIndex]).

Parameters
[in]axisIndexAxis index.
[out]errorError code.
error = 0: No error.
error > 0: Error.
Returns
pointer to transformation expression.
Note
Example: Get trajectory transformation expression for axes 5.
"GetAxisTrajTransExpr(5)" //Command string to ecmcCmdParser.c.

◆ getAxisTrajVelo()

int getAxisTrajVelo ( int axisIndex,
double * velo )

Get axis traj velo.
.

The axis busy bit is high while an command is executed or while synchronizing to other axes.

Parameters
[in]axisIndexAxis index.
[out]veloAxis velocity.
Returns
0 if success or otherwise an error code.

◆ getAxisType()

int getAxisType ( int axisIndex,
int * value )

Get axis type.
.

An axis can be of the following types: type = 1 : Normal axis (drive, encoder, monitor,pid-controller,trajectory).
type = 2 : Virtual axis (encoder, monitor, trajectory).

Parameters
[in]axisIndexAxis index.
[out]valueAxis type.
Returns
0 if success or otherwise an error code.
Note
Example: Get encoder scale denominator for axes 8.
"GetAxisType(8)" //Command string to ecmcCmdParser.c.

◆ getAxisValid()

int getAxisValid ( int axisIndex)

Returns 1 if axis index is in use.

Parameters
[in]axisIndexAxis index.

◆ linkEcEntryToAxisDrv()

int linkEcEntryToAxisDrv ( int slaveBusPosition,
char * entryIdString,
int axisIndex,
int driveEntryIndex,
int entryBitIndex )

Links an EtherCAT entry to the drive object of the axis at axisIndex.

Parameters
[in]slaveBusPositionPosition of the EtherCAT slave on the bus.
slaveBusPosition = -1: Used to address the simulation slave. Only two entries are configured, "ZERO" with default value 0 and "ONE" with default value 1.
slaveBusPosition = 0..65535: Addressing of normal EtherCAT slaves
[in]entryIdStringString for addressing purpose (see command "Cfg.EcAddEntryComplete() for more information"). If left blank driveEntryIndex == 3 or4, the corresponding functionality will be disabled.
[in]axisIndexIndex of axis to link to.
[in]driveEntryIndexIndex of drive objects entry list.
driveEntryIndex = 0: Amplifier enable (output).
driveEntryIndex = 1: Velocity setpoint (output).
driveEntryIndex = 2: Amplifier enabled (input).
driveEntryIndex = 3: Brake (output).
Brake func will be enabled.
driveEntryIndex = 4: Reduce torque (output). Reduce torque func will be enabled.
[in]entryBitIndexBit index of EtherCAT entry to use.
entryBitIndex = -1: All bits of the entry will be used.
entryBitIndex = 0..64: Only the selected bit will be used.
Returns
0 if success or otherwise an error code.
Note
Example 1: Link an EtherCAT entry configured as "VELOCITY_SET" in slave 3 as velocity setpoint entry for the drive object of axis 5.
"Cfg.LinkEcEntryToAxisDrive(3,VELOCITY_SET,5,1,-1)" //Command string to ecmcCmdParser.c
Example 2: Link bit 0 of an EtherCAT entry configured as "STM_CONTROL" in slave 3 as enable amplifier output entry for the drive object of axis 5.
"Cfg.LinkEcEntryToAxisDrive(3,STM_CONTROL,5,0,0)" //Command string to ecmcCmdParser.c
Example 3: If a drive have no feedback for enable, a simulation slave and entry can be used. The simulation EtherCAT slave can be addressed with a slaveBusIndex of -1. The simulation slave contains two entries, "ZERO" with default value zero and "ONE" with default value set to 1.
"Cfg.LinkEcEntryToAxisDrive(-1,ONE,5,0,0)" //Command string to ecmcCmdParser.c

◆ linkEcEntryToAxisEnc()

int linkEcEntryToAxisEnc ( int slaveBusPosition,
char * entryIdString,
int axisIndex,
int encoderEntryIndex,
int entryBitIndex )

Links an EtherCAT entry to the encoder object of the axis at axisIndex.

Parameters
[in]slaveBusPositionPosition of the EtherCAT slave on the bus.
slaveBusPosition = -1: Used to address the simulation slave. Only two entries are configured, "ZERO" with default value 0 and "ONE" with default value 1.
slaveBusPosition = 0..65535: Addressing of normal EtherCAT slaves
[in]entryIdStringString for addressing purpose (see command "Cfg.EcAddEntryComplete() for more information").
[in]axisIndexIndex of axis to link to.
[in]encoderEntryIndexIndex of encoder objects entry list.
encoderEntryIndex = 0: Actual position (input).
[in]entryBitIndexBit index of EtherCAT entry to use.
entryBitIndex = -1: All bits of the entry will be used.
entryBitIndex = 0..64: Only the selected bit will be used.
Returns
0 if success or otherwise an error code.
Note
Example: Link an EtherCAT entry configured as "POSITION_ACT" in slave 1 as actual position for the encoder of axis 5.
"Cfg.LinkEcEntryToAxisEncoder(1,POSITION_ACT,5,0,-1)" //Command string to ecmcCmdParser.c

◆ linkEcEntryToAxisMon()

int linkEcEntryToAxisMon ( int slaveBusPosition,
char * entryIdString,
int axisIndex,
int monitorEntryIndex,
int entryBitIndex )

Links an EtherCAT entry to the monitor object of the axis at axisIndex
.

Parameters
[in]slaveBusPositionPosition of the EtherCAT slave on the bus.
slaveBusPosition = -1: Used to address the simulation slave. Only two entries are configured, "ZERO" with default value 0 and "ONE" with default value 1.
slaveBusPosition = 0..65535: Addressing of normal EtherCAT slaves.
[in]entryIdStringString for addressing purpose (see command "Cfg.EcAddEntryComplete() for more information").
[in]axisIndexIndex of axis to link to.
[in]monitorEntryIndexIndex of monitor objects entry list.
monitorEntryIndex = 0: Limit switch backward direction.
monitorEntryIndex = 1: Limit switch forward direction.
monitorEntryIndex = 2: Reference switch (homing).
monitorEntryIndex = 3: External interlock input (optional).
monitorEntryIndex = 4: External analog interlock input (optional).
[in]entryBitIndexBit index of EtherCAT entry to use.
entryBitIndex = -1: All bits of the entry will be used.
entryBitIndex = 0..64: Only the selected bit will be used.
Returns
0 if success or otherwise an error code.
Note
Example 1: Link an EtherCAT entry configured as "INPUT_0" in slave 1 as forward limit switch entry for the monitor object of axis 5.
"Cfg.LinkEcEntryToAxisMonitor(1,"INPUT_0",5,1,0)" //Command string to ecmcCmdParser.c
Example 2: If an axis is not equipped with limit switches the entries for limit switches needs to be linked to the simulation entries. The simulation slave contains two entries, "ZERO" with default value zero and "ONE" with default value set to 1.
"Cfg.LinkEcEntryToAxisMonitor(-1,ONE,5,1,0)" //Command string to ecmcCmdParser.c

◆ linkEcEntryToAxisSeqAutoModeAct()

int linkEcEntryToAxisSeqAutoModeAct ( int slaveIndex,
char * entryIDString,
int axisIndex )

Links an EtherCAT entry to the an axis object for
reading actual drive mode
.

Parameters
[in]slaveIndexPosition of the EtherCAT slave on the bus.
slaveIndex = -1: Used to address the simulation slave. Only two entries are configured, "ZERO" with default value 0 and "ONE" with default value 1.
slaveIndex = 0..65535: Addressing of normal EtherCAT slaves.
[in]entryIdStringString for addressing purpose (see command "Cfg.EcAddEntryComplete() for more information").
[in]axisIndexIndex of axis.
Returns
0 if success or otherwise an error code.

◆ linkEcEntryToAxisSeqAutoModeSet()

int linkEcEntryToAxisSeqAutoModeSet ( int slaveIndex,
char * entryIDString,
int axisIndex )

Links an EtherCAT entry to the an axis object for
setting drive mode
.

Parameters
[in]slaveIndexPosition of the EtherCAT slave on the bus.
slaveIndex = -1: Used to address the simulation slave. Only two entries are configured, "ZERO" with default value 0 and "ONE" with default value 1.
slaveIndex = 0..65535: Addressing of normal EtherCAT slaves.
[in]entryIdStringString for addressing purpose (see command "Cfg.EcAddEntryComplete() for more information").
[in]axisIndexIndex of axis.
Returns
0 if success or otherwise an error code.

◆ linkEcEntryToAxisStatusOutput()

int linkEcEntryToAxisStatusOutput ( int slaveIndex,
char * entryIDString,
int axisIndex )

Links an EtherCAT entry to the an axis object for status output
.

The output will be high when the axis object is without error code and otherwise zero.

Parameters
[in]slaveIndexPosition of the EtherCAT slave on the bus.
slaveIndex = -1: Used to address the simulation slave. Only two entries are configured, "ZERO" with default value 0 and "ONE" with default value 1.
slaveIndex = 0..65535: Addressing of normal EtherCAT slaves.
[in]entryIdStringString for addressing purpose (see command "Cfg.EcAddEntryComplete() for more information").
[in]axisIndexIndex of axis.
Returns
0 if success or otherwise an error code.
Note
Example 1: Link an EtherCAT entry configured as "OUTPUT_0" in slave 1 as status output for axis with index 2.
"Cfg.LinkEcEntryToAxisStatusOutput(1,"OUTPUT_0",2)" //Command string to ecmcCmdParser.c

◆ moveAbsolutePosition()

int moveAbsolutePosition ( int axisIndex,
double positionSet,
double velocitySet,
double accelerationSet,
double decelerationSet )

Move axis to an absolute position.
.

Parameters
[in]axisIndexAxis index.
[in]positionSetPosition setpoint.
[in]velocitySetVelocity setpoint.
[in]accelerationSetAcceleration setpoint.
[in]decelerationSetDeceleration setpoint.
Returns
0 if success or otherwise an error code.
Note
Example: Move axis 5 to position 1234 with a velocity of 10, acceleration of 100, and deceleration of 200.
"MoveAbsolutePosition(5,1234,10,100,200)" //Command string to ecmcCmdParser.c

◆ moveHome()

int moveHome ( int axisIndex,
int nCmdData,
double homePositionSet,
double velocityTowardsCamSet,
double velocityOffCamSet,
double accelerationSet,
double decelerationSet )

Execute homing sequence.
.

Parameters
[in]axisIndexAxis index.
[in]nCmdDataHoming sequence number.
[in]homePositionSetPosition to set at homing.
[in]velocityTowardsCamSetVelocity setpoint Towards cam.
[in]velocityOffCamSetVelocity setpoint off cam.
[in]accelerationSetAcceleration setpoint.
[in]decelerationSetDeceleration setpoint.
Returns
0 if success or otherwise an error code.

◆ moveRelativePosition()

int moveRelativePosition ( int axisIndex,
double positionSet,
double velocitySet,
double accelerationSet,
double decelerationSet )

Move axis to a relative position.
.

Parameters
[in]axisIndexAxis index.
[in]positionSetRelative position setpoint.
[in]velocitySetVelocity setpoint.
[in]accelerationSetAcceleration setpoint.
[in]decelerationSetDeceleration setpoint.
Returns
0 if success or otherwise an error code.
Note
Example: Move axis 5 to 123 relative to current position with a velocity of 10, acceleration of 100, and deceleration of 200.
"MoveRelativePosition(5,1234,10,100,200)" //Command string to ecmcCmdParser.c

◆ moveVelocity()

int moveVelocity ( int axisIndex,
double velocitySet,
double accelerationSet,
double decelerationSet )

Move axis in a constant velocity.
.

Parameters
[in]axisIndexAxis index.
[in]velocitySetVelocity setpoint.
[in]accelerationSetAcceleration setpoint.
[in]decelerationSetDeceleration setpoint.
Returns
0 if success or otherwise an error code.
Note
Example: Move axis 5 at a constant velocity of 10, acceleration of 100, and deceleration of 200.
"MoveVelocity(5,10,100,200)" //Command string to ecmcCmdParser.c

◆ selectAxisEncConfig()

int selectAxisEncConfig ( int axisIndex,
int index )

Select encoder to configured.
.

Select an encoder to be configured (default encoder index 1 is used).

Parameters
[in]axisIndexAxis index.
[in]encindexEncoder index (first index is 0).
Returns
0 if success or otherwise an error code.
Note
: The encoder index starts at 1 (first encoder for axis has index 1).
Example: Select encoder 2 of axis 3 for configiuration.
"Cfg.SelectAxisEncConfig(3,2)" //Command string to ecmcCmdParser.c.

◆ selectAxisEncPrimary()

int selectAxisEncPrimary ( int axisIndex,
int index )

Select encoder to be used for control.
.

Select an encoder to use for closed loop control (default encoder index 1 is used).

Note
IMPROTANT: The homing encoder will also be set to the selected encoder,
see selectAxisEncHome().
Parameters
[in]axisIndexAxis index.
[in]encindexEncoder index (first index is 0).
Returns
0 if success or otherwise an error code.
Note
: The encoder index starts at 1 (first encoder for axis has index 1).
Example: Select to use the third encoder object for closed loop control of axis 3.
"Cfg.SelectAxisEncPrimary(3,2)" //Command string to ecmcCmdParser.c.

◆ setAxisAcceleration()

int setAxisAcceleration ( int axisIndex,
double value )

Set axis acceleration setpoint.
.

Parameters
[in]axisIndexAxis index.
[in]valueAcceleration setpoint.
Returns
0 if success or otherwise an error code.
Note
Example: Set acceleration setpoint for axis 3 to 500.
"Main.M3.fAcceleration=500" //Command string to ecmcCmdParser.c.
Example: Set deceleration setpoint for axis 3 to 500.
"Cfg.SetAxisAcc(3,500)" //Command string to ecmcCmdParser.c.

◆ setAxisAllowCommandsFromPLC()

int setAxisAllowCommandsFromPLC ( int axisIndex,
int value )

Allow commands from PLCs.
.

An axis can receive commands from PLCs (see PLC syntax). However, the axis must be allow to receive these commands, see command setAxisPLCExpr() for more information.

Parameters
[in]axisIndexAxis index.
[in]valueEnable.
Returns
0 if success or otherwise an error code.
Note
Example: Enable command from PLC for axis 3.
"Cfg.setAxisAllowCommandsFromPLC(3,1)" //Command string to ecmcCmdParser.c.

◆ setAxisAllowSourceChangeWhenEnabled()

int setAxisAllowSourceChangeWhenEnabled ( int axisIndex,
int allow )

Allow change of encoder and trajectory source when axis is enabled.

Parameters
[in]axisIndexAxis index.
[in]allowallow source change (default false).
Returns
0 if success or otherwise an error code.
Note
Example: Allow change of traj and enc source when enabled for axis 3.
"Cfg.SetAxisAllowSourceChangeWhenEnabled(3,1)" //Command string to ecmcCmdParser.c.

◆ setAxisAutoModeCmdHoming()

int setAxisAutoModeCmdHoming ( int axisIndex,
int cmd )

Set axis auto mode command for homing.
.

Only relveant if an ethercat entry have been linked with "linkEcEntryToAxisSeqAutoModeSet()"

Parameters
[in]axisIndexAxis index.
[in]cmdcommand mode value for drive homing.
Returns
0 if success or otherwise an error code.
Note
Example: Set drive mode to 8 for when homing. "Cfg.setAxisAutoModeCmdHoming(3,8)" //Command string to ecmcCmdParser.c.

◆ setAxisAutoModeCmdMotion()

int setAxisAutoModeCmdMotion ( int axisIndex,
int cmd )

Set axis auto mode command for motion.
.

Only relveant if an ethercat entry have been linked with "linkEcEntryToAxisSeqAutoModeSet()"

Parameters
[in]axisIndexAxis index.
[in]cmdcommand mode value for drive homing.
Returns
0 if success or otherwise an error code.
Note
Example: Set drive mode to 18 for when homing. "Cfg.setAxisAutoModeCmdMotion(3,18)" //Command string to ecmcCmdParser.c.

◆ setAxisBlockCom()

int setAxisBlockCom ( int axisIndex,
int block )

Block/unblock communicatiom from via cmd parser.
.

Parameters
[in]axisIndexAxis index.
[in]blockblock or unblock com.
Returns
0 if success or otherwise an error code.
Note
Example: Block Com for axis 3.
"Cfg.SetAxisBlockCom(3,1)" //Command string to ecmcCmdParser.c.

◆ setAxisCmdData()

int setAxisCmdData ( int axisIndex,
int value )

Set axis command data word.
.

The command data word is an argument linked to the axis command. See fbDriveVirtual manual for more information.
A new command will be triggered with a positive edge on the bExecute flag.

Parameters
[in]axisIndexAxis index.
[in]valueAxis command data word.
The command data word have different meaning depending on the command word.
Command word = 1 (Move velocity):
Command data 0: Move Velocity
Command word = 2 (Relative positioning):
Command data 0: Move relative
Command word = 3 (absolute positioning):
Command data 0: Default absolute positioning
Command Data 1: Go to start position of trajectory generator external transformation expressions. This is useful to avoid jumps during start phase when absolute synchronizing.
Command word = 10 (Referencing to fHomePosition):
Command Data 0: Simplest homing sequence. The actual position of the encoder will be set to fHomePosition. Command Data 1: Ref. on low limit switch.
Command Data 2: Ref. on high limit switch.
Command Data 3: Ref. on home sensor via low limit switch.
Command Data 4: Ref. on home sensor via high limit switch.
Command Data 5: Ref. on center of home sensor via low limit switch.
Command Data 6: Ref. on center of home sensor via high limit switch.
Returns
0 if success or otherwise an error code.
Note
Example: Prepare homing sequence 3 at next positive edge of execute for axis 3 (two command needed).
"Main.M3.nCommand=10" //Set homing. Command string to ecmcCmdParser.c.
"Main.M3.nCmdData=3" //Set homing sequence. Command string to ecmcCmdParser.c.
Todo
"TwinCAT syntax. Needs to be changed.

◆ setAxisCntrlDeadband()

int setAxisCntrlDeadband ( int axisIndex,
double value )

Set PID-controller deadband.
.

Parameters
[in]axisIndexAxis index.
[in]valuedeadband tolerance.
Returns
0 if success or otherwise an error code.
Note
Example: Set PID-controller deadband to 4.1 for axis 3.
"Cfg.SetAxisCntrlDeadband(3,4.1)" //Command string to ecmcCmdParser.c.

◆ setAxisCntrlDeadbandTime()

int setAxisCntrlDeadbandTime ( int axisIndex,
int value )

Set PID-controller deadband time filter.
.

Parameters
[in]axisIndexAxis index.
[in]valuedeadband cycles to be withing tolerance.
Returns
0 if success or otherwise an error code.
Note
Example: Set PID-controller deadband time to 100 cycles for axis 3.
"Cfg.SetAxisCntrlDeadbandTime(3,100)" //Command string to ecmcCmdParser.c.

◆ setAxisCntrlInnerParams()

int setAxisCntrlInnerParams ( int axisIndex,
double kp,
double ki,
double kd,
double tol )

Use a differnt set of pid parameters if within a certain distance of target.

Parameters
[in]axisIndexAxis index.
[in]kpProp gain.
[in]kiIntegarl gain.
[in]kdDerivative gain.
[in]tolTolerance from target.
Note
tolerance needs to bigger than 0 for functionality to be enabled
Returns
0 if success or otherwise an error code.
Note
Example: Set PID-controller params for use abs(actpos - targpos)<tol "Cfg.setAxisCntrlInnerParams(3,4.1,2,5,0.1)" //Command string to ecmcCmdParser.c.

◆ setAxisCntrlIpartHL()

int setAxisCntrlIpartHL ( int axisIndex,
double value )

Set PID-controller maximum integral part output value.
.

Parameters
[in]axisIndexAxis index.
[in]valueMax integral value.
Returns
0 if success or otherwise an error code.
Note
Example: Set PID-controller maximum integral part output value to 700 for axis 3.
"Cfg.SetAxisCntrlIPartHL(3,700)" //Command string to ecmcCmdParser.c.

◆ setAxisCntrlIpartLL()

int setAxisCntrlIpartLL ( int axisIndex,
double value )

Set PID-controller minimum integral part output value.
.

Parameters
[in]axisIndexAxis index.
[in]valueMin integral value.
Returns
0 if success or otherwise an error code.
Note
Example: Set PID-controller minimum integral part output value to -700 for axis 3.
"Cfg.SetAxisCntrlIPartLL(3,-700)" //Command string to ecmcCmdParser.c.

◆ setAxisCntrlKd()

int setAxisCntrlKd ( int axisIndex,
double value )

Set PID-controller differential gain.
.

Parameters
[in]axisIndexAxis index.
[in]valueDifferential gain.
Returns
0 if success or otherwise an error code.
Note
Example: Set PID-controller differential gain to 1.1 for axis 3.
"Cfg.SetAxisCntrlKd(3,1.1)" //Command string to ecmcCmdParser.c.

◆ setAxisCntrlKff()

int setAxisCntrlKff ( int axisIndex,
double value )

Set PID-controller feed forward gain.
.

Parameters
[in]axisIndexAxis index.
[in]valueFeed forward gain.
Returns
0 if success or otherwise an error code.
Note
Example: Set PID-controller feed forward gain to 4.1 for axis 3.
"Cfg.SetAxisCntrlKff(3,4.1)" //Command string to ecmcCmdParser.c.

◆ setAxisCntrlKi()

int setAxisCntrlKi ( int axisIndex,
double value )

Set PID-controller integral gain.
.

Parameters
[in]axisIndexAxis index.
[in]valueIntegral gain.
Returns
0 if success or otherwise an error code.
Note
Example: Set PID-controller integral gain to 0.1 for axis 3.
"Cfg.SetAxisCntrlKi(3,0.1)" //Command string to ecmcCmdParser.c.

◆ setAxisCntrlKp()

int setAxisCntrlKp ( int axisIndex,
double value )

Set PID-controller proportional gain.
.

Parameters
[in]axisIndexAxis index.
[in]valueProportional gain.
Returns
0 if success or otherwise an error code.
Note
Example: Set PID-controller proportional gain to 1.5 for axis 3.
"Cfg.SetAxisCntrlKp(3,1.5)" //Command string to ecmcCmdParser.c.

◆ setAxisCntrlOutHL()

int setAxisCntrlOutHL ( int axisIndex,
double value )

Set PID-controller maximum output value.
.

Parameters
[in]axisIndexAxis index.
[in]valueMax value.
Returns
0 if success or otherwise an error code.
Note
Example: Set PID-controller max value to 1000 for axis 3.
"Cfg.SetAxisCntrlOutHL(3,1000)" //Command string to ecmcCmdParser.c.

◆ setAxisCntrlOutLL()

int setAxisCntrlOutLL ( int axisIndex,
double value )

Set PID-controller minimum output value.
.

Parameters
[in]axisIndexAxis index.
[in]valueMin value.
Returns
0 if success or otherwise an error code.
Note
Example: Set PID-controller min value to -1000 for axis 3.
"Cfg.SetAxisCntrlOutLL(3,-1000)" //Command string to ecmcCmdParser.c.

◆ setAxisCommand()

int setAxisCommand ( int axisIndex,
int value )

Set axis command word.
.

The command word defines different modes of operation for and axis. See fbDriveVirtual manual for more information.

Parameters
[in]axisIndexAxis index.
[in]valueaxis command word.
value = 0: Jog.
value = 1: Constant Velocity.
value = 2: Relative Positioning.
value = 3: Absolute Positioning.
value = 10: Homing.
Returns
0 if success or otherwise an error code.
Note
Example: Set command word to absolute positioning for axis 4.
"Main.M4.nCommand=3" //Command string to ecmcCmdParser.c.
Todo
"TwinCAT syntax. Needs to be changed.

◆ setAxisDeceleration()

int setAxisDeceleration ( int axisIndex,
double value )

Set axis deceleration setpoint.
.

Parameters
[in]axisIndexAxis index.
[in]valueDeceleration setpoint.
Returns
0 if success or otherwise an error code.
Note
Example: Set deceleration setpoint for axis 3 to 500.
"Main.M3.fDeceleration=500" //Command string to ecmcCmdParser.c.
Example: Set deceleration setpoint for axis 3 to 500.
"Cfg.SetAxisDec(3,500)" //Command string to ecmcCmdParser.c.

◆ setAxisDisableAtErrorReset()

int setAxisDisableAtErrorReset ( int axisIndex,
int disable )

Disable axis at error reset
.

If axis is in error state and a reset command is issued,
then the axis will be disabled.

Parameters
[in]axisIndexAxis index.
[in]disabledisable at error reset.
Returns
0 if success or otherwise an error code.
Note
Example: Disable axis at error reset for axis 3.
"Cfg.SetAxisDisableAtErrorReset(3,1)" //Command string to ecmcCmdParser.c.

◆ setAxisDrvBrakeCloseAheadTime()

int setAxisDrvBrakeCloseAheadTime ( int axisIndex,
int aheadTime )

Set brake close ahead time .
.

Activation of the brake will be made prior to disabling the amplifier.
Note: A valid EtherCAT entry must be linked to the drive objects brake entry in order to work like intended.

Parameters
[in]axisIndexAxis index.
[in]aheadTimeAhead time in cycles.
Returns
0 if success or otherwise an error code.
Note
Example: Set brake close ahead time for axis 3 to 100 cycles.
"Cfg.SetAxisDrvBrakeCloseAheadTime(3,100)" //Command string to ecmcCmdParser.c.

◆ setAxisDrvBrakeEnable()

int setAxisDrvBrakeEnable ( int axisIndex,
int enable )

Set enable of brake.
.

The brake output will follow the amplifier enable state of the drive. The brake is high when amplifier enable is high and low when amplifier enable is low.
Note: Delays are can be configured with:
-setAxisDrvBrakeOpenDelayTime()
-setAxisDrvBrakeCloseAheadTime()
Note: A valid EtherCAT entry must be linked to the drive objects brake entry in order to work like intended.

Parameters
[in]axisIndexAxis index.
[in]valueBrake enable.
Returns
0 if success or otherwise an error code.
Note
Example: Enable brake for axis 3.
"Cfg.SetAxisDrvBrakeEnable(3,1)" //Command string to ecmcCmdParser.c.

◆ setAxisDrvBrakeOpenDelayTime()

int setAxisDrvBrakeOpenDelayTime ( int axisIndex,
int delayTime )

Set brake open delay time .
.

The release of the brake will be delayed for an additional delay time when enabling the amplifier.

Note: A valid EtherCAT entry must be linked to the drive objects brake entry in order to work like intended.

Parameters
[in]axisIndexAxis index.
[in]delayTimeDelay time in cycles.
Returns
0 if success or otherwise an error code.
Note
Example: Set brake open delay time for axis 3 to 100 cycles.
"Cfg.SetAxisDrvBrakeOpenDelayTime(3,100)" //Command string to ecmcCmdParser.c.

◆ setAxisDrvReduceTorqueEnable()

int setAxisDrvReduceTorqueEnable ( int axisIndex,
int enable )

Set enable of reduce torque functionality.
.

The reduce torque output will go high when the axis is atTarget. The "atTarget" monitoring functionality needs to be configured in order to reduce torque at the correct time.
Note: A valid EtherCAT entry must be linked to the drive objects reduce torque entry in order to work like intended.

Parameters
[in]axisIndexAxis index.
[in]valueReduce torque enable.
Returns
0 if success or otherwise an error code.
Note
Example: Enable reduce torque for axis 3.
"Cfg.SetAxisDrvReduceTorqueEnable(3,1)" //Command string to ecmcCmdParser.c.

◆ setAxisDrvScaleDenom()

int setAxisDrvScaleDenom ( int axisIndex,
double value )

Set drive output scale denominator.
.

Parameters
[in]axisIndexAxis index.
[in]valueScale denominator.
Returns
0 if success or otherwise an error code.
Note
Example: Set drive output scale denominator to 32000 for axis 3.
"Cfg.SetAxisDrvScaleDenom(3,32000)" //Command string to ecmcCmdParser.c.

◆ setAxisDrvScaleNum()

int setAxisDrvScaleNum ( int axisIndex,
double value )

Set drive output scale numerator.
.

Parameters
[in]axisIndexAxis index.
[in]valueScale numerator.
Returns
0 if success or otherwise an error code.
Note
Example: Set drive output scale numerator to 10000 for axis 3.
"Cfg.SetAxisDrvScaleNum(3,10000)" //Command string to ecmcCmdParser.c.

◆ setAxisDrvStateMachineTimeout()

int setAxisDrvStateMachineTimeout ( int axisIndex,
double seconds )

Set drive timeout .
.

Timeout for transition between disabled->enabled when enable command is sent. For DS402 drives this time is used as timeout between the DS402 states.

Parameters
[in]axisIndexAxis index.
[in]timeoutAhead time in cycles.
Returns
0 if success or otherwise an error code.
Note
Example: Set drive timeout for axis 3 to 10 seconds.
"Cfg.SetAxisDrvStateMachineTimout(3,10.0)" //Command string to ecmcCmdParser.c.

◆ setAxisDrvVelSetOffsetRaw()

int setAxisDrvVelSetOffsetRaw ( int axisIndex,
double value )

Set drive raw velocity offset.
.

Can be used to offset the velocity drive range. can be usefull
if "0" doeas not correspont to 0 speed. basically this value is
added to the raw velocity setpoint just before sent to the slave.
The value should be specified in raw units.

Parameters
[in]axisIndexAxis index.
[in]valuevelocity offset.
Returns
0 if success or otherwise an error code.
Note
Example: Set drive raw velo offset to 700 for axis 3.
"Cfg.SetAxisDrvVelSetOffsetRaw(3,700)" //Command string to ecmcCmdParser.c.

◆ setAxisEmergDeceleration()

int setAxisEmergDeceleration ( int axisIndex,
double value )

Set axis emergency deceleration setpoint.
.

The emergency deceleration setpoint is used:

  • limit switch is engaged.
  • both limit switches are engaged.
  • ...
Parameters
[in]axisIndexAxis index.
[in]valueEmergency deceleration setpoint.
Returns
0 if success or otherwise an error code.
Note
Example: Set emergency deceleration setpoint for axis 3 to 54321.
"Cfg.SetAxisEmergDeceleration(3,54321)" //Command string to ecmcCmdParser.c.

◆ setAxisEmergencyStopInterlock()

int setAxisEmergencyStopInterlock ( int axisIndex,
int stop )

Init emergency stop ramp for an axis.

Note
This is not related to safety.
The system just tries to ramp down.
The real safety must be handled in a safety PLC.
Parameters
[in]axisIndexAxis index.
[in]stopstop axis.

◆ setAxisEnable()

int setAxisEnable ( int axisIndex,
int value )

Set axis amplifier enable command bit.
.

Parameters
[in]axisIndexAxis index.
[in]valueState of axis amplifier command bit.
Returns
0 if success or otherwise an error code.
Note
Example: Set amplifier enable command bit for axis 3.
"Main.M3.bEnable=1" //Command string to ecmcCmdParser.c.
Todo
"TwinCAT syntax. Needs to be changed.

◆ setAxisEnableAlarmAtHardLimits()

int setAxisEnableAlarmAtHardLimits ( int axisIndex,
int value )

Set enable alarms at limits bit.
.

Parameters
[in]axisIndexAxis index.
[in]valueEnable alarm at limits bit.
Returns
0 if success or otherwise an error code.
Note
Example: Enable alarm at limits bit for axis 3.
"Cfg.SetAxisEnableAlarmAtHardLimits(3,1)" //Command string to ecmcCmdParser.c.

◆ setAxisEnableAlarmAtSoftLimit()

int setAxisEnableAlarmAtSoftLimit ( int axisIndex,
int value )

Enable alarm when at softlimit.

Parameters
[in]axisIndexAxis index.
[in]valuealarm enable command.
Returns
0 if success or otherwise an error code.
Note
Example: Enable alarm for soft-limits for axis 3.
"Cfg.SetAxisEnableAlarmAtSoftLimit(3,1)" //Command string to ecmcCmdParser.c.

◆ setAxisEnableCheckEncsDiff()

int setAxisEnableCheckEncsDiff ( int axisIndex,
int enable )

Set "at target" monitoring tolerance.
.

Enable check of difference between encoders
(if more than one encoder is configutred for teh axis)

Parameters
[in]axisIndexAxis index.
[in]enableEnable monitoring of encoder diffs
(if more than one enc per axis is configured).
Returns
0 if success or otherwise an error code.
Note
Example: Enable funtionallity for axis 7.
"Cfg.SetAxisMonEnableEncsDiff(7,1)" //Command string to ecmcCmdParser.c.

◆ setAxisEnableMotionFunctions()

int setAxisEnableMotionFunctions ( int axisIndex,
int enablePos,
int enableConstVel,
int enableHome )

Set enable of motion functions.
.

Parameters
[in]axisIndexAxis index.
[in]enablePosAllow positioning (default = true).
[in]enableConstVelAllow constant velocity (default = true).
[in]enableHomeAllow homing (default = true).
Returns
0 if success or otherwise an error code.
Note
Example: Only allow positioning for axis 3.
"Cfg.setAxisEnableMotionFunctions(3,1,0,0)" //Command string to ecmcCmdParser.c.

◆ setAxisEnableSoftLimitBwd()

int setAxisEnableSoftLimitBwd ( int axisIndex,
int value )

Set enable backward soft-limit of an axis.
.

Parameters
[in]axisIndexAxis index.
[out]valueSoft-limit enable command.
Returns
0 if success or otherwise an error code.
Note
Example: Disable backward soft-limit for axis 3.
"ADSPORT=501/.ADR.16#5003,16#B,2,2=0" //Command string to ecmcCmdParser.c.
Todo
"TwinCAT syntax. Needs to be changed.

◆ setAxisEnableSoftLimitFwd()

int setAxisEnableSoftLimitFwd ( int axisIndex,
int value )

Set enable forward soft-limit of an axis.
.

Parameters
[in]axisIndexAxis index.
[in]valueSoft-limit enable command.
Returns
0 if success or otherwise an error code.
Note
Example: Enable forward soft-limit for axis 3.
"ADSPORT=501/.ADR.16#5001,16#C,2,2=1" //Command string to ecmcCmdParser.c.
Todo
"TwinCAT syntax. Needs to be changed.

◆ setAxisEncAbsBits()

int setAxisEncAbsBits ( int axisIndex,
int bits )

Set encoder register bit count for absolute data.
.

This setting is used for homing of partly absolute encoders
like resolvers (single turn absolute). The data is always
considered to be located at the least significant bits
of the encoder data (masked). See setAxisEncBits() and
setAxisEncRawMask() for more information.

Parameters
[in]axisIndexAxis index.
[in]bitsEncoder register bit count for absolute data.
Returns
0 if success or otherwise an error code.
Note
Example: Set encoder absolute bit count to 10 for axis 3.
"Cfg.SetAxisEncAbsBits(3,10)" //Command string to ecmcCmdParser.c.

◆ setAxisEncBits()

int setAxisEncBits ( int axisIndex,
int bits )

Set encoder register bit count.
.

The bit count is used to handle over/under flow.

Note
: The bits will be considered to be the least significant
of the encoder data area. The raw encoder mask will therefore
be set to 2^bits-1 (see setAxisEncRawMask() for more info). If
bits need to be filtered away then use setAxisEncRawMask() command
instead.
Parameters
[in]axisIndexAxis index.
[in]bitsEncoder register bit count.
Returns
0 if success or otherwise an error code.
Note
Example: Set encoder bit count to 16 for axis 3.
"Cfg.SetAxisEncBits(3,16)" //Command string to ecmcCmdParser.c.

◆ setAxisEncEnableRefAtHome()

int setAxisEncEnableRefAtHome ( int axisIndex,
int enable )

Set referance this encoder at homing.

Referance this encoder during homing. If true, this encoder will be
set to the resulting value of a hoing sequence (based on any encoder).

Parameters
[in]axisIndexAxis index.
[in]enableEnable referencing.
Returns
0 if success or otherwise an error code.
Note
Example: Ref this encoder at homing of axis 3.
"Cfg.SetAxisEncEnableRefAtHome(3,1)" //Command string to ecmcCmdParser.c.

◆ setAxisEncHomeLatchCountOffset()

int setAxisEncHomeLatchCountOffset ( int axisIndex,
int count )

Set home index pulse count offset.
.

Sets number of latches before homing is made for the current
encoder beeing configured.

Note
Only valid for some homing sequences when\ homing on hardware latched position (encoder index or external hw latch).
Parameters
[in]axisIndexAxis index.
[in]countNumber of latches before homing.
Returns
0 if success or otherwise an error code.
Note
Example: Set home latch count to 1 for axis 10.
"Cfg.SetAxisEncHomeLatchCountOffset(10,1)" //Command string to ecmcCmdParser.c.

◆ setAxisEncInvHwReady()

int setAxisEncInvHwReady ( int axisIndex,
int invert )

Invert Encoder Ready bit.

Some hardwares, i.e. EL72XX have a inverted encoder ready bit. part. This function reads the numerator part.

Note: Encoder error bit can also be used for this purpose.

Parameters
[in]axisIndexAxis index.
[in]invertInvert encoder ready bit.
Returns
0 if success or otherwise an error code.
Note
Example: Set invert encoder ready numerator for axes 3
"Cfg.SetAxisEncInvHwReady(3,1)" //Command string to ecmcCmdParser.c.

◆ setAxisEncMaxDiffToPrimEnc()

int setAxisEncMaxDiffToPrimEnc ( int axisIndex,
double value )

Set maximum position deviation between current encoder and primary encoder.
.

Parameters
[in]axisIndexAxis index.
[in]valueMaximum allowed position deviation.
Returns
0 if success or otherwise an error code.
Note
Example: Set maximum allowed devaition between this encoder and
the primary encoder to 0.1 for axis 3.
"Cfg.SetAxisEncMaxDiffToPrimEnc(3,0.1)" //Command string to ecmcCmdParser.c.

◆ setAxisEncOffset()

int setAxisEncOffset ( int axisIndex,
double value )

Set encoder offset value.
.

Parameters
[in]axisIndexAxis index.
[in]valueOffset position.
Returns
0 if success or otherwise an error code.
Note
Example: Set encoder offset value to 100 for axis 3.
"Cfg.SetAxisEncOffset(3,100)" //Command string to ecmcCmdParser.c.

◆ setAxisEncPosFilterEnable()

int setAxisEncPosFilterEnable ( int axisIndex,
int enable )

Enables/disables encoder position filter.
.

Parameters
[in]axisIndexAxis index.
[in]enableEnable/disable (default disabled).
Returns
0 if success or otherwise an error code.
Note
Example: Enable filter for axis 7.
"Cfg.SetAxisEncPosFilterEnable(7,1)" //Command string to ecmcCmdParser.c.

◆ setAxisEncPosFilterSize()

int setAxisEncPosFilterSize ( int axisIndex,
int size )

Set size of encoder position filter.
.

Sets the size of the low pass filter for the encoder value.
Needed when resolution of encoder is low compared to
sample rate and speed.

Parameters
[in]axisIndexAxis index.
[in]sizeSize of filter (default 10), filter disables if size<=1.
Returns
0 if success or otherwise an error code.
Note
Example: Set filter size to 10 for for axis 7.
"Cfg.SetAxisEncPosFilterSize(7,10)" //Command string to ecmcCmdParser.c.

◆ setAxisEncRawMask()

int setAxisEncRawMask ( int axisIndex,
uint64_t rawMask )

Set encoder raw data mask.
.

Mask to filter Encoder data from encoder 64bit data
Also calculates bit-count of encoder data. If this function
is used then the setAxisEncBits() should NOT be used since
. setAxisEncBits() also calculates and sets the a raw-mask
(but based on all data located on the least significant bits).

Parameters
[in]axisIndexAxis index.
[in]rawMaskEncoder raw mask.
Returns
0 if success or otherwise an error code.
Note
Example: Set encoder mask to 0xFFFF for axis 3.
"Cfg.SetAxisEncRawMask(3,0xFFFF)" //Command string to ecmcCmdParser.c.

◆ setAxisEncRefToOtherEncAtStartup()

int setAxisEncRefToOtherEncAtStartup ( int axisIndex,
int encRef )

Reference this encoder to other encoder at startup.
.

For axes with multiple encoders an encoder can be referenced to other
encoder at startup. This is typically usefull for referencing a
relative encoder to an absolute encoder.

Parameters
[in]axisIndexAxis index.
[in]encRefEncoder reference index (first index is 0).
Returns
0 if success or otherwise an error code.
Note
Example: Reference this encoder to encoder 0 of axis 4 "Cfg.SetAxisEncRefToOtherEncAtStartup(4,0)" //Command string to ecmcCmdParser.c.

◆ setAxisEncScaleDenom()

int setAxisEncScaleDenom ( int axisIndex,
double value )

Set the denominator part of the encoder scale.
.

The encoder scale factor is divided into one numerator and one denominator part. This function reads the denominator part.

Parameters
[in]axisIndexAxis index.
[in]valueEncoder scale denominator part.
Returns
0 if success or otherwise an error code.
Note
Example: Set encoder scale denominator for axes 8 to 4096.
"ADSPORT=501/.ADR.16#5008,16#24,8,5=4096" //Command string to ecmcCmdParser.c.
Todo
"TwinCAT syntax. Needs to be changed.

◆ setAxisEncScaleNum()

int setAxisEncScaleNum ( int axisIndex,
double value )

Set the numerator part of the encoder scale.
.

The encoder scale factor is divided into one numerator and one denominator part. This function reads the numerator part.

Parameters
[in]axisIndexAxis index.
[in]valueEncoder scale numerator part.
Returns
0 if success or otherwise an error code.
Note
Example: Set encoder scale numerator for axes 3 to 360.
"ADSPORT=501/.ADR.16#5003,16#23,8,5=360" //Command string to ecmcCmdParser.c.
Todo
"TwinCAT syntax. Needs to be changed.

◆ setAxisEncSource()

int setAxisEncSource ( int axisIndex,
int value )

Set axis encoder data source.
.

An axis encoder can get actual position from different sources:
source = 0 : Internal (EtherCAT entry).
source = 1 : External from transformation expression (synchronization).

Parameters
[in]axisIndexAxis index.
[in]valueSource type.
Returns
0 if success or otherwise an error code.
Note
Example: Set encoder data source type for axis 3 to external.
"Cfg.SetAxisEncSourceType(3,1)" //Command string to ecmcCmdParser.c.

◆ setAxisEncType()

int setAxisEncType ( int axisIndex,
int value )

Set encoder type.
.

Parameters
[in]axisIndexAxis index.
[in]valueEncoder type.
value = 0: Incremental encoder.
value = 1: Absolute encoder.
Returns
0 if success or otherwise an error code.
Note
Example: Set encoder type to absolute for axis 3.
"Cfg.SetAxisEncType(3,1)" //Command string to ecmcCmdParser.c.

◆ setAxisEncVelFilterSize()

int setAxisEncVelFilterSize ( int axisIndex,
int size )

Set size of encoder velocity filter.
.

Sets the size of the low pass filter for velocity.
Needed when resolution of encoder is low compared to
sample rate and speed.

Parameters
[in]axisIndexAxis index.
[in]sizeSize of filter (default 100), needs to be >0.
Returns
0 if success or otherwise an error code.
Note
Example: Set filter size to 10 for for axis 7.
"Cfg.SetAxisEncVelFilterSize(7,10)" //Command string to ecmcCmdParser.c.

◆ setAxisErrorId()

int setAxisErrorId ( int axisIndex,
int errorId )

Set axis error code.
.

Set axis error, can be used to provoke an error in an axis.

Parameters
[in]axisIndexAxis index.
[in]errorIdError id.
Returns
0 if success or otherwise an error code.
Note
Example: Set errorid of axis 10 to 111 (dec).
"Cfg.SetAxisErrorId(10,111)" //Command string to ecmcCmdParser.c.

◆ setAxisExecute()

int setAxisExecute ( int axisIndex,
int value )

Set axis execute bit.
.

An positive edge of the execute bit triggers a new command.
Motion is interlocked when the execute bit is low.

Parameters
[in]axisIndexAxis index.
[in]valueExecute bit.
Returns
0 if success or otherwise an error code.
Note
Example: Set execute bit for axis 3.
"Main.M3.bExecute=1" //Command string to ecmcCmdParser.c.
Example: Stop motion on axis 3.
"Main.M3.bExecute=0" //Command string to ecmcCmdParser.c.
Todo
"TwinCAT syntax. Needs to be changed.

◆ setAxisExtSetPos()

int setAxisExtSetPos ( int axisIndex,
double value )

Set axis external position setpoint.
.

Set the external sync/plc setpoint for an axis

Parameters
[in]axisIndexAxis index.
[in]valueexternal position setpoint.
Returns
0 if success or otherwise an error code.

◆ setAxisHomeAcc()

int setAxisHomeAcc ( int axisIndex,
double acc )

Set homing acceleration for current encoder beeing configured.
.

Parameters
[in]axisIndexAxis index.
[in]valueacceleration.
Returns
0 if success or otherwise an error code.
Note
Example: Set homing acceleration to 15 for axis 2.
"Cfg.SetAxisHomeAcc(2,15)" //Command string to ecmcCmdParser.c.

◆ setAxisHomeDec()

int setAxisHomeDec ( int axisIndex,
double acc )

Set homing deceleration for current encoder beeing configured.
.

Parameters
[in]axisIndexAxis index.
[in]valuedeceleration.
Returns
0 if success or otherwise an error code.
Note
Example: Set homing deceleration to 15 for axis 2.
"Cfg.SetAxisHomeDec(2,15)" //Command string to ecmcCmdParser.c.

◆ setAxisHomePos()

int setAxisHomePos ( int axisIndex,
double value )

Set axis home reference position setpoint.
.

The home reference position setpoint is only used during referencing/homing sequence. The final referencing will be done to this position (the reference switch edge will have this positon after referenceing).

Parameters
[in]axisIndexAxis index.
[in]valueHome position setpoint.
Returns
0 if success or otherwise an error code.
Note
Example: Set home position setpoint for axis 3 to 111.
"Main.M3.fHomePosition=111" //Command string to ecmcCmdParser.c.
Todo
"TwinCAT syntax. Needs to be changed.

◆ setAxisHomePostMoveEnable()

int setAxisHomePostMoveEnable ( int axisIndex,
int enable )

Set homing post movement enable.

After successfull homing sequence an absolute positioning command can be executed.
If enabled the axis will issue an motion command to the target position defined by
setAxisHomePostMoveTargetPosition()

Parameters
[in]axisIndexAxis index.
[in]enableenable functionality.
Returns
0 if success or otherwise an error code.
Note
Example: Enable post home movement for axis 2
"Cfg.SetAxisHomePostMoveEnable(2,1)" //Command string to ecmcCmdParser.c.

◆ setAxisHomePostMoveTargetPosition()

int setAxisHomePostMoveTargetPosition ( int axisIndex,
double targetPosition )

Set homing post movement target position.

After successfull homing sequence an absolute positioning command can be executed.
If enabled the axis will issue an motion command to the target position defined by
by this function

Parameters
[in]axisIndexAxis index.
[in]targetPositionTarget position for post home seq movement.
Returns
0 if success or otherwise an error code.
Note
Example: Set a post home movement target position of 100 for axis 2
"Cfg.SetAxisHomePostMoveTargetPosition(2,100)" //Command string to ecmcCmdParser.c.

◆ setAxisHomeSeqId()

int setAxisHomeSeqId ( int axisIndex,
int value )

Set homing sequence id for current encoder beeing configured.
.

Parameters
[in]axisIndexAxis index.
[in]valueseq id time.
Returns
0 if success or otherwise an error code.
Note
Example: Set sequence id to 15 for axis 2.
"Cfg.SetAxisHomeSeqId(2,15)" //Command string to ecmcCmdParser.c.

◆ setAxisHomeVelOffCam()

int setAxisHomeVelOffCam ( int axisIndex,
double dVel )

Set off cam referencing/homing velocity setpoint.
.

This velocity setpoint is only used during homing sequence when the reference switch already have been found. See command "getAxisHomeVelTowardsCam()" for more information.
Normally the off cam velocity setpoint is lower than the Towards cam setpoint since the accuracy of homing is depending on how accurate the signal edge of the reference switch can be identified.

Parameters
[in]axisIndexAxis index.
[in]valueVelocity setpoint.
Returns
0 if success or otherwise an error code.
Note
Example: Set off cam referencing/homing velocity setpoint for axes 3 to 7.5.
"ADSPORT=501/.ADR.16#4003,16#7,8,5=7.5" //Command string to ecmcCmdParser.c.
Todo
"TwinCAT syntax. Needs to be changed.

◆ setAxisHomeVelTowardsCam()

int setAxisHomeVelTowardsCam ( int axisIndex,
double dVel )

Set Towards cam referencing/homing velocity setpoint.
.

This velocity setpoint is only used during homing sequence when finding the reference switch. See command "getAxisHomeVelTowardsCam()" for more information.
Normally the off cam velocity setpoint is lower than the towards cam setpoint since the accuracy of homing is depending on how accurate the signal edge of the reference switch can be identified.

Parameters
[in]axisIndexAxis index.
[in]valueVelocity setpoint.
Returns
0 if success or otherwise an error code.
Note
Example: Set towards cam referencing/homing velocity setpoint for axes 3 to 10.
"ADSPORT=501/.ADR.16#4003,16#6,8,5=10" //Command string to ecmcCmdParser.c.
Todo
"TwinCAT syntax. Needs to be changed.

◆ setAxisJerk()

int setAxisJerk ( int axisIndex,
double value )

Set axis maximum jerk setpoint.
.

Note
Only used for ruckig trajectories (traj type 1).
Parameters
[in]axisIndexAxis index.
[in]valueJerk setpoint.
Returns
0 if success or otherwise an error code.
Note
Example: Set jerk to 23.2 for axis 3.
"Cfg.SetAxisJerk(3,23.2)" //Command string to ecmcCmdParser.c.

◆ setAxisJogVel()

int setAxisJogVel ( int axisIndex,
double value )

Set axis jog velocity setpoint.
.

The jog velocity is the desired velocity of a motion when executing a jog command (command=10).
Note: The actual velocity can be higher than this setpoint.

Parameters
[in]axisIndexAxis index.
[in]valueJog velocity setpoint.
Returns
0 if success or otherwise an error code.
Note
Example: Set target velocity setpoint for axis 3 to 55.
"Cfg.SetAxisJogVel(3,55)" //Command string to ecmcCmdParser.c.

◆ setAxisModRange()

int setAxisModRange ( int axisIndex,
double range )

Set axis modulo range.
.

Parameters
[in]axisIndexAxis index.
[in]valuemodulo range.
Returns
0 if success or otherwise an error code.
Note
Example: Set modulo range for axis 3 to 360.
"Cfg.SetAxisModRange(3,360)" //Command string to ecmcCmdParser.c.

◆ setAxisModType()

int setAxisModType ( int axisIndex,
int type )

Set axis modulo motion type.
.

Used for positioning if modulo range is set (setAxisModRange())
to a value greater than 0.

Parameters
[in]axisIndexAxis index.
[in]typeModulo type.
type = 0 : ECMC_MOD_MOTION_NORMAL
1: ECMC_MOD_MOTION_FWD (Always forward)
2: ECMC_MOD_MOTION_BWD (always backward)
3: ECMC_MOD_MOTION_CLOSEST (closest path)
Returns
0 if success or otherwise an error code.
Note
Example: Set modulo type to "ECMC_MOD_MOTION_BWD"
for axis 3.
"Cfg.SetAxisModType(3,2)" //Command string to ecmcCmdParser.c.

◆ setAxisMonAnalogInterlockPolarity()

int setAxisMonAnalogInterlockPolarity ( int axisIndex,
int value )

Set polarity of motion axis interlock from EtherCAT entry.
.

The motion can be interlocked based on an EtherCAT entry. See command linkEcEntryToAxisMon() for more information.

Parameters
[in]axisIndexAxis index.
[in]valuePolarity analog interlock (inversed from digital interlock).
0 = High value is bad.
1 = Low value is bad.
Returns
0 if success or otherwise an error code.
Note
Example: Set analog interlock to 1 for axis 7.
"Cfg.SetAxisMonAnalogInterlockPolarity(7,1)" //Command string to ecmcCmdParser.c.

◆ setAxisMonAnalogInterlockRawLimit()

int setAxisMonAnalogInterlockRawLimit ( int axisIndex,
double value )

Set analog interlock raw value limit .
.

The motion can be interlocked based on an EtherCAT entry. See command linkEcEntryToAxisMon() for more information.

Parameters
[in]axisIndexAxis index.
[in]valueraw value limit.
Returns
0 if success or otherwise an error code.
Note
Example: Set analog raw value limit to 3200 for axis 7.
"Cfg.SetAxisMonAnalogInterlockRawLimit(7,3200)" //Command string to ecmcCmdParser.c.

◆ setAxisMonAtTargetTime()

int setAxisMonAtTargetTime ( int axisIndex,
int value )

Set "at target" monitoring time (cycles).
.

The motion will be considered to have reached the target position when the difference between the actual position and target position is within a certain tolerance for a this number of cycles, see command setAxisMonAtTargetTol() for more information.
Note: The "at target" functionality needs to be enabled by the command setAxisMonEnableAtTargetMon().

Parameters
[in]axisIndexAxis index.
[in]valueAt target time (cycles) .
Returns
0 if success or otherwise an error code.
Note
Example: Set at target tolerance time (cycles) to 10 for axis 7.
"Cfg.SetAxisMonAtTargetTime(7,10)" //Command string to ecmcCmdParser.c.

◆ setAxisMonAtTargetTol()

int setAxisMonAtTargetTol ( int axisIndex,
double value )

Set "at target" monitoring tolerance.
.

The motion will be considered to have reached the target position when the difference between the actual position and target position is within this tolerance for a certain number of cycles, see command setAxisMonAtTargetTime() for more information.
Note: The "at target" functionality needs to be enabled by the command setAxisMonEnableAtTargetMon().

Parameters
[in]axisIndexAxis index.
[in]valueAt target tolerance.
Returns
0 if success or otherwise an error code.
Note
Example: Set at target tolerance to 0.1 for axis 7.
"Cfg.SetAxisMonAtTargetTol(7,0.1)" //Command string to ecmcCmdParser.c.

◆ setAxisMonCntrlOutHL()

int setAxisMonCntrlOutHL ( int axisIndex,
double value )

Set monitoring controller output high limit.
.

Set maximum allowed controller output for an axis.
A high controller output during a motion could be generated by bad tuning or mechanical issues, see command setAxisMonEnableCntrlOutHLMon()for more information.

Note
WARNING: If an error is detected, the enable (power) will be removed from the axis. Please always ensure that the power less state is the safe state.
Parameters
[in]axisIndexAxis index.
[in]valueMaximum allowed controller output.
Returns
0 if success or otherwise an error code.
Note
Example: Set maximum allowed output to 2000 for for axis 3.
"Cfg.SetAxisMonCntrlOutHL(3,2000)" //Command string to ecmcCmdParser.c.

◆ setAxisMonEnableAnalogInterlock()

int setAxisMonEnableAnalogInterlock ( int axisIndex,
int value )

Enable motion axis interlock from analog EtherCAT entry.
A typical usecase is temperature sensors.
.

The motion can be interlocked based on an analog EtherCAT entry. See command linkEcEntryToAxisMon() for more information.

Parameters
[in]axisIndexAxis index.
[in]valueEnable external interlock.
Note
WARNING: If an error is detected, the enable (power) will be removed from the axis. Please always ensure that the power less state is the safe state.
Returns
0 if success or otherwise an error code.
Note
Example: Enable analog interlock for axis 7.
"Cfg.SetAxisMonEnableAnalogInterlock(7,1)" //Command string to ecmcCmdParser.c.

◆ setAxisMonEnableAtTargetMon()

int setAxisMonEnableAtTargetMon ( int axisIndex,
int value )

Enable "at target" monitoring.
.

The motion will be considered to have reached the target position when the difference between the actual position and target position is within a certain tolerance for a this number of cycles, see command setAxisMonAtTargetTol() and setAxisMonAtTargetTime() for more information.

Parameters
[in]axisIndexAxis index.
[in]valueEnable monitoring .
Returns
0 if success or otherwise an error code.
Note
Example: Enable at target monitoring for axis 7.
"Cfg.SetAxisMonEnableAtTargetMon(7,1)" //Command string to ecmcCmdParser.c.

◆ setAxisMonEnableCntrlOutHLMon()

int setAxisMonEnableCntrlOutHLMon ( int axisIndex,
int value )

Enable controller output high limit monitoring.
.

The controller output high limit monitoring functionality monitors the controller output. The motion can be interlocked if the controller output exceeds a certain tolerance, see command setAxisMonCntrlOutHL() for more information.
A high controller output during a motion could be generated by bad tuning or mechanical issues.

Note
WARNING: If an error is detected, the enable (power) will be removed from the axis. Please always ensure that the power less state is the safe state.
Parameters
[in]axisIndexAxis index.
[in]valueEnable monitoring.
Returns
0 if success or otherwise an error code.
Note
Example: Disable controller output high limit monitoring for axis 2.
"Cfg.SetAxisMonEnableCntrlOutHLMon(2,0)" //Command string to ecmcCmdParser.c.

◆ setAxisMonEnableExternalInterlock()

int setAxisMonEnableExternalInterlock ( int axisIndex,
int value )

Enable motion axis interlock from EtherCAT entry.
.

The motion can be interlocked based on an EtherCAT entry. See command linkEcEntryToAxisMon() for more information.

Parameters
[in]axisIndexAxis index.
[in]valueEnable external interlock.
Note
WARNING: If an error is detected, the enable (power) will be removed from the axis. Please always ensure that the power less state is the safe state.
Returns
0 if success or otherwise an error code.
Note
Example: Enable external interlock for axis 7.
"Cfg.SetAxisMonEnableExtHWInterlock(7,1)" //Command string to ecmcCmdParser.c.

◆ setAxisMonEnableLagMon()

int setAxisMonEnableLagMon ( int axisIndex,
int value )

Enable position lag monitoring.
.

The position lag monitoring functionality monitors the difference between the actual position and trajectory generated setpoint position. The motion can be interlocked if the difference exceeds a certain tolerance for a certain number of cycles, see command setAxisMonPosLagTime() and setAxisMonPosLagTol() for more information.
A big position lag error during a motion could be generated by bad tuning or mechanical issues.

Parameters
[in]axisIndexAxis index.
[in]valuemonitoring enabled.
.
Returns
0 if success or otherwise an error code.
Note
Example: Disable position lag monitoring for axis 2.
"Cfg.SetAxisMonEnableLagMon(2,0)" //Command string to ecmcCmdParser.c.

◆ setAxisMonEnableMaxVel()

int setAxisMonEnableMaxVel ( int axisIndex,
int value )

Enable maximum velocity monitoring (over speed).
.

The motion will be interlocked if the actual velocity or the velocity setpoint exceeds the limit value set by the command setAxisMonMaxVel().

Parameters
[in]axisIndexAxis index.
[in]valueEnable monitoring.
Returns
0 if success or otherwise an error code.
Note
Example: Enable over speed monitoring for axis 3.
"Cfg.SetAxisMonEnableMaxVel(3,1)" //Command string to ecmcCmdParser.c.

◆ setAxisMonEnableVelocityDiff()

int setAxisMonEnableVelocityDiff ( int axisIndex,
int value )

Enable monitoring of velocity difference.
.

Parameters
[in]axisIndexAxis index.
[in]valueEnable monitoring.
Returns
0 if success or otherwise an error code.
Note
Example: Enable monitoring for axis 2.
"Cfg.SetAxisMonEnableVelocityDiff(2,1)" //Command string to ecmcCmdParser.c.

◆ setAxisMonExtHWInterlockPolarity()

int setAxisMonExtHWInterlockPolarity ( int axisIndex,
int value )

Set polarity of motion axis interlock from EtherCAT entry.
.

The motion can be interlocked based on an EtherCAT entry. See command linkEcEntryToAxisMon() for more information.

Parameters
[in]axisIndexAxis index.
[in]valuePolarity external interlock.
0 = NC (High is OK) Default.
1 = NO (Low is OK).
Note
WARNING: If an error is detected, the enable (power) will be removed from the axis. Please always ensure that the power less state is the safe state.
Returns
0 if success or otherwise an error code.
Note
Example: Set external interlock to NC for axis 7.
"Cfg.SetAxisMonExtHWInterlockPolarity(7,0)" //Command string to ecmcCmdParser.c.

◆ setAxisMonHomeSwitchPolarity()

int setAxisMonHomeSwitchPolarity ( int axisIndex,
int value )

Set polarity of home switch.
.

Parameters
[in]axisIndexAxis index.
[in]valuePolarity.
0 = NC (High is 1) Default.
1 = NO (Low is 1).
Returns
0 if success or otherwise an error code.
Note
Example: Set home switch polarity to NC for axis 7.
"Cfg.SetAxisMonHomeSwitchPolarity(7,0)" //Command string to ecmcCmdParser.c.

◆ setAxisMonLatchLimit()

int setAxisMonLatchLimit ( int axisIndex,
int value )

Set latch limit settings.
.

If set: limit switch is latched even if just a "bounce"
Then motion must stop before a new motion can be activated.
Otherwise motion will be allowed as long as limit is OK

Parameters
[in]axisIndexAxis index.
[in]valuelatch on limit setting value.
0: disable 1: enable (default)
Note
Example: Disable latch limit for for axis 4.
"Cfg.SetAxisMonLatchLimit(4,0)" //Command string to ecmcCmdParser.c.
Returns
0 if success or otherwise an error code.

◆ setAxisMonLimitBwdPolarity()

int setAxisMonLimitBwdPolarity ( int axisIndex,
int value )

Set polarity of hard low limit switch.
.

Parameters
[in]axisIndexAxis index.
[in]valuePolarity.
0 = NC (High is OK) Default.
1 = NO (Low is OK).
Returns
0 if success or otherwise an error code.
Note
Example: Set low limit polarity to NC for axis 7.
"Cfg.SetAxisMonLimitBwdPolarity(7,0)" //Command string to ecmcCmdParser.c.

◆ setAxisMonLimitFwdPolarity()

int setAxisMonLimitFwdPolarity ( int axisIndex,
int value )

Set polarity of hard high limit switch.
.

Parameters
[in]axisIndexAxis index.
[in]valuePolarity.
0 = NC (High is OK) Default.
1 = NO (Low is OK).
Returns
0 if success or otherwise an error code.
Note
Example: Set high limit polarity to NC for axis 7.
"Cfg.SetAxisMonLimitFwdPolarity(7,0)" //Command string to ecmcCmdParser.c.

◆ setAxisMonMaxVel()

int setAxisMonMaxVel ( int axisIndex,
double value )

Set maximum allowed velocity.
.

The motion will be interlocked if the actual velocity or the velocity setpoint exceeds this value.
Note: The maximum velocity monitoring needs to be enabled with the command setAxisMonEnableMaxVel().

Parameters
[in]axisIndexAxis index.
[in]valueMaximum velocity.
Returns
0 if success or otherwise an error code.
Note
Example: Set maximum velocoity for axis 3 to 20.
"Cfg.SetAxisMonMaxVel(3,20)" //Command string to ecmcCmdParser.c.

◆ setAxisMonMaxVelDriveILDelay()

int setAxisMonMaxVelDriveILDelay ( int axisIndex,
int value )

Set velocity monitoring interlock delay for drive.
.

The over speed interlock for the drive can be delayed in order ensure that encoder noise reulsting in a high velocity will not interlock motion. If the overspeed interlock is still active after this amount of cycles the drive will be interlocked and the amplifier will be turned off.
Note: The maximum velocity monitoring needs to be enabled with the command setAxisMonEnableMaxVel().

Parameters
[in]axisIndexAxis index.
[in]valueDelay cycles.
Returns
0 if success or otherwise an error code.
Note
Example: Set drive over speed interlock delay to 10 cycles for axis 4.
"Cfg.SetAxisMonMaxVelDriveILDelay(4,10)" //Command string to ecmcCmdParser.c.

◆ setAxisMonMaxVelTrajILDelay()

int setAxisMonMaxVelTrajILDelay ( int axisIndex,
int value )

Set velocity monitoring interlock delay for trajectory.
.

The over speed interlock for the trajectory generator can be delayed in order ensure that encoder noise reulsting in a high velocity will not interlock motion. If the overspeed interlock is still active after this amount of cycles the trajectory generator will be interlocked and velocity will be ramped down to stand still.
Note: The maximum velocity monitoring needs to be enabled with the command setAxisMonEnableMaxVel().

Parameters
[in]axisIndexAxis index.
[in]valueDelay cycles.
Returns
0 if success or otherwise an error code.
Note
Example: Set trajectory generator over speed interlock delay to 10 cycles for axis 4.
"Cfg.SetAxisMonMaxVelTrajILDelay(4,10)" //Command string to ecmcCmdParser.c.

◆ setAxisMonPosLagTime()

int setAxisMonPosLagTime ( int axisIndex,
int value )

Set position lag monitoring time (cycles).
.

The position lag monitoring functionality monitors the difference between the actual position and trajectory generated setpoint position. The motion can be interlocked if the difference exceeds a certain tolerance for a this number of cycles, see command setAxisMonPosLagTol() for more information.
A big position lag error during a motion could be generated by bad tuning or mechanical issues.
Note: The position lag functionality needs to be enabled with the command setAxisMonEnableLagMon().

Parameters
[in]axisIndexAxis index.
[in]valuePosition lag time (cycles).
Returns
0 if success or otherwise an error code.
Note
Example: Set position lag time (cycles) to 10 for axis 7.
"Cfg.SetAxisMonPosLagTime(7,10)" //Command string to ecmcCmdParser.c.

◆ setAxisMonPosLagTol()

int setAxisMonPosLagTol ( int axisIndex,
double value )

Set position lag maximum monitoring tolerance.
.

The position lag monitoring functionality monitors the difference between the actual position and trajectory generated setpoint position. The motion can be interlocked if the difference exceeds this tolerance for a certain number of cycles, see command setAxisMonPosLagTime() for more information.
A big position lag error during a motion could be generated by bad tuning or mechanical issues.
Note: The position lag functionality needs to be enabled with the command setAxisMonEnableLagMon().

Parameters
[in]axisIndexAxis index.
[in]valuePosition lag maximum tolerance.
Returns
0 if success or otherwise an error code.
Note
Example: Set maximum position lag tolerance to 0.2 for axis 7.
"Cfg.SetAxisMonPosLagTol(7,0.2)" //Command string to ecmcCmdParser.c.

◆ setAxisMonVelDiffDriveILDelay()

int setAxisMonVelDiffDriveILDelay ( int axisIndex,
int value )

Set drive interlock filter time in cycles for velocity difference monitoring.
.

Parameters
[in]axisIndexAxis index.
[in]valueTime in cycles.
Returns
0 if success or otherwise an error code.
Note
Example: Set filter time to 500 cycles for axis 2.
"Cfg.SetAxisMonVelDiffDriveILDelay(2,500)" //Command string to ecmcCmdParser.c.

◆ setAxisMonVelDiffTol()

int setAxisMonVelDiffTol ( int axisIndex,
double value )

Set maximum allowed difference between setpoint speed and actual speedĀ±n.

Parameters
[in]axisIndexAxis index.
[in]valuevelocity difference.
Returns
0 if success or otherwise an error code.
Note
Example: Set maximum difference 0.5 for axis 2.
"Cfg.SetAxisMonVelDiffTol(2,0.5)" //Command string to ecmcCmdParser.c.

◆ setAxisMonVelDiffTrajILDelay()

int setAxisMonVelDiffTrajILDelay ( int axisIndex,
int value )

Set trajectory interlock filter time in cycles for velocity difference monitoring.
.

Parameters
[in]axisIndexAxis index.
[in]valueTime in cycles.
Returns
0 if success or otherwise an error code.
Note
Example: Set filter time to 100 cycles for axis 2.
"Cfg.SetAxisMonVelDiffTrajILDelay(2,100)" //Command string to ecmcCmdParser.c.

◆ setAxisPLCEnable()

int setAxisPLCEnable ( int axisIndex,
int value )

Enable axis sync PLC expression.
.

The axis sync PLC expression for an axis can be enabled/disabled. see command setAxisPLCExpr() for more information.

Parameters
[in]axisIndexAxis index.
[in]valueEnable.
Returns
0 if success or otherwise an error code.
Note
Example: Disable command transformation expression axis 5.
"Cfg.SetAxisPLCEnable(5,0)" //Command string to ecmcCmdParser.c.

◆ setAxisPLCEncVelFilterEnable()

int setAxisPLCEncVelFilterEnable ( int axisIndex,
int enable )

Enables/disables velocity filter of external actual value.
.

NOTE: This filter is currentlly not used.

Parameters
[in]axisIndexAxis index.
[in]enableenable filter.
Returns
0 if success or otherwise an error code.
Note
Example: Enable velocity filter for external actual position for axis 5. "Cfg.SetAxisPLCEncVelFilterEnable(5,1)" //Command string to ecmcCmdParser.c.

◆ setAxisPLCEncVelFilterSize()

int setAxisPLCEncVelFilterSize ( int axisIndex,
int size )

Set size of external encoder velocity filter.
.

NOTE: This filter is currentlly not used.
Sets the size of the filter for velocity from "external" PLC code.

Parameters
[in]axisIndexAxis index.
[in]sizeSize of filter (default 100).
Returns
0 if success or otherwise an error code.
Note
Example: Set filter size to 10 for for axis 7.
"Cfg.SetAxisPLCEncVelFilterSize(7,10)" //Command string to ecmcCmdParser.c.

◆ setAxisPLCTrajVelFilterEnable()

int setAxisPLCTrajVelFilterEnable ( int axisIndex,
int enable )

Enables/disables velocity filter of external setpoint.
.

This filter is needed in order to have a smoth feedforward value when
reciving setpoints form an PLC. If filter is disabled the velocity will
be calculated based on the last two postion values recived from PLC. In many
cases this will result in a "unstable signal" depending onresoltions of the
values involved in the calculation. Using a filter will smoth the velocity
feed forward value and will thereby result in a smoother motion.

Note
: This filter is only enabled when the axis recives setpoin ts from an PLC.
Parameters
[in]axisIndexAxis index.
[in]enableenable filter.
Returns
0 if success or otherwise an error code.
Note
Example: Enable velocity filter for external setpoint position for axis 5. "Cfg.SetAxisPLCTrajVelFilterEnable(5,1) //Command string to ecmcCmdParser.c.

◆ setAxisPLCTrajVelFilterSize()

int setAxisPLCTrajVelFilterSize ( int axisIndex,
int size )

Set size of external trajectory velocity filter.
.

Sets the size of the filter for velocity from "external" PLC code.
This filter is needed in order to have a smoth feedforward value when
reciving setpoints form an PLC. If filter is disabled the velocity will
be calculated based on the last two postion values recived from PLC. In many
cases this will result in a "unstable signal" depending onresoltions of the
values involved in the calculation. Using a filter will smoth the velocity
feed forward value and will thereby rresult in a smoother motion.

Note
: This filter is only enabled when the axis recives setpoin ts from an PLC.
Parameters
[in]axisIndexAxis index.
[in]sizeSize of filter (default 100).
Returns
0 if success or otherwise an error code.
Note
Example: Set filter size to 10 for for axis 7.
"Cfg.SetAxisPLCTrajVelFilterSize(7,10)" //Command string to ecmcCmdParser.c.

◆ setAxisSeqTimeout()

int setAxisSeqTimeout ( int axisIndex,
int value )

Set sequence timeout time in seconds.
.

The motion sequences (mainly related to homing) can be aborted if not finalized within a certain time. This is to prevent that the motion control hangs in one sequence. This could happen if the reference switch for some reason is not encountered.

Parameters
[in]axisIndexAxis index.
[in]valueTimeout time.
Returns
0 if success or otherwise an error code.
Note
Example: Set sequence timeout value for axis 2 to 1 minute.
"Cfg.SetAxisSeqTimeout(2,60)" //Command string to ecmcCmdParser.c.

◆ setAxisSoftLimitPosBwd()

int setAxisSoftLimitPosBwd ( int axisIndex,
double value )

Set backward soft-limit position.
.

Parameters
[in]axisIndexAxis index.
[in]valueSoft-limit position.
Returns
0 if success or otherwise an error code.
Note
Example: Set backward soft-limit position to -100 for axis 3.
"ADSPORT=501/.ADR.16#5003,16#E,8,5=-100" //Command string to ecmcCmdParser.c.
Todo
"TwinCAT syntax. Needs to be changed.

◆ setAxisSoftLimitPosFwd()

int setAxisSoftLimitPosFwd ( int axisIndex,
double value )

Set forward soft-limit position.
.

Parameters
[in]axisIndexAxis index.
[in]valueSoft-limit position.
Returns
0 if success or otherwise an error code.
Note
Example: Set forward soft-limit position to 123 for axis 3.
"ADSPORT=501/.ADR.16#5003,16#E,8,5=123" //Command string to ecmcCmdParser.c.
Todo
"TwinCAT syntax. Needs to be changed.

◆ setAxisTargetPos()

int setAxisTargetPos ( int axisIndex,
double value )

Set axis target position setpoint.
.

The target position is the desired end setpoint of a motion.

Parameters
[in]axisIndexAxis index.
[in]valueTarget position setpoint.
Returns
0 if success or otherwise an error code.
Note
Example: Set target position setpoint for axis 3 to 111.
"Main.M3.fPosition=111" //Command string to ecmcCmdParser.c.
Todo
"TwinCAT syntax. Needs to be changed.

◆ setAxisTargetVel()

int setAxisTargetVel ( int axisIndex,
double value )

Set axis target velocity setpoint.
.

The target velocity is the desired velocity of a motion.
Note: The actual velocity can be higher than this setpoint.

Parameters
[in]axisIndexAxis index.
[in]valueTarget velocity setpoint.
Returns
0 if success or otherwise an error code.
Note
Example: Set target velocity setpoint for axis 3 to 55.
"Cfg.SetAxisVel(3,55)" //Command string to ecmcCmdParser.c.
Example: Set target velocity setpoint for axis 3 to 55 in
"TwinCAT" syntax.
"Main.M3.fVelocity=55" //Command string to ecmcCmdParser.c.
The "CfgSetAxisVelAccDecTime()" Command can be used to set
velocity, acceleration and decelartion simultaneously
Acceleration and deceleration are defined by time to reach target velocity
Syntax: "Cfg.SetAxisVelAccDecTime(axisIndex,targetVel,timeToVel)"
Example: Set target velocity setpoint for axis 3 to 55 and time to reach target velocity to 2s (acc and dec will be set to the same
value).
"Cfg.SetAxisVelAccDecTime(3,55,2)" //Command string to ecmcCmdParser.c.

◆ setAxisTrajSource()

int setAxisTrajSource ( int axisIndex,
int value )

Set axis trajectory data source.
.

An axis trajectory generator can get position setpoints from different sources:
source = 0 : Internal (normal trajectory generation).
source = 1 : External from transformation expression (synchronization).

Parameters
[in]axisIndexAxis index.
[in]valueSource type.
Returns
0 if success or otherwise an error code.
Note
Example: Set trajectory generator data source type for axis 3 to internal.
"Cfg.SetAxisTrajSourceType(3,0)" //Command string to ecmcCmdParser.c.

◆ setAxisTrajStartPos()

int setAxisTrajStartPos ( int axisIndex,
double value )

Set axis trajectory start position. NOTE: NOT USED!!.
.

Note
This function is not used currently.
Parameters
[in]axisIndexAxis index.
[in]valueStart position.
Returns
0 if success or otherwise an error code.
Note
Example: Set trajectory start position to 100 for axis 3.
"Cfg.SetAxisTrajStartPos(3,100)" //Command string to ecmcCmdParser.c.

◆ setDiagAxisEnable()

int setDiagAxisEnable ( int enable)

Enable detailed motion diagnostics printouts.
.

The detailed motion diagnostics prints valuable motion related information for one axis.
See setDiagAxisIndex() and setDiagAxisFreq() for more information.

Parameters
[in]enableEnable printouts.
Returns
0 if success or otherwise an error code.
Note
Example: Enable printout of detailed motion diagnostics.
"Cfg.SetDiagAxisEnable(1)" //Command string to ecmcCmdParser.c

◆ setDiagAxisFreq()

int setDiagAxisFreq ( int freq)

Set axis frequency of detailed motion diagnostics printouts.
.

Parameters
[in]freqPrintout frequency.
Returns
0 if success or otherwise an error code.
Note
Example: Set printout frequency to 10.
"Cfg.SetDiagAxisFreq(10)" //Command string to ecmcCmdParser.c

◆ setDiagAxisIndex()

int setDiagAxisIndex ( int axisIndex)

Set axis index for detailed motion diagnostics.
.

Parameters
[in]axisIndexIndex of axis.
Returns
0 if success or otherwise an error code.
Note
Example: Choose detailed motion diagnostics for axis 3.
"Cfg.SetDiagAxisIndex(3)" //Command string to ecmcCmdParser.c

◆ setPosition()

int setPosition ( int axisIndex,
double homePositionSet )

set position.
used by epics autosave to restore axis value after ioc reboot.

Parameters
[in]axisIndexAxis index.
[in]homePositionSetPosition to set at homing.
Returns
0 if success or otherwise an error code.

◆ stopMotion()

int stopMotion ( int axisIndex,
int killAmplifier )

Stop axis.
.

Parameters
[in]axisIndexAxis index.
[in]killAmplifierDisable amplifier.
Returns
0 if success or otherwise an error code.
Note
Example: Stop motion and kill amplifier of axis 2.
"StopMotion(2,1)" //Command string to ecmcCmdParser.c