EtherCAT Read End of trail navigation bar

Table of Contents

EtherCAT Write

Beta

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

Writes the specified variables to the EtherCAT process image.

Library

QUARC Targets Beta/Fieldbus/EtherCAT

Description

EtherCAT Write

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

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

Input Ports

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

Output Ports

This block has no output ports.

Data Type Support

The EtherCAT Write 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 Write

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 write. 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 input units depend on the variables selected. There is one input port for each variable in the list and the input 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 from the input. The block inherits the sample time by default.

To set the sample time to the fundamental sampling time of the model, use the qc_get_step_size function, which is a QUARC function that returns the fundamental sampling time of the model. The fundamental sampling time of the model is the sampling time entered in the Fixed step size field of the Solver pane of the Configuration parameters.

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