FB_SoEReset

FB_SoEReset 1:

The drive (S-0-0099) can be reset with the function block FB_SoEReset. In the case of multiple-channel devices if necessary, both channels will have to perform a reset. The timeout time must be 10 s, as the reset can take up to 10 s depending on the error. The flag "Wait For WcState is OK" must be enabled in the advanced EtherCAT settings for the AX5000.

FB_SoEReset 2:

An NC reset will not be performed. If an NC reset is necessary, it can be executed via the function block MC_Reset from the Tc2_MC2 PLC library.

FB_SoEReset 3: Inputs

VAR_INPUT
    sNetId   : T_AmsNetId := '';
    bExecute : BOOL;
    tTimeout : TIME := DEFAULT_ADS_TIMEOUT;
END_VAR

Name

Type

Description

sNetId

T_AmsNetId

String, which contains the AMS Network ID of the PC (type: T_AmsNetId).

bExecute

BOOL

The function block is enabled via a positive edge at this input.

tTimeout

TIME

Maximum time allowed for the execution of the function block.

FB_SoEReset 4: Inputs/outputs

VAR_IN_OUT
    Axis : NCTOPLC_AXIS_REF;(* reference to NC axis *)
END_VAR

Name

Type

Description

Axis

NCTOPLC_AXIS_REF

Axis data structure of the type NCTOPLC_AXIS_REF

FB_SoEReset 5: Outputs

VAR_OUTPUT
    bBusy        : BOOL;
    bError       : BOOL;
    iAdsErrId    : UINT;
    iSercosErrId : UINT;
END_VAR

Name

Type

Description

bBusy

BOOL

This output is set when the function block is activated, and remains set until a feedback is received.

bError

BOOL

This output is set after the bBusy output has been reset when an error occurs in the transmission of the command.

iAdsErrId

UINT

Returns the ADS error code of the last executed command when the bError output is set.

iSercosErrId

UINT

In the case of a set bError output returns the Sercos error of the last executed command.

Sample

fbSoEReset : FB_SoEReset_ByDriveRef;
bSoEReset : BOOL;
(* NcAxis *)
NcToPlc AT %I* : NCTOPLC_Axis_REF; 

IF bSoEReset THEN
 fbSoEReset(
   Axis := NcToPlc,
   bExecute := TRUE,
    tTimeout := DEFAULT_ADS_TIMEOUT,
 );
 IF NOT fbSoEReset.bBusy THEN
    fbSoEReset(Axis := NcToPlc, bExecute := FALSE);
    bSoEReset := FALSE;
 END_IF
END_IF