IsCurrentTask (FUN) ¶ FUNCTION IsCurrentTask : BOOL Checks whether hTask is the current task. Always returns TRUE if hTask = RTS_INVALID_HANDLE or the compiler define SM3_DISABLE_TASK_CHECKS is set. InOut: Scope Name Type Input hTask SysTypes.RTS_IEC_HANDLE Return IsCurrentTask BOOL
File and Project Information ¶ Scope Name Type Content FileHeader creationDateTime date 26.07.2024, 11:48:59 companyName string 3S-Smart Software Solutions GmbH libraryFile SM3_Shared.library primaryProject True productName CODESYS productProfile CODESYS V3.5 SP16 Patch 3 contentFile SM3_Shared.clean.json version version 2.0.0.0 ProjectInformation IsEndUserLibrary bool False Released True LastModificationDateTime date 26.07.2024, 11:48:57 LibraryCategories library-category-list Intern|SoftMotion Author string CODESYS Development GmbH Company CODESYS CompiledLibraryCompatibilityVersion CODESYS V3.5 SP15 DefaultNamespace SM0 Description See: Description LanguageModelAttribute qualified-access-only Placeholder SM3_Shared Project SM3_Shared Title SM3_Shared Version version 4.17.0.0
Library Reference ¶ This is a dictionary of all referenced libraries and their name spaces. CmpErrors2 Interfaces ¶ Library Identification ¶ Name: CmpErrors2 Interfaces Version: newest Company: System Namespace: CmpErrors Library Properties ¶ LinkAllContent: False Optional: False QualifiedOnly: False SystemLibrary: False Key: CmpErrors2 Interfaces, * (System) CmpIecTask ¶ Library Identification ¶ Placeholder: CmpIecTask Default Resolution: CmpIecTask, * (System) Namespace: CmpIecTask Library Properties ¶ LinkAllContent: False Optional: False QualifiedOnly: True SystemLibrary: False Key: CmpIecTask CmpLog ¶ Library Identification ¶ Placeholder: CmpLog Default Resolution: CmpLog, * (System) Namespace: CmpLog Library Properties ¶ LinkAllContent: False Optional: False QualifiedOnly: True SystemLibrary: False Key: CmpLog FloatingPointUtils ¶ Library Identification ¶ Placeholder: FloatingPointUtils Default Resolution: FloatingPointUtils, * (System) Namespace: FPU Library Properties ¶ LinkAllContent: False Optional: False QualifiedOnly: True SystemLibrary: False Key: FloatingPointUtils IoStandard ¶ Library Identification ¶ Placeholder: IoStandard Default Resolution: IoStandard, * (System) Namespace: IoStandard Library Properties ¶ LinkAllContent: False Optional: False QualifiedOnly: False SystemLibrary: False Key: IoStandard SM3_CommonPublic ¶ Library Identification ¶ Placeholder: SM3_CommonPublic Default Resolution: SM3_CommonPublic, * (CODESYS) Namespace: SM3_Common Library Properties ¶ LinkAllContent: False Optional: False QualifiedOnly: True SystemLibrary: False Key: SM3_CommonPublic SM3_Error ¶ Library Identification ¶ Placeholder: SM3_Error Default Resolution: SM3_Error, * (CODESYS) Namespace: SM3_Error Library Properties ¶ LinkAllContent: False Optional: False QualifiedOnly: True SystemLibrary: False Key: SM3_Error Standard ¶ Library Identification ¶ Placeholder: Standard Default Resolution: Standard, * (System) Namespace: Standard Library Properties ¶ LinkAllContent: False Optional: False QualifiedOnly: False SystemLibrary: False Key: Standard SysDir ¶ Library Identification ¶ Placeholder: SysDir Default Resolution: SysDir, * (System) Namespace: SysDir Library Properties ¶ LinkAllContent: False Optional: False QualifiedOnly: True SystemLibrary: False Key: SysDir SysFile ¶ Library Identification ¶ Placeholder: SysFile Default Resolution: SysFile, * (System) Namespace: SysFile Library Properties ¶ LinkAllContent: False Optional: False QualifiedOnly: True SystemLibrary: False Key: SysFile SysMem23 ¶ Library Identification ¶ Placeholder: SysMem Default Resolution: SysMem23, * (System) Namespace: SysMem Library Properties ¶ LinkAllContent: False Optional: False QualifiedOnly: True SystemLibrary: False Key: SysMem SysTypes2 Interfaces ¶ Library Identification ¶ Name: SysTypes2 Interfaces Version: newest Company: System Namespace: SysTypes Library Properties ¶ LinkAllContent: False Optional: False QualifiedOnly: False SystemLibrary: False Key: SysTypes2 Interfaces, * (System)
MC_Halt_SML (FB) ¶ FUNCTION_BLOCK FINAL MC_Halt_SML Commands a controlled motion stop. The axis is moved to the state DiscreteMotion , until the velocity is zero. When the output Done is set, the state is transferred to Standstill . Note MC_Halt_SML is used to stop the axis under normal operation conditions. It is possible to start another motion command during deceleration of the axis, which will abort MC_Halt_SML and will be executed immediately. The example below shows the behavior in combination with MC_MoveVelocity_SML . A rotating axis is ramped down with Function Block MC_Halt_SML Another motion command overrides the MC_Halt_SML command. MC_Halt_SML allows this, in contrast to MC_Stop_SML . The axis can accelerate again without reaching Standstill . InOut: Scope Name Type Comment Inout Axis Axis_REF_SML Reference to the axis Input Execute BOOL Rising edeg: The halt is started Deceleration LREAL Value of the deceleration (decreasing energy of the motor) [u/s²] Output Done BOOL Becomes true as soon as the axis has reached velocity zero Busy BOOL TRUE as long as MC_Halt_SML is operating, reset when velocity is zero CommandAborted BOOL Commanded motion was interrupted by any motion FB acting on the same axis Error BOOL Signals that an error has occured ErrorID SML_ERROR Error number
MC_Home_SML (FB) ¶ FUNCTION_BLOCK FINAL MC_Home_SML Commands the axis to perform the «search home» sequence. The details of this sequence are manufacturer specific and can be set by the axis’ parameters. The ‘Position’ input is used to set the absolute position when the reference signal is detected. After completion, the axis state is Standstill if it was Standstill when started. InOut: Scope Name Type Comment Inout Axis Axis_REF_SML Reference to the axis Input Execute BOOL Rising edge: The homing is started Position LREAL Absolute position when the reference signal is detected (in technical units [u]) Output Done BOOL Reference known and set successfully Busy BOOL Homing is not finished and new output values are to be expected CommandAborted BOOL Homing was aborted by a motion command acting on the same axis Error BOOL Signals that an error has occured ErrorID SML_ERROR Error number
MC_MoveAbsolute_SML (FB) ¶ FUNCTION_BLOCK FINAL MC_MoveAbsolute_SML Commands a controlled motion to a specified absolute position. Note The motion completes with velocity zero. For modulo axes, it is drive dependent which modulo period is selected for the final position. The following figure shows two examples of the combination of two instances of MC_MoveAbsolute_SML : The left part of the timing diagram illustrates the case if the second FB is called after the first one. If the first reaches the commanded position of 6000 (and the velocity is 0), then the output Done causes the second FB to move to position 10000. The right part of the timing diagram illustrates the case if the second FB starts the execution while the first FB is still executing. In this case the first motion is interrupted and aborted by the Test signal during the constant velocity phase of the first FB. The second FB moves directly to position 10000, although the position of 6000 is not reached yet. InOut: Scope Name Type Comment Inout Axis Axis_REF_SML Reference to the axis Input Execute BOOL Rising edge: The motion is started Position LREAL Commanded position for the motion (may be negative) (in technical units [u]) Velocity LREAL Value of the maximum velocity (always positive) (not necessarily reached) [u/s] Acceleration LREAL Value of the acceleration (always positive) (increasing energy of the motor) [u/s²] Deceleration LREAL Value of the deceleration (always positive) (decreasing energy of the motor) [u/s²] Output Done BOOL Commanded position reached Busy BOOL The motion is not finished and new output values are to be expected CommandAborted BOOL The motion was interrupted by a motion command acting on the same axis Error BOOL Signals that an error has occured ErrorID SML_ERROR Error number
MC_MoveRelative_SML (FB) ¶ FUNCTION_BLOCK FINAL MC_MoveRelative_SML Commands a controlled motion of a specified distance relative to the position at the time of the execution. Note The motion completes with velocity zero. The following figure shows the example of the combination of two instances of MC_MoveRelative_SML : The left part of the timing diagram illustrates the case if the second FB is called after the first one. If first reaches the commanded distance 6000 (and the velocity is 0), then the output Done causes the second FB to move the commanded distance 4000 to the resulting absolute position 10000. The right part of the timing diagram illustrates the case if the second FB starts the execution while the first FB is still executing. In this case, the first motion is interrupted and aborted by the Test signal during the constant velocity phase of the first FB. The second FB adds the distance 4000 to the actual position of 3250 to the resulting absolute position of 7250. InOut: Scope Name Type Comment Inout Axis Axis_REF_SML Reference to the axis Input Execute BOOL Rising edge: The motion is started Distance LREAL Relative distancefor the motion (in technical units [u]) Velocity LREAL Value of the maximum velocity (always positive) (not necessarily reached) [u/s] Acceleration LREAL Value of the acceleration (always positive) (increasing energy of the motor) [u/s²] Deceleration LREAL Value of the deceleration (always positive) (decreasing energy of the motor) [u/s²] Output Done BOOL Commanded distance reached Busy BOOL The motion is not finished and new output values are to be expected CommandAborted BOOL The motion was interrupted by a motion command acting on the same axis Error BOOL Signals that an error has occured ErrorID SML_ERROR Error number
MC_MoveVelocity_SML (FB) ¶ FUNCTION_BLOCK FINAL MC_MoveVelocity_SML Commands a never ending controlled motion with a specified velocity. Note To stop the motion, the motion has to be interrupted by another motion command. The output InVelocity is reset when the block is aborted by another block. The following figure shows two examples of the combination of two instances of MC_MoveVelocity_SML : The left part of the timing diagram illustrates the case if the second FB is started after the first one has reached the commanded velocity. The right part of the timing diagram illustrates the case if the second FB is started before the first FB has reached the commanded velocity. InOut: Scope Name Type Comment Inout Axis Axis_REF_SML Reference to the axis Input Execute BOOL Rising Edge: The motion is started Velocity LREAL Value of the commanded velocity (may be negative) (not necessarily reached) [u/s] Acceleration LREAL Value of the acceleration (always positive) (increasing energy of the motor) [u/s²] Deceleration LREAL Value of the deceleration (always positive) (decreasing energy of the motor) [u/s²] Output InVelocity BOOL Commanded velocity reached Busy BOOL The motion is not finished and new output values are to be expected CommandAborted BOOL The motion was interrupted by a motion command acting on the same axis Error BOOL Signals that an error has occured ErrorID SML_ERROR Error number
MC_Power_SML (FB) ¶ FUNCTION_BLOCK FINAL MC_Power_SML Controls the power stage of an axis and can be used to issue a quick stop. Note The inputs are only processed if Enable is set. A call of MC_Power_SML with bRegulatorOn=FALSE sets the axis state to PowerOff (disabled). A call of MC_Power_SML with bRegulatorOn``=``TRUE on a disabled axis sets the axis state to Standstill , if there is no error on the axis. If an error is detected, the state of the axis is set to ErrorStop . If the inputs Enable , bRegulatorOn and bDriveStart are ``TRUE but the output Status remains in FALSE for a long time, there may be a problem with the power stage, or an external halt may be set. If power fails (also during operation), the axis state is set to ErrorStop . InOut: Scope Name Type Comment Inout Axis Axis_REF_SML Reference to the axis Input Enable BOOL Enables the function block bRegulatorOn BOOL Enables the power stage bDriveStart BOOL Disables the quickstop mechanism Output Status BOOL Axis ready for motion bRegulatorRealState BOOL Effective state of the power stage bDriveStartRealState BOOL Effective state of the quickstop mechanism Busy BOOL Function block is executing Error BOOL Signals that an error has occured ErrorID SML_ERROR Error number
MC_ReadBoolParameter_SML (FB) ¶ FUNCTION_BLOCK FINAL MC_ReadBoolParameter_SML Reads the value of a boolean SoftMotion or axis specific parameter. For the list of all SoftMotion parameter numbers see Axis_REF_SML . See MC_ReadParameter_SML (FB) for a description of axis specific parameters. Note If the parameter is not of type BOOL , the returned value is undefined. InOut: Scope Name Type Comment Inout Axis AXIS_REF_SML Reference to the axis Input Enable BOOL Get value is updated continuously while enabled ParameterNumber DINT Number of the parameter Output Value BOOL The value of the parameter Valid BOOL The value is valid Busy BOOL The FB is not finished and new output values are to be expected Error BOOL An error occurred ErrorID SML_ERROR The error number