FB_SoEReset
The functionblock FB_SoEReset can be used to execute a drive reset (S-0-0099). Drives with more than on channel may require a reset on all channels. The timeout time must be 10s, because the reset can take up to 10s.
For the AX5000 the flag "Wait For WcState is OK" in the Advanced EtherCAT Settings has to be active.
An NC-Reset is not executed.
If an NC-Reset is necessary it can be executed via the MC_Reset block from the TcMc.lib
VAR_INPUT
VAR_INPUT
sNetId : T_AmsNetId := '';
bExecute : BOOL;
tTimeout : TIME := DEFAULT_ADS_TIMEOUT;
END_VAR
sNetId: A string containing the AMS network identifier of the PC.
bExecute: The block is activated by a rising edge at this input.
tTimeout: Maximum time allowed for the execution of the function block.
VAR_IN_OUT
VAR_IN_OUT
Axis : NCTOPLC_AXLESTRUCT;(* reference to NC axis *)
END_VAR
Axis: Axis structure.
VAR_OUTPUT
VAR_OUTPUT
bBusy : BOOL;
bError : BOOL;
iAdsErrId : UINT;
iSercosErrId : UINT;
END_VAR
bBusy: This output is set when the function block is activated, and remains set until an acknowledgement is received.
bError: This output is set up after the bBusy output has been reset if there has been an error in transmission of the command.
iAdsErrId: Supplies the ADS error code associated with the most recently executed command if the bError output is set.
iSercosErrId: Supplies the Sercos error code associated with the most recently executed command if the bError output is set.
Sample
fbSoEReset : FB_SoEReset_ByDriveRef;
bSoEReset : BOOL;
(* NcAxis *)
stNcToPlc AT %I* : NCTOPLC_AXLESTRUCT;
IF bSoEReset THEN
fbSoEReset(
Axis := stNcToPlc,
bExecute := TRUE,
tTimeout := DEFAULT_ADS_TIMEOUT,
);
IF NOT fbSoEReset.bBusy THEN
fbSoEReset(Axis := stNcToPlc, bExecute := FALSE);
bSoEReset := FALSE;
END_IF
END_IF