MATLAB 帮助中心
本页采用了机器翻译。点击此处可查看英文原文。
以易于理解的格式显示 EtherCAT 通知
[input,output,SubDevices] = slrealtime.EtherCAT.getSignalNames(devID, modelName)
[input,output,SubDevices] = slrealtime.EtherCAT.getSignalNames(devID, modelName) 获取模型中指定设备 ID 对应的 PDO 输入变量名称、PDO 输出变量名称以及下级设备名称。您可以利用这些信息,通过 setparam 命令来配置模型中的 EtherCAT 模块。
input
output
SubDevices
devID
modelName
setparam
示例
全部折叠
获取模型 slrt_ex_ethercat_beckhoff_aio 中指定设备 ID 的 PDO 输入变量名称、PDO 输出变量名称以及下级设备名称。此示例设置了 EtherCAT Init 模块的 ENI 文件路径。这种方法允许您引用位于 MATLAB 路径之外的 ENI 文件。
slrt_ex_ethercat_beckhoff_aio
openExample('slrealtime/SlrtEtherCATCommBeckhoffAIOSubordinateDevicesExample'); openExample('slrealtime/SlrtEtherCATCommBeckhoffAIOSubordinateDevicesExample', ... 'supportingFile','slrt_ex_ethercat_beckhoff_aio.slx'); eniPath = fullfile(pwd,'BeckhoffAIOconfig.xml'); set_param('slrt_ex_ethercat_beckhoff_aio/EtherCAT Init',... 'config_file',eniPath); slbuild('slrt_ex_ethercat_beckhoff_aio'); [myInput,myOutput,mySubDevices] = ... slrealtime.EtherCAT.getSignalNames(0,... 'slrt_ex_ethercat_beckhoff_aio')
myInput = 1×4 string array Columns 1 through 2 "Term 2 (EL3062).A…" "Term 2 (EL3062).A…" Columns 3 through 4 "Term 2 (EL3062).A…" "Term 2 (EL3062).A…" myOutput = 1×2 string array "Term 3 (EL4002).AO Ou…" "Term 3 (EL4002).AO Ou…" mySubDevices = 1×3 string array Columns 1 through 2 "Term 1 (EK1100)" "Term 2 (EL3062)" Column 3 "Term 3 (EL4002)"
devID 是模型中该设备的 EtherCAT 设备 ID,该设备的信号已被检测到。当模型中仅使用一个 EtherCAT 网络时,设备 ID 通常为 0。
示例: 0
0
modelName 是用于检测 EtherCAT 信号的模型。如果省略模型参量,该函数将使用当前模型。
示例: slrt_ex_ethercat_beckhoff_aio
input 是一个字符串数组,其中包含可在 PDO 读取模块中使用的变量。
output 是一个字符串数组,其中包含可在 PDO 写入模块中使用的变量。
SubDevices 是一个字符串数组,其中包含模型中 EtherCAT 从属设备的名称,供 CoE 和 SoE 模块使用。
在 R2020b 中推出
EtherCAT Get Notifications
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 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
欧洲
亚太
联系您当地的办事处