ECATWriteData

PLCopen motion icon Pipe Network motion icon


  • This is a low level function and it should only be used carefully by advanced users.

Example

if MLSTATUS_RUNNING = MLMotionStatus() then
    Byte_Array[0] := any_to_usint(ECATReadData( ECAT_Offset+0, 1, false ));
end_if;
if MLSTATUS_RUNNING = MLMotionStatus() then
    ECATWriteData( ECAT_Offset, 1, any_to_dint(Byte_Array[0]) );
end_if;

 FunctionClosed A function calculates a result according to the current value of its inputs. A function has no internal data and is not linked to declared instances. - Modify the EtherCAT process image by directly writing values in it.

If you have a device other than the drive, ECATWriteData is used for more than just debug. It is used to set the status of the module (e.g. Stepper I/O slice) in the case your project is based on an external XMLClosed "Extensible Markup Language " XML is a general-purpose markup language. It is classified as an extensible language because it allows its users to define their own tags file because it contains unsupported EtherCAT Device.

Arguments

Input

Offset Description

Offset in bytes from the beginning of the frame


  • The Offset value required to access may change when the firmware for any device on the EtherCAT network is updated or whenever the EtherCAT network topology changes. When performing an update of a network device or changing the network topology, one should export the ENI file and check the Offset value needed to access the desired information.
  Data type UINT
  Range 0 - 1500
  Unit bytes
  Default
Nbytes Description Number of bytes to write
  Data type SINT
  Range 1, 2 or 4
  Unit bytes
  Default
Value Description Value to be written in the image. Only the number of bytes specified by Nbytes is copied.
  Data type DINT
  Range [-2147483648, 2147483648]
  Unit N/A
  Default

  • The valid ranges for the Value parameter are:
    For 1 byte: 0 to 255
    For 2 bytes: 0 to 65535
    For 4 bytes: - 2147483648 to 2147483648 (The sign bit represents the most significant bit in the data word)

Output

Default (.Q) Description

True if data was written.

See Function - General Rules for more information.

  Data type BOOL
  Unit N/A

Related Functions

ECATReadData

Example

Structured Text

//For use with Kollmorgen Thermocouple slice I/O to read in deg C
//Lookup offset by exporting ENI file after EtherCAT network is scanned
//Use offst 124 (byte) to write 0 in control word to allow temperature to be shown on status byte

ON WriteControlOnly DO
ECATWriteData
( 124, 1, 0 );
END_DO

FBD

FFLD

Go back to the top of the page[Top]