F_ConvExtStateToString

F_ConvExtStateToString 1:

The F_ConvExtStateToString function returns the extended EtherCAT slave state as a string.

If bit nExtendedState.16 is set, the string “EMPTY” is returned.

If the nExtendedState.16 bit is not set (e.g., when nExtendedState = 0), “ ” is returned; otherwise (e.g., when nExtendedState = 1), “INIT ” is returned. If several messages are pending, they are separated by spaces.

F_ConvExtStateToString 2: Inputs

VAR_INPUT
    nExtendedState : DWORD;
END_VAR

Name

Type

Description

nExtendedState

DWORD

Extended EtherCAT slave state as a DWORD

0x___1____ = 'EMPTY'
0x0000___1 = 'INIT'
0x0000___2 = 'PREOP'
0x0000___3 = 'BOOT'
0x0000___4 = 'SAFEOP'
0x0000___8 = 'OP'
0x0000001_ = 'Slave signals error'
0x0000002_ = 'Invalid vendorId, productCode... read'
0x0000004_ = 'Initialization error occurred'
0x0000008_ = 'Slave disabled'
0x0000010_ = 'Slave not present'
0x0000020_ = 'Slave signals link error'
0x0000040_ = 'Slave signals missing link'
0x0000080_ = 'Slave Slave signals unexpected link'
0x0000100_ = 'Communication port A'
0x0000200_ = 'Communication port B'
0x0000400_ = 'Communication port C'
0x0000800_ = 'Communication port D'

Requirements

Development environment

Target platform

PLC libraries to include

TwinCAT v3.1.4026.26

PC or CX (x86, x64, Arm®)

Tc2_EtherCAT >= 3.8.1.0