EtherCAT Get State
Libraries:
Simulink Real-Time /
EtherCAT
Description
The EtherCAT Get State block returns the state of the EtherCAT® network.
Examples
EtherCAT Protocol with Beckhoff Analog IO Subordinate Devices EL3062 and EL4002
Communicate with EtherCAT devices using the Beckhoff® analog I/O terminals EL3062 and EL4002.
EtherCAT Protocol with Beckhoff Digital IO Subordinate Devices EL1004 and EL2004
Communicate with EtherCAT devices using the Beckhoff digital I/O terminals EL1004 and EL2004.
EtherCAT Protocol Sequenced Writing SoE Subordinate Device Configuration Variables
Use SoE blocks and a simple state machine to write configuration values to variables that can only be written before going to EtherCAT Op state.
EtherCAT Protocol Sequenced Writing CoE Subordinate Device Configuration Variables
Use CoE blocks and a simple state machine to write configuration values to variables that can only be written before going to EtherCAT Op state.
EtherCAT Protocol Detect Network Failure and Reset
Use the EtherCAT Notifications block to detect a failure in the connected network and to restart the network when the failure is corrected.
EtherCAT Protocol Motor Velocity Control with Accelnet Drive
Control the velocity of a motor by using EtherCAT communication.
EtherCAT Protocol Motor Position Control with Accelnet Drive
Control the position of a motor by using EtherCAT communication.
Generate ENI Files for EtherCAT Devices
Generate EtherCAT network information (ENI) files to use in Simulink® Real-Time™ with EtherCAT devices.
Ports
Output
State — State received from the EtherCAT network
1
| 2
| 4
| 8
State | Value | Description |
---|---|---|
INIT | 1 | Initialization — The system finds terminal devices and initializes the communication controller. |
PREOP | 2 | Preoperational — The system uses the communication controller to exchange system-specific initialization data. In this state, the network cannot transmit or receive signal data. |
SAFEOP | 4 | Safe 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. |
OP | 8 | Operational — The network is in full operation. The supervisor sends input data to the terminal device. The terminal device responds with output data. |
Parameters
Network Device Index — EtherCAT network identifier
0
(default) | 0-11
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 |
Sample time — Sample time of block
-1
(default) | numeric
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 R2020b
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)