FB_SoEAX5000SetMotorCtrlWord
With the function block FB_SoEAX5000SetMotorCtrlWord the ForceLock bit (Bit 0) or the ForceUnlock bit can be set in the Motor Control Word (P-0-0096) to activate or release the brake. Normally the brake is automatically controlled via the Enable of the drive.
With the ForceLock bit, the brake can be activated independently from the Enable, with the ForceUnlock bit, the brake can be released independently from the Enable. In the case of simultaneously set ForceLock and ForceUnlock, ForceLock (Brake activated) has the higher priority.
Inputs
VAR_INPUT
NetId : T_AmsNetId := '';
Execute : BOOL;
Timeout : TIME := DEFAULT_ADS_TIMEOUT;
ForceLock : BOOL;
ForceUnlock : BOOL;
END_VAR
Name | Type | Description |
---|---|---|
NetId | T_AmsNetID | String containing the AMS network ID of the PC. |
Execute | BOOL | The function block is enabled via a positive edge at this input. |
Timeout | TIME | Maximum time allowed for the execution of the function block. |
ForceLock | BOOL | Activates the brake independently of the enable. |
ForceUnlock | BOOL | Releases the brake independently of the enable. |
Inputs/outputs
VAR_IN_OUT
Axis : AXIS_REF;
END_VAR
Name | Type | Description |
---|---|---|
Axis | Axis data structure that unambiguously addresses an axis in the system. Among other parameters it contains the current axis status, including position, velocity or error state. |
Outputs
VAR_OUTPUT
Busy : BOOL;
Error : BOOL;
AdsErrId : UINT;
SercosErrId : UINT;
END_VAR
Name | Type | Description |
---|---|---|
Busy | BOOL | This output is set when the function block is activated, and remains set until a feedback is received. |
Error | BOOL | This output is set after the Busy output has been reset when an error occurs in the transmission of the command. |
AdsErrId | UINT | In the case of a set Error output returns the ADS error code of the last executed command. |
SercosErrId | UINT | In the case of a set Error output returns the Sercos error of the last executed command. |
Sample
fbSetMotorCtrlWord : FB_SoEAX5000SetMotorCtrlWord;
SetMotorCtrlWord : BOOL;
ForceLock : BOOL;
ForceUnlock : BOOL;
(* NcAxis *)
Axis : AXIS_REF;
IF SetMotorCtrlWord THEN
fbSetMotorCtrlWord(
Axis := Axis,
Execute := TRUE,
Timeout := DEFAULT_ADS_TIMEOUT,
ForceLock := ForceLock,
ForceUnlock := ForceUnlock
);
IF NOT fbSetMotorCtrlWord.Busy THEN
fbSetMotorCtrlWord(Axis := Axis, Execute := FALSE);
SetMotorCtrlWord := FALSE;
END_IF
END_IF
Requirements
Development environment | Target platform type | PLC library | AX5000 Firmware |
---|---|---|---|
TwinCAT 3 | PC or CX (x86 or x64) | Tc2_MC2_Drive | ≥v1.07 b0001 |