Main Content

slrealtime.EtherCAT.getSignalNames

Display EtherCAT notifications in human-readable format

Since R2020b

Description

example

[input,output,SubDevices] = slrealtime.EtherCAT.getSignalNames(devID, modelName) gets the PDO input variable names, PDO output variable names, and subordinate device names for a specified device ID in the model. You can use this information to configure the EtherCAT blocks in the model by using setparam commands.

Examples

collapse all

Get the PDO input variable names, PDO output variable names, and subordinate device names for a specified device ID in the model slrt_ex_ethercat_beckhoff_aio. This example sets the path to the ENI file for the EtherCAT Init block. This approach lets you refer to ENI files that are not available on the MATLAB path.

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)"

Input Arguments

collapse all

The devID is the EtherCAT device ID of the device in the model for which signals are found. The device ID is typically 0 when a single EtherCAT network is in use in a model.

Example: 0

The modelName is the model from which EtherCAT signals are found. If model argument is omitted, the function uses the current model.

Example: slrt_ex_ethercat_beckhoff_aio

Output Arguments

collapse all

The input is an array of strings with the variables usable in a PDO read block.

The output is an array of strings with the variables usable in a PDO write block.

The SubDevices is an array of strings with the names of the EtherCAT subordinate devices in the model for use in the CoE and SoE blocks.

Version History

Introduced in R2020b