Acyclic memory access

Data traffic with acyclic CoE access

In acyclic access, the user can create up to 255 memory objects that may also be differently sized. These objects can be specifically accessed from the PLC task via acyclic SDO access (Service Data Objects) for writing or reading; see sample program. This read/write access proceeds considerably slower than the above-described cyclic memory access.

The created structure can only be changed in the status PREOP. It can also be generally locked to prevent further changes.

Background information: The entire memory capacity is administered in the form of CoE objects (CAN over EtherCAT). The administration data (number and byte size) is located in the object index 0x2F00 with its subindexes; the stored data itself in the CoE objects from 0x2000: 0x2000, 0x2008, 0x2010, 0x2018 etc.

A memory object in acyclic access can comprise 1 to 8190 bytes.

The following procedure is recommended in order to use acyclic access:

Calculation of the memory space

The available 128 KB (131,072 bytes) of memory are subdivided as follows:

Sample: The acyclic memory objects Obj1, Obj2 and Obj3 are defined with 1,000, 3,000 and 7,000 bytes respectively --> x = 11,000 bytes and y = 7,000 bytes. Thus 113,072 bytes of memory space remain.

Definition of the memory objects via the StartUp list

The desired structure of the memory objects must be created once only in the status PREOP in the CoE directory in CoE object 0x2F00. This is also possible offline, i.e. without a connected box. At start-up, the EP6080-0000 checks whether the memory structure has changed and if necessary creates the objects in the memory accordingly.

Acyclic memory access 1:

Change in the data structure

If the data structure or the object 0x2F00 is changed, all existing data in the EP6080-0000 is deleted. The data structure can be locked against modification by setting the lock object 0xF200:02.

Procedure short form:

  1. Set "Lock" in CoE object 0xF200:02 to 0 (manually in TwinCAT or via PLC).
  2. Enter the StartUp command for the CoE object 0x2F00
    Content: number of objects + respective length in bytes.
    Note: complete access, byte alignment, no empty object possible, only possible in P -> S transition, 16 bit entries, max. 127 memory objects.
  3. Reload the configuration.
  4. For control: reload the CoE directory.
  5. Set Locked in CoE object 0xF200:02 = 1 (manually in the System Manager or via PLC), thus locking the structure to prevent further changes.

Procedure in detail:

The procedure to specify the structure of the memory objects as required by the user is as follows:

Acyclic memory access 2:
Arbitrary start state of the EP6080-0000

Following startup, the EP6080-0000 contains either an already changed memory structure or the default memory structure. The CoE objects from 0x2000 and 0x2F00 are important in the following. In Figure Any start state of the EP6080-0000, an object of size 1 byte is already created in the EP6080-0000:

Now the EP6080-0000 is to be reconfigured to the following memory structure:

i.e. a total of 270 bytes in 4 memory objects, which can each be accessed acyclically via the CoE. A corresponding entry for this must be made in the EP6080-0000’s StartUp list. This list is empty by default on the EP6080-0000.

Acyclic memory access 3:
Addition of a new StartUp entry

This is achieved by New.. in the StartUp tab of EP6080-0000.

Acyclic memory access 4:
Definition of the StartUp entry

A window opens in which the new StartUp entry can be defined.

Acyclic memory access 5:

StartUp list selection dialog

If no CoE entries (see Fig. Definition of the StartUp entry) are offered for selection, this is because you are working offline (i.e. without a connected box) and the ESI (EtherCAT Slave Information, XML description) of the EP6080-0000 that you are using does not contain a dictionary.
In this case you can also define StartUp entries entirely manually, i.e. enter Index and Subindex manually.

Example:

Confirm with OK. The new StartUp entry looks like this:

Acyclic memory access 6:
New EP6080-0000 StartUp entry

This configuration must now be loaded to the EP6080-0000 and, in particular, the PREOP-->SAFEOP state transition must be run through as defined in the StartUp entry.
Click the "Reload Devices" button (Fig. Reload the configuration):

Acyclic memory access 7:
Reload the configuration

The old entry is still visible in the CoE-Online tab.

The reason is that TwinCAT primarily only loads the values of CoE objects that are known to the System Manager. If the CoE structure changes on the device, the System Manager has to be instructed to load the new structure, which may differ from the default structure according to XML/Dictionary.

Load the reconfigured CoE directory (Fig. Full reload of the CoE directory):

Acyclic memory access 8:
Complete reload of the CoE directory

The newly defined memory objects are now visible and enabled, see Fig. Modified CoE directory.

Acyclic memory access 9:

Updating the CoE directory

In order to update the display of the CoE directory, use AutoUpdate, UpdateList or the appropriate dialog under Advanced.

Acyclic memory access 10:
Changed CoE directory
Acyclic memory access 11:

Displaying larger CoE objects

In the sample selected here, the content of the third memory object in the CoE object 0x2010 is not shown in the TwinCAT display, see Fig. Changed CoE directory, because the content is too large to be displayed. Regardless of that, the contents naturally exist.

Online access to the memory objects during operation

Function blocks from the PLC library "Tc2_EtherCAT" such as FB_EcCoESdoWriteEx can be used for access from the PLC.

Sample

fbWriteCoE(
sNetId:=sAmsNetId,
nSlaveAddr:= tAmsAddr.port ,
nSubIndex:= 0,
nIndex:= 16#2000 + ((byObjectNo - 1) * 8),
pSrcBuf:= pDataForWrite,
cbBufLen:= wSizeOfData,
bExecute:= TRUE,
tTimeout:= tAdsTimeOut,
bCompleteAccess:= FALSE,
bBusy=> ,
bError=> ,
nErrId=> );
Acyclic memory access 12:

Sample program

The EL6080 documentation contains a sample program that demonstrates CoE access from a PLC program.

Documentation on EL6080