EtherCAT Master EtherCAT Write navigation bar

Table of Contents

EtherCAT Read

Beta

This block is currently a beta version. If you are using this block, we would appreciate any feedback at tech@quanser.com.

Reads the specified variables from the EtherCAT process image.

Library

QUARC Targets Beta/Fieldbus/EtherCAT

MATLAB Command Line

Click to copy the following command line to the clipboard. Then paste it in the MATLAB Command Window:

qc_open_library('quarc_library_beta/Fieldbus/EtherCAT')

Description

EtherCAT Read

The EtherCAT Read block reads the specified variables from the process image every time the block is executed. It does not send or receive packets from the EtherCAT slaves but instead reads from the process image in the EtherCAT stack. The EtherCAT stack updates the process image at the sampling rate specified in the EtherCAT Master block.

This block can read more than one variable at the same time. The variables are read from the process image immediately. Using this block is more efficient than using separate blocks for each variable.

Input Ports

This block has no input ports.

Output Ports

The number of output ports depends on the number of variables specified in the Variables list. Each variable in the list is assigned a different output port, in the order that they appear in the list. The data type and dimensions of each output are determined by the data type and dimensions of the corresponding variable.

Data Type Support

The EtherCAT Read block supports the following EtherCAT data types, and arrays of these types:

EtherCAT Type Simulink type Range Comment
BOOL boolean 0..1 logical type
BYTE uint8 0..255
WORD uint16 0..65535
DWORD uint32 0..4294967295 double word
SINT int8 -128..127 signed "short" integer
USINT uint8 0..255 unsigned "short" integer
INT int16 -32768..32767 signed integer
UINT uint16 0..65535 unsigned integer
DINT int32 -2147483648..2147483647 signed "double" integer
UDINT uint32 0..4294967295 unsigned "double" integer
REAL single ±3.402823e38 single-precision floating-point
LREAL double ±1.79769313486232e308 double-precision floating-point
TIME uint32 0..4294967295 milliseconds
TIME_OF_DAY (TOD) uint32 0..4294967295 seconds
DATE uint32 0..4294967295 seconds since January 1, 1970
DATE_AND_TIME (DT) uint32 0..4294967295 seconds since January 1, 1970
AMSADDRESS uint8 0..255 48 bit address presented as a 6-vector of bytes

Parameters and Dialog Box

EtherCAT Read

The Main pane of the dialog appears is shown above.

EtherCAT master

The name of the EtherCAT master whose process image variables will be read. EtherCAT masters are configured using the EtherCAT Master block. Place an EtherCAT Master block in your diagram to add an EtherCAT master to the list.

Variables

The variables to read. The number of variables available depends on the EtherCAT master selected and the number of process variables defined in its corresponding XML configuration file. The output units depend on the variables selected. There is one output port for each variable in the list and the output ports are assigned in the same order as the variable list.

To add a variable to the list, choose the variable in the pop-up menu (combobox) that appears immediately below the list of variables. Then click on the Add button to add the selected variable to the end of the list. The data type and length of the variable will be displayed in the information area to the right of the list of variables.

To remove a variable from the list, click on the variable in the list. (Do not select the variable in the pop-up menu that appears immediately below the list of variables.) Then click on the Delete button to remove the selected variable from the list. Use the Ctrl key to select more than one variable in the list and the Shift key to select a range of variables in the list. Then click on the Delete button to remove all the selected variables from the list.

Sample time

The sample time of the block. A sample time of 0 indicates that the block will be treated as a continuous time block. A positive sample time indicates that the block is a discrete time block with the given sample time.

A sample time of -1 indicates that the block inherits its sample time. Since this is a source block, only inherent the sample time when it is placed in a conditionally executed subsystem, like a Triggered or Enabled Subsystem, or in a referenced model.

The default sample time is set to qc_get_step_size, which is a QUARC function that returns the fundamental sampling time of the model. Hence, the default sample time is a discrete sample time with the same sampling time as the fixed step size of the model.

Targets

Target Name

Compatible*

Model Referencing

Comments

QUARC Win32 Target

No

No

Not currently supported.

QUARC Win64 Target

No

No

Not currently supported.

QUARC Linux Nvidia Target

No

No

Not currently supported.

QUARC Linux QBot Platform Target

Yes

Yes

QUARC Linux QCar 2 Target

Yes

Yes

QUARC Linux QDrone 2 Target

Yes

Yes

QUARC Linux Raspberry Pi 3 Target

No

No

Not currently supported.

QUARC Linux Raspberry Pi 4 Target

No

No

Not currently supported.

QUARC Linux RT ARMv7 Target

No

No

Not currently supported.

QUARC Linux x64 Target

No

No

Not currently supported.

QUARC Linux DuoVero Target

No

No

Not currently supported.

QUARC Linux DuoVero 2016 Target

No

No

Not currently supported.

QUARC Linux Verdex Target

No

No

Not currently supported.

QUARC QNX x86 Target

Yes

Yes

Last fully supported in QUARC 2018.

Rapid Simulation (RSIM) Target

No

No

Not currently supported. This block does nothing during rapid simulation.

S-Function Target

No

N/A

Old technology. Use model referencing instead.

Normal simulation

No

No

Not currently supported. This block does nothing during normal simulation.

* Compatible means that the block can be compiled for the target.

See Also

 

navigation bar