F_ConvStateToString

F_ConvStateToString 1:

The function F_ConvStateToString supplies the EtherCAT slave state as a string.

VAR_INPUT

VAR_INPUT
    nState : WORD;
END_VAR

Name

Type

Description

nState

WORD

EtherCAT Slave State as WORD
    0x___1 = Slave in'INIT' state
    0x___2 = Slave in 'PREOP' state
    0x___3 = Slave in 'BOOT' state
    0x___4 = Slave in 'SAFEOP' state
    0x___8 = Slave in 'OP' state
    0x001_ = Slave signals error
    0x002_ = Invalid vendorId, productCode...read
    0x004_ = Initialization error occurred
    0x010_ = Slave not present
    0x020_ = Slave signals link error
    0x040_ = Slave signals missing link
    0x080_ = Slave signals unexpected link
    0x100_ = Communication port A
    0x200_ = Communication port B
    0x400_ = Communication port C
    0x800_ = Communication port D

Requirements

Development environment

Target system type

PLC libraries to be linked

TwinCAT v2.10.0 or higher

PC or CX (x86)

TcEtherCAT.lib
( Standard.Lib; TcBase.Lib; TcSystem.Lib, TcUtilities.Lib are included automatically )

TwinCAT v2.10.0 Build >= 1301 or higher

CX (ARM)