Main Content

EtherCAT Get Device State

Get state of EtherCAT network

Since R2021b

  • EtherCAT Get State block

Libraries:
Simulink Real-Time / EtherCAT

Description

The EtherCAT Get Device State block returns the state of a device on the EtherCAT® network.

Examples

Ports

Output

expand all

StateValueDescription
INIT1Initialization — The system finds terminal devices and initializes the communication controller.
PREOP2Preoperational — The system uses the communication controller to exchange system-specific initialization data. In this state, the network cannot transmit or receive signal data.
SAFEOP4Safe operational — The network is running and ready for full operation. The supervisor sends input data to the terminal device. The terminal device output remains in a safe state.
OP8Operational — The network is in full operation. The supervisor sends input data to the terminal device. The terminal device responds with output data.

Parameters

expand all

To associate a block with an EtherCAT network, enter the Network Device Index value from the EtherCAT Init block representing that network into the Network Device Index for the block.

Programmatic Use

Block Parameter: device_id

Select an EtherCAT subordinate device from the list of available subordinate devices provided by the ENI configuration file. The configuration file is selected by the EtherCAT Init block.

Programmatic Use

Block Parameter: device_name

Enter the base sample time or a multiple of the base sample time. -1 means that the sample time is inherited.

Programmatic Use

Block Parameter: sample_time

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Version History

Introduced in R2021b