MC_WriteBoolParameter (FB) ¶ FUNCTION_BLOCK MC_WriteBoolParameter MC_WriteBoolParameter writes the value of the SoftMotion parameter specified in ParameterNumber . The boolean variable Value contains the value for writing. InOut: Scope Name Type Comment Inout Axis AXIS_REF_SM3 Reference to axis Input Execute BOOL Rising edge: starts the execution of MC_WriteBoolParameter . ParameterNumber DINT You can find a description of the most used parameter numbers in AXIS_REF_SM3 . Negative values are fieldbus specific parameters. See SMC_ParameterNumber_CoE and SMC_ParameterNumber_SoE to translate fieldbus object identifiers to parameter numbers. Value BOOL Boolean value to be written. Output Done BOOL TRUE : Parameter has been written successfully. Busy BOOL TRUE : Execution of the function block has not been finished. Error BOOL TRUE : Error has occurred during execution. ErrorID SMC_ERROR Error identification
MC_WriteParameter (FB) ¶ FUNCTION_BLOCK MC_WriteParameter MC_WriteParameter writes the value of the SoftMotion parameter specified in ParameterNumber . InOut: Scope Name Type Comment Inout Axis AXIS_REF_SM3 Reference to axis Input Execute BOOL Rising edge: starts the execution of MC_WriteParameter . ParameterNumber DINT You can find a description of the most used parameter numbers in AXIS_REF_SM3 . Negative values are fieldbus specific parameters. See SMC_ParameterNumber_CoE and SMC_ParameterNumber_SoE to translate fieldbus object identifiers to parameter numbers. Value LREAL Output Done BOOL TRUE : Parameter has been written successfully. Busy BOOL TRUE : Execution of the function block has not been finished. Error BOOL TRUE : Error has occurred during execution. ErrorID SMC_ERROR Error identification
SMC_ParameterNumber_CoE (FUN) ¶ FUNCTION SMC_ParameterNumber_CoE : DINT This function translates from a CANopen object index/subindex pair to a SoftMotion parameter number that can be used with function blocks like MC_ReadParameter , MC_ReadBoolParameter , MC_WriteParameter , and MC_WriteBoolParameter . InOut: Scope Name Type Comment Input index UINT The object index, e.g. 16#6061 subIndex USINT The object subindex, e.g. 0 dataLength USINT The data length in bytes (1, 2, or 4). Only used when writing a parameter. Return SMC_ParameterNumber_CoE DINT
SMC_ParameterNumber_SoE (FUN) ¶ FUNCTION SMC_ParameterNumber_SoE : DINT This function translates from a SoE (servodrive over EtherCAT) object (IDN + element) to a SoftMotion parameter number that can be used with function blocks like MC_ReadParameter , MC_ReadBoolParameter , MC_WriteParameter , and MC_WriteBoolParameter . InOut: Scope Name Type Comment Input IDN UINT The IDN element USINT 2: Name, 3: Attribute, 4: Unit, 5: Minimum, 6: Maximum, 0 or 7: Value dataLength USINT The data length in bytes (1, 2, or 4). Only used when writing a parameter. Return SMC_ParameterNumber_SoE DINT
FBError ¶ SMC_ClearFBError (Function) SMC_ReadFBError (FunctionBlock)
MC_ReadActualPosition (FB) ¶ FUNCTION_BLOCK MC_ReadActualPosition This function block returns the current position of the referenced axis. InOut: Scope Name Type Initial Comment Inout Axis AXIS_REF_SM3 Reference to axis Input Enable BOOL FALSE While TRUE , the output value provides the parameter value continuously for reading out. Output Valid BOOL FALSE TRUE : Valid outputs are available. Busy BOOL FALSE TRUE : Execution of the function block has not been finished yet. Error BOOL FALSE TRUE : Error has occurred within the function block. ErrorID SMC_ERROR 0 Error identification Position LREAL 0 New absolute position (in axis unit [u])
MC_ReadActualTorque (FB) ¶ FUNCTION_BLOCK MC_ReadActualTorque As long as Enable remains TRUE , the function block will return the value of the current torque or force. Valid will be set to TRUE , as soon as data output Torque becomes valid. If Enable is reset, the data will loose its validity and Valid will also be reset regardless of new data available. InOut: Scope Name Type Initial Comment Inout Axis AXIS_REF_SM3 Reference to axis Input Enable BOOL FALSE While TRUE , the parameter values are read out continuously. Output Valid BOOL FALSE TRUE : Valid outputs are available. Busy BOOL FALSE TRUE : Execution of function block has not been finished yet. Error BOOL FALSE TRUE : Error has occurred within the function block. ErrorID SMC_ERROR 0 Error identification Torque LREAL 0 Value of current torque (in Nm) or force
MC_ReadActualVelocity (FB) ¶ FUNCTION_BLOCK MC_ReadActualVelocity As long as Enable** remains ``TRUE , the function block will return the value of the current velocity. Valid will be set to TRUE , as soon as data output Velocity becomes valid. If Enable is reset, the data will loose its validity and Valid will also be reset regardless of new data available. InOut: Scope Name Type Initial Comment Inout Axis AXIS_REF_SM3 Reference to axis Input Enable BOOL FALSE While TRUE , the parameter values are read out continuously. Output Valid BOOL FALSE TRUE : Valid outputs are available. Busy BOOL FALSE TRUE : Execution of function block has not been finished yet. Error BOOL FALSE TRUE : Error has occurred within the function block. ErrorID SMC_ERROR 0 Error identification Velocity LREAL 0 Value of current velocity (in axis’ unit [u/s])
MC_ReadAxisError (FB) ¶ FUNCTION_BLOCK MC_ReadAxisError This function block reads general axis errors reported by the drive. Additionally it returns information about the software limit switches. It does not return: Errors detected by AXIS_REF_SM3 such as software position lag errors. These errors can be checked with MC_ReadStatus , output ErrorStop . Errors related to specific function blocks. These are reported by the Error / ErrorID outputs of the respective function block. InOut: Scope Name Type Comment Inout Axis AXIS_REF_SM3 Reference to the axis Input Enable BOOL While TRUE , the output value updates the parameter value continuously. Output Valid BOOL TRUE : Valid outputs are available. Busy BOOL TRUE : Execution of the function block has not finished yet. Error BOOL TRUE : An error has occurred within the function block. ErrorID SMC_ERROR Error identification AxisError BOOL TRUE : An axis error has occured. This is the value of parameter 1030. AxisErrorID DWORD Drive specific identification of the axis error. This is the value of parameter 1031. SWEndSwitchActive BOOL TRUE : Software limits are exceeded. Only TRUE while the axis is in state errorstop . Reset as soon as the limit switch error has been acknowledged using MC_Reset .
MC_ReadStatus (FB) ¶ FUNCTION_BLOCK MC_ReadStatus This function block returns the detailed status of the axis with respect to the motion currently in progress. InOut: Scope Name Type Initial Comment Inout Axis AXIS_REF_SM3 Reference to axis Input Enable BOOL FALSE TRUE : While TRUE , the parameter values are read out continuously. Output Valid BOOL FALSE TRUE : Valid outputs are available. Busy BOOL FALSE TRUE : Execution of the function block is not finished. Error BOOL FALSE TRUE : Error has occurred within the function block. ErrorID SMC_ERROR 0 Error identification Disabled BOOL FALSE TRUE : Axis is in state disabled (see SMC_AXIS_STATE ). Errorstop BOOL FALSE TRUE : Axis is in state errorstop (see SMC_AXIS_STATE ). Stopping BOOL FALSE TRUE : Axis is in state stopping (see SMC_AXIS_STATE ). StandStill BOOL FALSE TRUE : Axis is in state standstill (see SMC_AXIS_STATE ). DiscreteMotion BOOL FALSE TRUE : Axis is in state discrete_motion (see SMC_AXIS_STATE ). ContinuousMotion BOOL FALSE TRUE : Axis is in state continuous_motion (see SMC_AXIS_STATE ). SynchronizedMotion BOOL FALSE TRUE : Axis is in state synchronized_motion (see SMC_AXIS_STATE ). Homing BOOL FALSE TRUE : Axis is in state homing (see SMC_AXIS_STATE ). ConstantVelocity BOOL FALSE TRUE : Motor moves with constant velocity. Accelerating BOOL FALSE TRUE : Energy of motor increases. Decelerating BOOL FALSE TRUE : Energy of motor decreases. FBErrorOccured BOOL FALSE TRUE : Function block error has occured. It has not yet been cleared with SMC_ClearFBError .