Main Content

slrealtime.EtherCAT.getSignalNames

Display EtherCAT notifications in human-readable format

Description

example

[input,output,slaves] = slrealtime.EtherCAT.getSignalNames(devID, modelName) gets the PDO input variable names, PDO output variable names, and slave 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 slave 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.

open_system(fullfile(matlabroot,'toolbox','slrealtime',...
    'examples','slrt_ex_ethercat_beckhoff_aio'));
eniPath = fullfile(matlabroot,'toolbox','slrealtime',...
    'examples','BeckhoffAIOconfig.xml')
set_param('slrt_ex_ethercat_beckhoff_aio/EtherCAT Init',...
    'config_file',eniPath)
slbuild('slrt_ex_ethercat_beckhoff_aio');
[myInput,myOutput,mySlaveDevices] = ...
    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…"


mySlaveDevices = 

  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 slaves is an array of strings with the names of the EtherCAT slaves in the model for use in the CoE and SoE blocks.

Introduced in R2020b