EtherCAT Set State
设置 EtherCAT 网络的状态
库:
Simulink Real-Time /
EtherCAT
描述
EtherCAT Set State 模块将 EtherCAT® 网络的状态设置为通过 New State 端口传入的值。
示例
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.
端口
输入
| 状态 | 值 | 描述 |
|---|---|---|
INIT | 1 | 初始化 - 系统查找终端设备并初始化通信控制器。 |
PREOP | 2 | 预操作阶段 - 系统通过通信控制器交换系统专用的初始化数据。在此状态下,网络无法传输或接收信号数据。 |
SAFEOP | 4 | 安全运行 - 网络已启动并准备就绪,可全面投入使用。主管将输入数据发送至终端设备。终端设备输出保持在安全状态。 |
OP | 8 | 运行状态 - 网络处于全面运行状态。主管将输入数据发送至终端设备。终端设备以输出数据作出响应。 |
输出
该端口返回 New State 端口先前设置的值。
如果未发生错误,该端口将返回 0。否则,它将返回非零值。
参数
要将一个模块与 EtherCAT 网络关联,请将代表该网络的 EtherCAT Init 模块中的 Network Device Index 值输入到该模块的 Network Device Index 中。
编程用法
模块参数:device_id |
请输入等待 EtherCAT 网络状态发生转换所需的秒数。
将超时时间设置为 0 以立即返回。如果指定了非零的 Timeout 值,请在“配置参数”的 Solver 窗格中,将 Fixed-step size 参数设置为大于 Timeout 值的值。
编程用法
模块参数:timeout |
输入基本采样时间或其倍数。-1 表示采样时间被继承。
编程用法
模块参数:sample_time |
扩展功能
C/C++ 代码生成
使用 Simulink® Coder™ 生成 C 代码和 C++ 代码。
版本历史记录
在 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.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
- América Latina (Español)
- Canada (English)
- United States (English)
欧洲
- 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)







