F_ConvStateToString

F_ConvStateToString 1:

The function F_ConvStateToString returns the EtherCAT slave state as string. For nState = 0 ‘ ‘ is returned, otherwise, ‘INIT ‘ is returned, e.g. for nState = 1. If several messages are pending, they are separated by spaces.

F_ConvStateToString 2: Inputs

VAR_INPUT
    nState : WORD;
END_VAR

Name

Type

Description

nState

WORD

EtherCAT slave state as WORD

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

Requirements

Development environment

Target platform

PLC libraries to include

TwinCAT v3.1.0

PC or CX (x86, x64, ARM)

Tc2_EtherCAT