MC_CamOut (FB) ¶ FUNCTION_BLOCK MC_CamOut This function block disengages the slave axis from the master axis immediately. Note It is assumed that this command is followed by another command, as for instance MC_Stop , MC_GearIn . If there is no further command following, the default condition should be: maintain last velocity. InOut: Scope Name Type Initial Comment Inout Slave AXIS_REF_SM3 Reference to slave axis Input Execute BOOL FALSE Rising edge: Starts the execution of the function block. Output Done BOOL FALSE TRUE : Cam has been disengaged. Busy BOOL FALSE TRUE : Execution of function block has not been finished. Error BOOL FALSE TRUE : Error has occurred within the function block. ErrorID SMC_ERROR 0 Error identification
MC_GearIn (FB) ¶ FUNCTION_BLOCK MC_GearIn The function block couples the slave axis to the master axis, and applies a certain velocity ratio between master and slave. When MC_GearIn is started, the slave axis is ramped up to the given ratio of the master velocity. Coupling takes place once this is achieved. The distance travelled during the coupling is not compensated for. Note MC_GearIn should be called after the motion FB controlling the Master axis has been called. Otherwise, the Slave axis will lag behind the Master axis. While MC_GearIn is in operation, the velocity ratio can be changed by sequential MC_GearIn commands. To do this, no preceding call of MC_GearOut is necessary. InGear is set as soon as the desired velocity ratio is reached. Once InGear is set, the type of coupling depends on the current control mode. In the standard case, i.e. in the position control mode, the coupling is performed with the position values. For example, with a ratio of 1:2, the slave is moved by exactly half the distance of the master. If velocity control mode is used, then the coupling is performed with the velocity values. For example, with a ratio of 1:2, the slave will move with half the master velocity in each cycle. Ratio Reached : Velocity ratio has been reached. InOut: Scope Name Type Initial Comment Inout Master AXIS_REF_SM3 Reference to master axis. Master needs not to be stationary. Slave AXIS_REF_SM3 Reference to slave axis Input Execute BOOL Rising edge: Starts the execution of the function block. RatioNumerator DINT 1 Numerator of the quotient for the desired velocity ratio RatioDenominator UDINT 1 Denominator of the quotient for the desired velocity ratio Acceleration LREAL Maximum acceleration for ramping up in [u/s²] Deceleration LREAL Maximum deceleration for ramping up in [u/s²] Jerk LREAL Maximum jerk for ramping up in [u/s³] BufferMode MC_BUFFER_MODE Defines the chronological sequence of the FB relative to the previous block. Only the BufferModes Aborting , Buffered and BlendingPrevious are supported. BlendingPrevious means that the configured velocity (including the direction) of the previous movement is used as the blending velocity, even if this movement has the opposite direction. If the function block is Busy, then only BufferMode=Aborting is allowed. Output InGear BOOL TRUE : Coupling has taken place. The slave moves with the given velocity ratio of the master. Busy BOOL TRUE : Function block is in operation. Active BOOL Indicates that the FB has control on the axis CommandAborted BOOL FALSE TRUE : Execution has been interrupted by another function block instance operating on the axis. Error BOOL TRUE : Error has occurred. ErrorID SMC_ERROR Error identification
MC_GearInPos (FB) ¶ FUNCTION_BLOCK MC_GearInPos MC_GearInPos couples the slave axis to the master axis taking into account a specific positional relationship. Important In certain cases, it may be impossible to avoid a reversal of the slave. (Even if the slave velocity is not opposite to the master.) One example is a slave with a small positive velocity and a large negative acceleration. It may not be possible to ramp down the acceleration fast enough to prevent the velocity from becoming negative. Note MC_GearInPos should be called after the motion FB controlling the Master axis has been called. Otherwise, the Slave axis will lag behind the Master axis. Timing diagram With BufferMode Aborting, any previous motion is continued until the master crosses the position MasterSyncPosition – MasterStartDistance in the correct direction. At that point in time the output StartSync is set. When a stop command is executed on the slave axis before the synchronization has happened, it will inhibit the synchronization and the function block issues CommandAborted = TRUE . If the MasterStartDistance is not specified (indicated by a non-positive value), the function block calculates the setting start distancepoint so that synchronization starts at the current master position. With BufferMode Buffered or BlendingPrevious, the input MasterStartDistance cannot be provided (i.e. must be set to 0). The reason for this is that as soon as the previous movement finished, MC_GearInPos must take over the axis and continue the movement, it cannot wait until the master sync position has been reached. (If the master is in standstill when the previous movement is finished, then an error SMC_GIP_CANNOT_START_SYNC is reported.) Timing Diagram of MC_GearInPos ¶ Different examples of gearing ¶ InOut: Scope Name Type Initial Comment Inout Master AXIS_REF_SM3 Reference to master axis Slave AXIS_REF_SM3 Reference to slave axis Input Execute BOOL Rising edge: Starts the execution of the function block. RatioNumerator DINT 1 Gear ratio numerator RatioDenominator DINT 1 Gear ratio denominator MasterSyncPosition LREAL Master position where the axes run in sync. SlaveSyncPosition LREAL Slave position where the axes run in sync. MasterStartDistance LREAL Master distance for the gear in procedure (where the slave axis will be started for getting into synchronization). In other words, the slave is brought into sync with the master during this distance, i.e. from MasterSyncPosition - MasterStartDistance until MasterSyncPosition . If MasterStartDistance is 0 (or negative), then the slave movement is started immediately, provided that the master is not in standstill. If BufferMode <> Aborting, then the MasterStartDistance must be 0 (or negative). BufferMode MC_BUFFER_MODE Defines the chronological sequence of the FB relative to the previous block. Only the BufferModes Aborting , Buffered and BlendingPrevious are supported. BlendingPrevious means that the configured velocity (including the direction) of the previous movement is used as the blending velocity, even if this movement has the opposite direction. If the function block is Busy, then only BufferMode=Aborting is allowed. AvoidReversal BOOL FALSE : Signals that the reversal of the slave is physically possible and acceptable. TRUE : Signals that a reversal of the modulo slave has to be avoided, e.g. because it is physically impossible or might lead to damage. It works only with modulo slave axes. If a reversal cannot be avoided, the axis is stopped with an error. Behavior: If the slave axis is a modulo axis and the master velocity (times the sign of the gear ratio) is not opposite to the slave velocity , then MC_GearInPos tries to avoid a reversal of the slave. It tries to “stretch” the slave movement by increasing the distance the slave travels by up to 5 slave periods. If this “stretching” is not successful, an error is reported. If the slave velocity is opposite to the master velocity times the sign of the gear ratio, an error is reported. If the slave axis is not a modulo axis, an error is reported on the rising edge of the Execute input. Output StartSync BOOL TRUE : Commanded gearing has been started. InSync BOOL TRUE : Cmmanded gearing has been completed. Busy BOOL TRUE : Execution of the function block has not been finished. Active BOOL Indicates that the FB has control on the axis CommandAborted BOOL FALSE TRUE : Execution has been interrupted by another function block instance operating on the axis. Error BOOL TRUE : Error has occurred within the function block. ErrorID SMC_ERROR Error identification
MC_GearOut (FB) ¶ FUNCTION_BLOCK MC_GearOut This function block disengages the slave axis from the master axis. Note It is assumed that this command is followed by another command, as for instance MC_Stop , MC_GearIn . If no further command follows, the default condition is: maintain last velocity. InOut: Scope Name Type Comment Inout Slave AXIS_REF_SM3 Reference to slave axis Input Execute BOOL Rising edge: Starts the execution of the function block. Output Done BOOL TRUE : Cam has been disengaged. Busy BOOL TRUE : Execution of the function block has not been finished. Error BOOL TRUE : Error has occurred within the function block. ErrorID SMC_ERROR Error identification
MC_Phasing (FB) ¶ FUNCTION_BLOCK MC_Phasing MC_Phasing provides a constant phase shift between master and slave axis. MC_Phasing will abort any ongoing movement of the slave axis. In this respect, it differs from the function blocks MC_PhasingAbsolute and MC_PhasingRelative defined by the PLCopen for Motion Control 2.0 standard. These function blocks don’t abort an ongoing slave movement but superimpose the phase shift on top of e.g. an ongoing MC_CamIn or MC_GearIn movement. To achieve this behavior with MC_Phasing , please use an additional virtual axis as the slave axis of MC_Phasing and use this virtual slave as the master for MC_CamIn or MC_GearIn . Alternatively, MC_MoveSuperimposed can be used on the master axis of an MC_CamIn or MC_GearIn movement. Important Phase , Velocity , Acceleration and Deceleration of a phase shift are controlled by the function block. Note MC_Phasing should be called after the motion FB controlling the Master axis has been called. Otherwise, the Slave axis will lag behind the Master axis. Timing example of MC_Phasing Timing of MC_Phasing ¶ Example demonstrating the effect of MC_Phasing Demonstrating the effect of MC_Phasing ¶ InOut: Scope Name Type Initial Comment Inout Master AXIS_REF_SM3 Reference to master axis Slave AXIS_REF_SM3 Reference to slave axis Input Execute BOOL FALSE Rising edge: Starts the execution of the function block. PhaseShift LREAL 0 Phase difference between master and slave (slave - master) [u] Velocity LREAL 0 Maximum velocity for reaching phase difference [u/s] Acceleration LREAL 0 Maximum acceleration for reaching phase difference [u/s²] Deceleration LREAL 0 Maximum deceleration for reaching phase difference [u/s²] Jerk LREAL maximum jerk to reach phase difference [u/s^3] Output Done BOOL FALSE TRUE : Commanded phasing has been reached. Busy BOOL FALSE TRUE : Execution of the function block has not been finished. CommandAborted BOOL FALSE TRUE : Command has been aborted by another command. Error BOOL FALSE TRUE : Error has occurred within the function block. ErrorID SMC_ERROR 0 Error identification
SMC_CamIn_EvalCam_EvalContext (STRUCT) ¶ TYPE SMC_CamIn_EvalCam_EvalContext : STRUCT InOut: Name Type endOfProfileSlaveAxisPos LREAL SlaveOffset LREAL EndOfProfile BOOL OldEndOfProfile BOOL endOfProfileCycle SMC_CycleCounter evalCamCtx SMC_EvalCam_EvalContext moduloHandlingCtx SMC_CamIn_ModuloHandling_EvalContext dynMasterCam SMC_TG_DynState
SMC_PerfStat (FB) ¶ FUNCTION_BLOCK SMC_PerfStat Computes basic statistics of the performance timers InOut: Scope Name Type Input bEnable BOOL Inout Const timers SMC_PerfTimers Output statBI SMC_SeriesStats statAI SMC_SeriesStats statBO SMC_SeriesStats statAO SMC_SeriesStats statAll SMC_SeriesStats
SMC_PerfTimerSum (FUN) ¶ FUNCTION SMC_PerfTimerSum : SMC_PerfTimers Returns the sum of two performance timers InOut: Scope Name Type Inout Const t1 SMC_PerfTimers t2 SMC_PerfTimers Return SMC_PerfTimerSum SMC_PerfTimers
SMC_SeriesStat (FB) ¶ FUNCTION_BLOCK SMC_SeriesStat Computes basic statistics of a series of values in an incremental way (value by value) InOut: Scope Name Type Input bEnable BOOL fCurValue LREAL Inout stats SMC_SeriesStats
SMC_AxisDiagnosticLog.WriteToFile (ACT) ¶ moved the open to the beginning. Otherwise only cycle loss until data is written and the first buffer is mixed