Basic function principles

The EL6080 supports 2 methods of accessing the memory: with cyclic process data and via acyclic SDO/CoE access. The memory can be deleted, for example, in further settings.

Delivery state

The EL6080 is delivered ready for operation with no predefined acyclic data structures.

General information on data consistency

The EL6080 can be used for the failsafe storage of cyclic machine data.  A corresponding feedback message in Status (cyclic operation) confirms that the data has been adopted correctly by the EL6080. The data must appear correctly in the CoE in acyclic operation mode.

An operational case may occur where the terminal is switched off or the task is stopped during (a)cyclic access for writing. In this case, shadow buffers or the NOVRAM in the EL6080 ensure data consistency at the lowest level, so that the last correctly written data set can always be accessed. At application level, however, the user must take care himself through appropriate use that the application adopts consistent data, for example, at the start (e.g. continuous counters or ID recognition in the data to be saved).

Sample:

Several acyclic data objects are defined from 1 to 3 that are continuously written to by the application in sequence, e.g. 3 axis positions that are determined simultaneously in the application. The power fails during access for writing to object 2. Object 1 now contains the current axis position 1, but objects 2 & 3 contain outdated positions. At restart, the application must not assume that it is receiving 3 axis positions originating from the same point in time.

The same side effects must be taken into account in the case of simultaneous operation of the EL6080 and Persistent/Retain/Other NOVRAM data (e.g. from FC cards or CX).

Readiness for operation of the EL6080

It is imperative that you ensure in your application that the terminal has a valid WorkingCounter WcState before beginning with writing and, in particular, reading communication! Process data delivered by an EtherCAT slave when the WcState is ≠ 0 (even if the data is ≠0) must be discarded as invalid!

CoE directory EL6080

The functionality of the EL6080 results in CoE objects being deleted or created during reparameterisation. Please refer to the notes in order to ensure correct online CoE display.

Basic function principles 1:
Default process image of the EL6080 after insertion
  • Status: 16 bit feedback of the EL6080
  • Control: 16 bit control of the EL6080

Status word

The status word (SW) is in the input process image and is transferred from the terminal to the controller.

Bit

SW.15

SW.14

SW.13

SW.12

SW.11

SW.10

SW.9

SW.8

Name

Acyclic mode, 4-bit counter is incremented for each successful save

-

-

-

-

Bit

SW.7

SW.6

SW.5

SW.4

SW.3

SW.2

SW.1

SW.0

Name

-

-

-

-

-

-

-

Cyclic operation with handshake, "Writing Started"

Control word

The control word (CW) is in the output process image and is transferred from the controller to the terminal.

Bit

CW.15

CW.14

CW.13

CW.12

CW.11

CW.10

CW.9

CW.8

Name

-

-

-

-

-

-

-

-

Bit

CW.7

CW.6

CW.5

CW.4

CW.3

CW.2

CW.1

CW.0

Name

-

-

-

-

-

-

-

Cyclic operation with handshake, "Start Writing"

Data traffic with cyclic process data

The user can create one set of process data with an arbitrary structure, max. 1280 bytes. This data set can be written cyclically in its entirety to the terminal or read by it. Individual access to the constituent parts of this data set is not possible (keyword: addressing). Control is effected by the task by means of a handshake via Control/Status Word, so that several task cycles may be necessary for saving or reading back, depending on the extent of the data and the cycle time.

When the EL6080 is switched on, the regularly saved data from the last operating session is offered immediately via the inputs for reading in.

Commissioning: The cyclic process image must be created identically at inputs and outputs, max. 1280 bytes. Creation by right-clicking Inputs/Outputs.

Basic function principles 2:
Manual creation of the cyclic process data

If the input and output are created with different sizes, the terminal start-up fails: “PREOP to SAFEOP failed”.
If more than 1280 bytes are created, the terminal start-up fails with “Invalid SM In/Out Cfg”.

  • The data to be written in the EL6080 is output to the EL6080 by the task at the outputs.
  • The last valid data received by the EL6080 as read data arrives at the task at the inputs with no further assistance.

Structure of the process data in TwinCAT 2.10

The structure of the Input/Output data is subject to the following restriction up to TwinCAT 2.10 build 1330: all defined variables must be composed of n*bytes; individual bits or such types of composed structures are not permissible. If such data is defined, the EL6080 attains the OP state, but reports an error due to Working Counter = 1.

Samples:

Basic function principles 3:
Permissible configurations
Basic function principles 4:
Impermissible configuration up to TwinCAT b2.10 b1330

Cyclic operation with handshake, recommended operating sequence:

  1. Output the input data to the terminal; set ControlWord = 1.
  2. Once the terminal has successfully adopted the data, StatusWord = 1 is returned.
  3. Set ControlWord = 0.
  4. Wait until StatusWord = 0 is returned; the terminal is then ready for a new write access operation.
Basic function principles 5:
Cyclic operation with handshake

Typical example of a measurement for a cyclic write process according to the sequence described above (Beckhoff reserves the right to make unannounced amendments):

  • 20 bytes: 200 µs
  • 1250 bytes: 2.5 ms

Process data image and frame length

In the case of short cycle times, an extensive process image for the EL6080 can result in an Ethernet frame that is longer than the cycle time. Therefore, in order to use the entire 1280 bytes of the cyclic process image, the cycle time must be at least >= 200 µs.

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 terminal 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:

  • 1280 bytes for the cyclic data
  • 2000 bytes for internal administration
  • x bytes as defined by the user for the acyclic data in the following
  • y bytes: a shadow buffer as large as the largest memory object is kept on standby in the background.

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 in the System Manager (without a terminal being connected). At start-up, the EL6080 checks whether the memory structure has changed and if necessary creates the objects in the memory accordingly.

Change in the data structure

If the data structure or the object 0x2F00 is changed, all existing data in the EL6080 is deleted. The data structure can be locked to prevent it being changed by setting the lock object 0xF200:02.

Procedure in short:

  1. Set Locked in CoE object 0xF200:02 = 0 (set manually in the System Manager or via PLC).
  2. Enter the StartUp command for the CoE object 0x2F00
    Contents: Number of objects + respective lengths in bytes.
    To be observed: complete access, byte alignment, no empty objects possible, only possible in P -> S transition, 16 bit entries, max. 127 memory objects.
  3. Reloading the configuration.
  4. For checking: reload the CoE directory.
  5. Set Locked in CoE object 0xF200:02 = 1 (set 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:

Basic function principles 6:
Arbitrary start status of the EL6080

Following start-up, the EL6080 contains either an already changed memory structure or the default memory structure. The CoE objects from 0x2000 and 0x2F00 are important in the following. Fig. Variable start state of the EL6080 shows in the EL6080 an object of size 1 byte:

  • 0x2F00:0 (NOVRAM size info): "1" = 1 memory object exists.
  • 0x2F00:01 (Subindex 001): “0x0001” = this one memory object has been defined with a size of 1 byte
  • 0x2000 (NOVRAM Data): 00 – this one memory object thus bears “00” as the date of use.

The EL6080 should now be reconfigured to the memory structure

  • 1 byte
  • 10 bytes
  • 256 bytes
  • 3 bytes

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 EL6080’s StartUp list. This list is empty in the EL6080 in the default state.

Basic function principles 7:
Addition of a new StartUp entry

This is achieved via New.. in the EL6080 StartUp tab.

Basic function principles 8:
Definition of the StartUp entry

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

  • Select object 0x2F00 from the list, so that the correct values already appear in Index/SubIndex and Comment.
  • “P-->S” must be selected in Transition (the value will be loaded to the EL6080 during the status transition PREOP-->SAFEOP).
  • CompleteAccess must be activated.
  • Enter the structure you require in Data, in the form “aa aa bb bb cc cc .....”
    aa aa: Number of desired memory objects, in hex and inverted byte order (byte alignment).
    bb bb, cc cc, ...: Respective object size definitions, in hex and inverted byte order (byte alignment).

StartUp list selection dialog

If no CoE entries are offered (see Fig. Definition of the startup entry), the reason is as follows: you are working offline (i.e. with no live terminal connected) and there is no dictionary in the ESI (EtherCAT Slave Information, XML description) of the EL6080 that you are using.
In this case you can also define StartUp entries entirely manually, i.e. enter Index and Subindex manually.

Sample:

  • aa aa = 04 00: 4 memory objects are desired.
  • bb bb = 01 00: 1st memory object has a size of 1 byte (00 01hex = 1dec).
  • cc cc = 0A 00: 2nd memory object has a size of 10 bytes (00 0Ahex = 10dec).
  • dd dd = 00 01: 3rd memory object has a size of 256 bytes (01 00hex = 256dec).
  • ee ee = 03 00: 4th memory object has a size of 3 bytes (00 03hex = 256dec).

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

Basic function principles 9:
New EL6080 StartUp entry

This configuration must now be loaded to the EL6080 and, in particular, the status transition PREOP-->SAFEOP must be performed as defined in the Startup entry.
Click the Reload button (Fig. Reload the configuration):

Basic function principles 10:
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):

  • CoE-Online, Advanced...
  • Double-click AllObjects
  • Then click OK
Basic function principles 11:
Complete reload of the CoE directory

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

  • The structure information (byte size) of memory objects 1 to 4 is defined in CoE object 0x2F00, Subindex 001 to 004
  • The current memory contents are displayed in order in the associated CoE objects 0x2000, 0x2008, 0x2010 etc.

Updating the CoE directory

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

Basic function principles 12:
Changed CoE directory

Displaying larger CoE objects

In the sample chosen here, the contents of the 3rd memory object in CoE object 0x2010 are not shown in the TwinCAT display, see fig. Changed CoE directory, because the contents are too large for the display. Regardless of that, the contents naturally exist.

Online access to the memory objects during operation

For access from the PLC, function blocks from the Beckhoff TcEtherCAT.lib such as FB_EcCoESdoWriteEx can be used. A write call in the form

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=> );

is used in the attached sample program (download).

Supplementary settings

Deleting existing data

If the value <BECF6080> is entered in the CoE object ‘Code Word’ (0xF008) , the EL6080 deletes all existing data at the next restart (status transition INIT --> PREOP). The structure of the acyclic data is retained.

This reset also deletes the LOCK in 0xF200:02.

Protecting an acyclic structure against being changed

If the CoE object 0xF200:02 is set to <1>, the structure from CoE object 0x2F00 can no longer be changed.

Basic function principles 13:
Lock in the CoE