Function Description

The WRITE_ASYN function is used to write 1 Kbyte of data via the asynchronous messaging channel of TSX ETY modules in TCP/IP mode.

The following data can be write-accessed:

  • internal bits,

  • internal words.

Asynchronous writing can only take place between two stations on the same Ethernet TCP/IP network segment.

The WRITE_ASYN function is sent at the end of the MAST task only if this is configured in periodic mode. It is possible to activate 8 functions simultaneously.

The size of the send and receive buffers is expressed in words. It is 512 words, or 1024 bytes.

NOTE: The asynchronous server function supports UNI-TE V1 or V2.0 protocols. The WRITE_ASYN function uses the UNI-TE V2.0 protocol.

The additional parameters EN and ENO can be configured.

Exchange principle

The following diagram illustrates the exchanges between two stations for a WRITE_ASYN function:

FBD representation

Representation:

LD representation

Representation:

IL representation

Representation:

LD Address
WRITE_ASYN Object_Type, First_Object, Object_Number, Data_to_Write, Management_Param

ST representation

Representation:

WRITE_ASYN(Address, Object_Type, First_Object, Object_Number, Data_to_Write, Management_Param);

Parameter Description

The following table describes the input parameters:

Parameter

Type

Comment

Address

ARRAY [0.. 5] OF INT

Address of the destination entity of the exchange. Addresses are of the type: ADDR(’{Network.Station}SYS.

Object_Type

STRING

Type of objects to write:

  • ’%M’: internal bits,

  • ’%MW’: internal words,

  • ’%S’: system bits,

  • ’%SW’: system words.

First_Object

DINT

Index of the first object to be written in the destination device.

Object_Number

INT

Number of objects to write.

Data_to_Write

ARRAY [n... m] OF INT

Word table containing the value of the objects to be written.

The following table describes the input/output parameters:

Parameter

Type

Comment

Management_Param

ARRAY [0.. 3] OF INT

Exchange management table. The operation report takes one of the following values:

  • 16#00 : correct exchange,

  • 16#01 : stop on timeout, the response was not able to be sent in under 2 seconds,

  • 16#02 : stop on user request (STOP, S0, INIT, hot or cold re-start),

  • 16#03 : incorrect address format,

  • 16#05 : incorrect management parameters,

  • 16#07 : destination missing,

  • 16#09 : insufficient receive buffer size,

  • 16#10 : insufficient send buffer size,

  • 16#11 : no system resources (8 functions already active),

  • 16#19 : incorrect exchange number,

  • 16#FF: message refused.

Note: do not forget to program a Timeout value to stop an exchange in progress when the response is not returned to the sender.