CouplerReset

CouplerReset 1:

The function block CouplerReset can be used to execute a reset of the coupler via the 2-byte PLC interface. During a coupler reset, for example, the current terminal configuration is read in again by the coupler via the K-bus (terminal bus) and communication on the K-bus is reinitialized. Existing K-bus error messages for the coupler are reset. The STATE and CONTROL variables are used to perform a handshake with the coupler during the execution of the function block. These variables must therefore be linked to the Control/Status variables of the 2-byte PLC interface in the TwinCAT System Manager.

CouplerReset 2: Inputs

VAR_INPUT
    STATE   : PLCINTFSTRUCT;
    START   : BOOL;
    TMOUT   : TIME;
END_VAR

Name

Type

Description

STATE

PLCINTFSTRUCT

Status word of the 2-byte PLC interface.

START

BOOL

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

TMOUT

TIME

Specifies the time-out period that must not be exceeded when the function is executed.

CouplerReset 3: Outputs

VAR_OUTPUT
    CONTROL  : PLCINTFSTRUCT;
    BUSY     : BOOL;
    ERR      : BOOL;
    ERRID    : UDINT;
END_VAR

Name

Type

Description

CONTROL

PLCINTFSTRUCT

Control word of the 2-byte PLC interface.

BUSY

BOOL

When the function block is activated, this output is set and remains set until the function is completed.

ERR

BOOL

If an error occurs during the execution of the function, this output is set after the BUSY output is reset.

ERRID

UDINT

If the ERR output is set, this parameter supplies the error number.

Error number

Error description

0

No error

0x100

Error during initialization of communication via the 2-byte PLC interface

0x200

Error during communication

0x300

Timeout error. The permitted execution time has been exceeded

0x400

Incorrect parameter value for register number

0x500

Incorrect parameter value for table number

Example of a call in FBD:

VAR 
    IntfState AT%I*      : PLCINTFSTRUCT;
    IntfControl AT%Q*    : PLCINTFSTRUCT;
    CouplerReset1        : CouplerReset;
    Start_CouplerReset   : BOOL;
    CouplerReset_Busy    : BOOL;
    CouplerReset_Err     : BOOL;
    CouplerReset_ErrId   : UDINT;
END_VAR

CouplerReset 4:

The variables IntfState and IntfControl are linked with corresponding I/O variables in the TwinCAT System Manager.

Requirements

Development environment

Target system type

PLC libraries to include (category group)

TwinCAT v3.1.0

PC or CX (x86, x64, ARM)

Tc2_Coupler (IO)