Easy command interface Library descriptionThe Unity Pro library DTE102 contains a code package for a...

25
1 Easy command interface Modicon M340 controller Library description DTE102

Transcript of Easy command interface Library descriptionThe Unity Pro library DTE102 contains a code package for a...

Page 1: Easy command interface Library descriptionThe Unity Pro library DTE102 contains a code package for a Schneider Electric Modicon M340 controller to facilitate data exchange with a DTE102

1

 

Easy command interface Modicon M340 controller

Library description

DTE102

Page 2: Easy command interface Library descriptionThe Unity Pro library DTE102 contains a code package for a Schneider Electric Modicon M340 controller to facilitate data exchange with a DTE102

2

Content 1 Overview ........................................................................................................................................................ 3 2 Exclusion of liability ....................................................................................................................................... 3 3 Setting the connection parameters in the evaluation unit ............................................................................. 3 4 Project the connection in Unity Pro ............................................................................................................... 4

4.1 Insert the evaluation unit in the hardware catalogue of Unity Pro ........................................................ 4 4.2 Insert the evaluation unit in the software project. ................................................................................. 7 4.3 Set the connection parameters in the communication module ............................................................. 9 4.4 Configure the channels of the evaluation unit .................................................................................... 12

5 Working with the library ............................................................................................................................... 13 5.1 Integration into the library in Unity Pro ............................................................................................... 13 5.2 Library contents .................................................................................................................................. 13 5.3 Use of the function blocks in the user program .................................................................................. 14

6 The library's function blocks in detail ........................................................................................................... 14 6.1 The DTE102_INACTIVE function block .............................................................................................. 14 6.2 The DTE102_INPUT function block ................................................................................................... 15 6.3 The DTE102_OUTPUT function block ............................................................................................... 16 6.4 The DTE102_RWH_RW function block .............................................................................................. 18

6.4.1 Build-up of the communication ....................................................................................................... 20 6.4.2 Command processing ..................................................................................................................... 21 6.4.3 Read the UID of the tag .................................................................................................................. 22 6.4.4 Read an area of the USER memory of the tag ............................................................................... 23 6.4.5 Write an area of the USER memory of the tag ............................................................................... 23 6.4.6 Displays at the owStatus output parameter .................................................................................... 24

Page 3: Easy command interface Library descriptionThe Unity Pro library DTE102 contains a code package for a Schneider Electric Modicon M340 controller to facilitate data exchange with a DTE102

3

1 Overview

The Unity Pro library DTE102 contains a code package for a Schneider Electric Modicon M340 controller to facilitate data exchange with a DTE102 evaluation unit from the company ifm electronic in the user program of the PLC. A function block (DFB) is provided for each of the supported modules of the evaluation unit. This document explains how to set up the connection between the controller and the evaluation unit and describes how to integrate and use the library in the Unity-Pro project.

2 Exclusion of liability

The code package of the library is a demo version. It is only intended to serve as an example for the user. Any use of this code package for machine control is at your own risk. The designers and holders of rights of this code package exclude any liability for malfunction or incompatibility of this demo version. For reasons of copyright this program may only be passed on free of charge.

3 Setting the connection parameters in the evaluation unit

The web interface integrated in the device is used to set the connection parameters in the evaluation unit. This can be done using any web browser. When delivered, the evaluation unit is set to the IP address 192.168.0.79.

Connect the PC and the evaluation unit in a network.

Start the web browser on the PC and enter the IP address of the evaluation unit.

An archive with the EDS file for the device can be downloaded from the Home page by clicking on the EDS.ZIP link.

Figure 1

Page 4: Easy command interface Library descriptionThe Unity Pro library DTE102 contains a code package for a Schneider Electric Modicon M340 controller to facilitate data exchange with a DTE102

4

The network parameters can be set on the Network page.

Click on [submit] to apply the network parameters to the evaluation unit.

Figure 2

4 Project the connection in Unity Pro

The communication between the controller and the evaluation unit is made via Ethernet/IP by means of an NOC0401 communication module in the M340 controller. The function blocks of the DTE102 library use the cyclic service "implicit messaging" for the data exchange with the evaluation unit. In this respect it is absolutely necessary to project the connection in Unity Pro. Each DTE102 evaluation unit connects 80 bytes each in the input and output area of the NOC0401 communication module. These areas are to be reserved during the configuration of the communication module's address ranges.

4.1 Insert the evaluation unit in the hardware catalogue of Unity Pro

To integrate the evaluation unit in the hardware catalogue, the EDS file of the evaluation unit is required. This EDS file can be downloaded via the web interface of the evaluation unit as archive (see chapter 3). When this archive has been unzipped, the EDS file can be integrated in the hardware catalogue.

Page 5: Easy command interface Library descriptionThe Unity Pro library DTE102 contains a code package for a Schneider Electric Modicon M340 controller to facilitate data exchange with a DTE102

5

Right-click the communication module in the DTM browser.

In the context menu select Device menu Additional functions Add EDS to library.

Figure 3

Page 6: Easy command interface Library descriptionThe Unity Pro library DTE102 contains a code package for a Schneider Electric Modicon M340 controller to facilitate data exchange with a DTE102

6

Use the opened wizard to add the EDS file of the evaluation unit to the library.

Figure 4

Open the hardware catalogue in Unity Pro.

Figure 5

Page 7: Easy command interface Library descriptionThe Unity Pro library DTE102 contains a code package for a Schneider Electric Modicon M340 controller to facilitate data exchange with a DTE102

7

In the hardware catalogue, change to the DTM catalog tab.

Update the catalogue by clicking on [Update].

Figure 6

4.2 Insert the evaluation unit in the software project.

Right-click the communication module in the DTM browser.

In the context menu, select Add....

Figure 7

Page 8: Easy command interface Library descriptionThe Unity Pro library DTE102 contains a code package for a Schneider Electric Modicon M340 controller to facilitate data exchange with a DTE102

8

Select DTE102XX (from EDS) from the list of the devices.

Click on [Add DTM] to open the window Properties of device.

Figure 8

In the General tab, assign a unique alias name to the device.

Figure 9

In the Protocol information tab, set the required CIP (EtherNet/IP) protocol.

Exit the Properties of device dialogue by clicking on [OK] to apply the settings.

Figure 10

Page 9: Easy command interface Library descriptionThe Unity Pro library DTE102 contains a code package for a Schneider Electric Modicon M340 controller to facilitate data exchange with a DTE102

9

4.3 Set the connection parameters in the communication module

Right-click the communication module in the DTM browser.

In the context menu, select Open to open the window for the configuration of the communication module.

Figure 11

Extend the entry Device List in the structure in the left section of the window and select the evaluation unit.

Select the Properties tab.

In the Item Management area set Import Mode to Manual.

Figure 12

Page 10: Easy command interface Library descriptionThe Unity Pro library DTE102 contains a code package for a Schneider Electric Modicon M340 controller to facilitate data exchange with a DTE102

10

Change to the Address Setting tab.

In the area Change Address, enter the IP address set in the evaluation unit.

Figure 13

In the structure of the left side of the window, select the entry Exclusive Owner.

Set the parameter Request Packet Interval (RPI) >= 10 ms.

The value Connection Bit states the number of the bit which indicates the status of the Ethernet/IP connection to the device in HEALTH_BITS. The HEALTH_BITS are part of the status byte array in the input area of the communication module. For example, in Figure 14 the connection bit = 0. That means that the bit HEALTH_BITS_IN[0].0 indicates if the Ethernet/IP connection to the evaluation unit has been established.

Figure 14

Page 11: Easy command interface Library descriptionThe Unity Pro library DTE102 contains a code package for a Schneider Electric Modicon M340 controller to facilitate data exchange with a DTE102

11

In the structure on the left side of the window, select the Items entry.

Figure 15

In the tabs Input, Input (bit), Output and Output (bit), delete all predefined items.

Click on [OK] to apply the settings and close the window.

Figure 16

Page 12: Easy command interface Library descriptionThe Unity Pro library DTE102 contains a code package for a Schneider Electric Modicon M340 controller to facilitate data exchange with a DTE102

12

4.4 Configure the channels of the evaluation unit

Right-click the symbol of the communication module in the DTM browser.

In the context menu, select Open to open the window for the configuration of the evaluation unit.

Figure 17

In the structure, click on Exclusive Owner.

Change to the Configuration Settings tab.

Configure all channels of the evaluation unit according to the intended use.

The meaning of the parameters is described in the device manual of the evaluation unit.

Click on [OK] to apply the data.

Figure 18

Page 13: Easy command interface Library descriptionThe Unity Pro library DTE102 contains a code package for a Schneider Electric Modicon M340 controller to facilitate data exchange with a DTE102

13

5 Working with the library

5.1 Integration into the library in Unity Pro

The DTE102 library is supplied as archive file. After this archive has been unzipped, the library can be integrated into the types library of Unity Pro by means of the tool for the types library update from the Unity software package.

Start the tool for the types library update.

Set the directory with the library as source.

Click on [Install family].

After the installation, click on [Exit] to exit the tool.

Figure 19

The function blocks are added to the ifm electronic library in the DTE102 family.

Figure 20

5.2 Library contents

The DTE102 library contains one user-specific function block (DFB) each for each of the supported modules of the evaluation unit.

Name Type Description

DTE102_INACTIVE DFB Function block for one channel of the DTE102 evaluation unit with module identifier = INACTIVE (for a detailed description see chapter 6.1)

DTE102_INPUT DFB Function block for one channel of the DTE102 evaluation unit with module identifier = INPUT (for a detailed description see chapter 6.2)

DTE102_OUTPUT DFB Function block for one channel of the DTE102 evaluation unit with module identifier = OUTPUT (for a detailed description see chapter 6.3)

DTE102_RWH_RW DFB Function block for one channel of the DTE102 evaluation unit with module identifier = RWH_RW (for a detailed description see chapter 6.4)

Table 1

Page 14: Easy command interface Library descriptionThe Unity Pro library DTE102 contains a code package for a Schneider Electric Modicon M340 controller to facilitate data exchange with a DTE102

14

5.3 Use of the function blocks in the user program

A function block can be used for each channel in the user program. It must fit the set module of the channel (see Table 1). The correct selection is not checked within the function blocks. Only one instance of a function block is permitted per channel of an evaluation unit. All instances used must be called once per cycle in the cyclic program of the PLC.

To use the function blocks, dynamic arrays (ANY_ARRAY_XXX) as variables and bit extraction from bytes must be permitted in the Unity project. This is set in the properties of the project.

6 The library's function blocks in detail

6.1 The DTE102_INACTIVE function block

This function block can be used for a channel of the DTE102 evaluation unit configured as INACTIVE. It provides the following function:

Read the diagnostic data of the channel of the evaluation unit

In every PLC cycle, the function block extracts the data of the channel from the input data of the evaluation unit. If a diagnosis event occurs on the channel, the diagnostic data is read automatically and it is displayed on the output parameters. Reading the diagnostic data is asynchronous, i.e. it stretches across several PLC cycles. The following screenshot shows a call of the DTE102_INACTIVE function block.

Figure 21

The parameters have the following meaning:

Input parameters:

Name Type Description

iarbDTE102 ANY_ARRAY_BYTE Data field of the inputs of the evaluation unit

iiChannelNo INT Channel number (1..4)

ixConnOK BOOL Ethernet/IP connection to the evaluation unit has been established

ixAckDiag BOOL Delete the displayed diagnostic data

Table 2

Output parameters:

Name Type Description

oarbDTE102 ANY_ARRAY_BYTE Data field of the outputs to the evaluation unit

oiDiagLength INT Number of the entries in the diagnostic data

oardwDiagData ARRAY[0..3] OF DWORD Array with diagnostic data (error codes see device manual DTE102)

Table 3

Page 15: Easy command interface Library descriptionThe Unity Pro library DTE102 contains a code package for a Schneider Electric Modicon M340 controller to facilitate data exchange with a DTE102

15

The input data of the evaluation unit is provided to the function block at the iarbDTE102 input parameter. The oarbDTE102 output parameter refers to the output data that is transferred to the evaluation unit. The iiChannelNo input parameter determines which channel of the evaluation unit is to be processed. The ixConnOK input parameter signals to the function block that the Ethernet/IP connection to the evaluation unit has been established. Preferably, this input parameter is to be linked to the respective connection bit (Figure 14) of the input area of the communication module. As long as the ixConnOK input parameter = FALSE, the diagnostic data displayed at the output parameters is initialised with 0. If the signal at the ixConnOK input parameter = TRUE, the function block starts to work. If the evaluation unit signals an error on the configured channel, the function block automatically adds the control signals for reading the diagnostic data to the output data to the evaluation unit. The contained diagnostic data is displayed in the oardwDiagData output parameter. The diagnostic data displayed so far is completely deleted. The oiDiagLength output parameter indicates how many diagnostic data sets are currently displayed. The error codes in the diagnostic data are described in the device manual of the evaluation unit. A rising edge on the ixAckDiag input parameter deletes the displayed diagnostic data.

6.2 The DTE102_INPUT function block

This function block can be used for a channel of the DTE102 evaluation unit configured as INPUT. It provides the following functions:

Read the digital signals on the C/Qi input

Read the digital signals on the I/Q input

Monitor the load at the L+ connection of the port

Read the diagnostic data of the channel of the evaluation unit

In every PLC cycle, the function block extracts the data of the channel from the input data of the evaluation unit and provides the data of the digital inputs of the channel at its output parameters. If a diagnosis event occurs on the channel, the diagnostic data is read automatically and it is displayed on the output parameters. Reading the diagnostic data is asynchronous and stretches across several PLC cycles. The cyclic functions of the function block are not affected. If this function block is used for a channel that is not configured as INPUT, this will lead to malfunctions of the function block. The following screenshot shows a call of the DTE102_INPUT function block.

Figure 22

The parameters have the following meaning:

Page 16: Easy command interface Library descriptionThe Unity Pro library DTE102 contains a code package for a Schneider Electric Modicon M340 controller to facilitate data exchange with a DTE102

16

Input parameters:

Name Type Description

iarbDTE102 ANY_ARRAY_BYTE Data field of the inputs of the evaluation unit

iiChannelNo INT Channel number (1..4)

ixConnOK BOOL Ethernet/IP connection to the evaluation unit has been established

ixAckDiag BOOL Delete the displayed diagnostic data

Table 4

Output parameters:

Name Type Description

oarbDTE102 ANY_ARRAY_BYTE Data field of the outputs to the evaluation unit

oxCQi BOOL Status of the digital input C/Qi

oxIQ BOOL Status of the digital input I/Q

oxOverload BOOL Overload of the voltage supply from L+

oiDiagLength INT Number of the entries in the diagnostic data

oardwDiagData ARRAY[0..3] OF DWORD Array with diagnostic data (error codes see device manual DTE102)

Table 5 The input data of the evaluation unit is provided to the function block at the iarbDTE102 input parameter. The oarbDTE102 output parameter refers to the output data that is transferred to the evaluation unit. The iiChannelNo input parameter determines which channel of the evaluation unit is to be processed. The ixConnOK input parameter signals to the function block that the Ethernet/IP connection to the evaluation unit has been established. Preferably, this input parameter is to be linked to the respective connection bit (Figure 14) of the input area of the communication module. As long as the ixConnOK input parameter = FALSE, all output parameters are initialised with 0. If the signal at the ixConnOK input parameter = TRUE, the function block starts to work. A channel of the evaluation unit configured as INPUT provides 2 digital inputs. The status of these inputs is displayed at the oxCQi and oxIQ output parameters. An overload of the voltage supply from these inputs is signalled at the oxOverload output parameter. If the evaluation unit signals an error on the configured channel, the function block automatically adds the control signals for reading the diagnostic data to the output data to the evaluation unit. The contained diagnostic data is displayed in the oardwDiagData output parameter. The diagnostic data displayed so far is completely deleted. The oiDiagLength output parameter indicates how many diagnostic data sets are currently displayed. The error codes in the diagnostic data are described in the device manual of the evaluation unit. A rising edge on the ixAckDiag input parameter deletes the displayed diagnostic data.

6.3 The DTE102_OUTPUT function block

This function block can be used for a channel of the DTE102 evaluation unit configured as OUTPUT. It provides the following functions:

Control the digital signal on the C/Qo output

Read the digital signals on the I/Q input

Page 17: Easy command interface Library descriptionThe Unity Pro library DTE102 contains a code package for a Schneider Electric Modicon M340 controller to facilitate data exchange with a DTE102

17

Activate the increased current supply of the C/Qo output (only available for channels 3 and 4)

Monitor the load at the L+ connection of the port

Read the diagnostic data of the channel of the evaluation unit

In every cycle, the function block extracts the data of the channel from the input data of the evaluation unit and provides the data of the digital input of the channel at its output parameters. The signals for the digital output of the channel are added cyclically to the output data to the evaluation unit. If a diagnosis event occurs on the channel, the diagnostic data is read automatically and it is displayed on the output parameters. Reading the diagnostic data is asynchronous and stretches across several PLC cycles. The cyclic functions of the function block are not affected. If this function block is used for a channel that is not configured as OUTPUT, this will lead to malfunctions of the function block. The following screenshot shows a call of the DTE102_OUTPUT function block.

Figure 23

The parameters have the following meaning:

Input parameters:

Name Type Description

iarbDTE102 ANY_ARRAY_BYTE Data field of the inputs of the evaluation unit

iiChannelNo INT Channel number (1..4)

ixConnOK BOOL Ethernet/IP connection to the evaluation unit has been established

ixCQo BOOL Signal for the C/Qo output

ixHighCurrent BOOL Activate the increased voltage supply of the C/Qo output

ixAckDiag BOOL Delete the displayed diagnostic data

Table 6

Page 18: Easy command interface Library descriptionThe Unity Pro library DTE102 contains a code package for a Schneider Electric Modicon M340 controller to facilitate data exchange with a DTE102

18

Output parameters:

Name Type Description

oarbDTE102 ANY_ARRAY_BYTE Data field of the outputs to the evaluation unit

oxIQ BOOL Status of the digital input I/Q

oxOverload BOOL Overload of the voltage supply from L+

oiDiagLength INT Number of the entries in the diagnostic data

oardwDiagData ARRAY[0..3] OF DWORD Array with diagnostic data (error codes see device manual DTE102)

Table 7 The input data of the evaluation unit is provided to the function block at the iarbDTE102 input parameter. The oarbDTE102 output parameter refers to the output data that is transferred to the evaluation unit. The iiChannelNo input parameter determines which channel of the evaluation unit is to be processed. The ixConnOK input parameter signals to the function block that the Ethernet/IP connection to the evaluation unit has been established. Preferably, this input parameter is to be linked to the respective connection bit (Figure 14) of the input area of the communication module. As long as the ixConnOK input parameter = FALSE, all output parameters are initialised with 0. If the signal at the ixConnOK input parameter = TRUE, the function block starts to work. A channel of the evaluation unit configured as OUTPUT provides 1 digital output and 1 digital input. The status of the input is displayed at the oxIQ output parameter. The signal at the ixCQo input parameter is entered in the output data to the evaluation unit and controls the digital output of the channel. The signal at the ixHighCurrent input parameter is only considered for channels 3 and 4 and transferred to the evaluation unit. An overload of the voltage supply from the input or the output is signalled at the oxOverload output parameter. If the evaluation unit signals an error on the configured channel, the function block automatically adds the control signals for reading the diagnostic data to the output data to the evaluation unit. The contained diagnostic data is displayed in the oardwDiagData output parameter. The diagnostic data displayed so far is completely deleted. The oiDiagLength output parameter indicates how many diagnostic data sets are currently displayed. The error codes in the diagnostic data are described in the device manual of the evaluation unit. A rising edge on the ixAckDiag input parameter deletes the displayed diagnostic data.

6.4 The DTE102_RWH_RW function block

This function block can be used for a channel of the DTE102 evaluation unit configured as RWH_RW. The data can be read from a tag or saved on a tag by means of a connected RFID antenna.

If this function block is used, the Data Hold Time parameter must be set to 0 for parameter setting of the channel (Figure 18).

The function block provides the following functions:

Detect the presence of a tag

Read the UID of a tag

Read an area of the USER memory from a tag

Write data to an area of the USER memory of a tag

Switch the antenna off and on

Read the diagnostic data of the channel of the evaluation unit

Writing the UID is not possible. The trial is acknowledged with an error message. If this function block is used for a channel that is not configured as RWH_RW, this will lead to malfunctions of the function block.

Page 19: Easy command interface Library descriptionThe Unity Pro library DTE102 contains a code package for a Schneider Electric Modicon M340 controller to facilitate data exchange with a DTE102

19

The function block extracts the data of the channel from the input data of the evaluation unit and evaluates it. Control signals for reading or writing a tag are added to the output data to the evaluation unit. If a diagnosis event occurs on the channel, the diagnostic data is read automatically and it is displayed on the output parameters. The communication has to follow a defined process. Figure 24 illustrates this on the basis of a flow chart.

Figure 24

To make command processing more user-friendly, the DTE102_RWH_RW function block was developed. This function block processes the above-mentioned command protocol automatically. The following screenshot shows a call of the DTE102_RWH_RW function block.

Figure 25

The parameters have the following meaning:

Page 20: Easy command interface Library descriptionThe Unity Pro library DTE102 contains a code package for a Schneider Electric Modicon M340 controller to facilitate data exchange with a DTE102

20

Input parameters:

Name Type Description

iarbDTE102 ANY_ARRAY_BYTE Data field of the inputs of the evaluation unit

iiChannelNo INT Channel number (channel 1 .. 4)

ixConnOK BOOL Ethernet/IP connection to the evaluation unit has been established

ixAntOff BOOL Switch off the antenna

ixUserMem BOOL Access to the USER memory of the tag

ixRead BOOL Rising edge starts reading from the tag

ixWrite BOOL Rising edge starts writing to the tag

iiRdWrStartAddr INT Start address in the USER memory of the tag for reading/writing

iiRdWrLength INT Number of bytes to be read/written

iarbSendBuf ANY_ARRAY_BYTE Area with the data to be written

Table 8

Output parameters:

Name Type Description

oarbDTE102 ANY_ARRAY_BYTE Data field of the outputs to the evaluation unit

oxBusy BOOL Function block is busy, no new command possible

oxDone BOOL Function completed without error

oxError BOOL Error detected

owStatus WORD Status information or error code (see chapter 6.4.6)

oiDiagLength INT Number of the entries in the diagnostic data

oardwDiagData ARRAY[0..3] OF DWORD Array with diagnostic data (error codes see device manual DTE102)

oxTagPresent BOOL Tag detected

oiRcvdLength INT Number of bytes read

oarbRcvBuf ANY_ARRAY_BYTE Receive buffer for the data read

Table 9

6.4.1 Build-up of the communication

The input data of the evaluation unit is provided to the function block at the iarbDTE102 input parameter; the oarbDTE102 output parameter refers to the output data that is transferred to the evaluation unit. The iiChannelNo input parameter determines which channel of the evaluation unit is to be processed.

Page 21: Easy command interface Library descriptionThe Unity Pro library DTE102 contains a code package for a Schneider Electric Modicon M340 controller to facilitate data exchange with a DTE102

21

The ixConnOK input parameter signals to the function block that the Ethernet/IP connection to the evaluation unit has been established. Preferably, this input parameter is to be linked to the respective connection bit (Figure 14) of the input area of the communication module. As long as the ixConnOK input parameter = FALSE, the oxBusy = TRUE and owStatus = 0x1000 output parameters are output. All other output parameters are initialised with 0.

Set the ixConnOK input parameter = TRUE: The communication with the configured channel of the evaluation unit is activated. The signals for the data exchange are synchronised.

The ixAntOff input parameter = FALSE activates the antenna

If the data exchange was synchronised and the antenna activated, the oxBusy = FALSE output parameter is output. The function block is now ready for the data exhange with a tag.

ixConnOK

ixAntOff

oxBusy

oxDone

oxError

owStatus 0x1000 0X2*** 0x3000 0x7000

Figure 26

6.4.2 Command processing

The DTE102_RWH_RW function block is a function block working in an asynchronous way, i.e. processing stretches across several function block calls. The processing state of the function block is displayed on the owStatus output parameter. As long as the connected antenna detects a tag, the oxTagPresent output parameter is set. If the function block displays FALSE at the oxBusy output parameter, it is ready for a new command.

Define via the ixUserMem input parameter, if the USER memory or the UID of the tag should be accessed.

Indicate the USER memory area in the iiRdWrStartAddr and iiRdWrLength input parameters.

A rising edge on the ixRead or ixWrite input parameter starts reading of or writing to the tag. The displayed diagnostic data is deleted and the receive buffer defined at the oarbRcvBuf output parameter is initialised.

During processing the oxBusy output parameter is TRUE. The progress of command processing is displayed in the owStatus output parameter. With completion of the command, the oxBusy = FALSE output parameter is output. The result of processing is indicated in the oxDone and oxError output parameters. It is kept as long as the triggering ixRead or ixWrite input parameter is TRUE, min. however for one PLC cycle. The result is displayed as follows:

No error occurred during processing: oxDone = TRUE oxError = FALSE owStatus = 0x0000 oiRcvdLength = indicates the number of the data read The data read is stored in the receive buffer defined by the oarbRcvBuf output parameter.

Error occurred during processing oxDone = FALSE

Page 22: Easy command interface Library descriptionThe Unity Pro library DTE102 contains a code package for a Schneider Electric Modicon M340 controller to facilitate data exchange with a DTE102

22

oxError = TRUE owStatus indicates an error code. The possible error codes are listed in Table 11.

As an example, the signal characteristics are shown in Figure 27.

No error occurred

Error occurred

ixConnOK

ixRead

oxBusy

oxDone

oxError

owStatus

0x70

00

0x7*

**

0x00

00

0x70

00

0x7*

**

0x00

00

0x70

00

0x7*

**

0x8*

**

0x70

00

0x7*

**

0x8*

**

0x70

00

Figure 27 If the evaluation unit signals an error on the configured channel, the function block automatically adds the control signals for reading the diagnostic data to the output data to the evaluation unit. The contained diagnostic data is displayed in the oardwDiagData output parameter. The diagnostic data displayed so far is completely deleted. The oiDiagLength output parameter indicates how many diagnostic data sets are currently displayed. The error codes in the diagnostic data are described in the device manual of the evaluation unit.

6.4.3 Read the UID of the tag

How the function block provides the tag's UID depends on the configuration of the channel (Figure 18).

Channel parameter Edge Controlled UID Read not activated:

Set the ixUserMem input parameter = FALSE

If the antenna detects a tag (oxTagPresent = TRUE), its UID is provided in the receive buffer. The length of the UID is displayed at the oiRcvdLength output parameter. This data is deleted if the tag leaves the antenna field or if the ixUserMem input parameter is set = TRUE.

Channel parameter Edge Controlled UID Read activated:

Set the ixUserMem input parameter = FALSE

A rising edge on the ixRead input parameter starts reading of the tag's UID.

After termination without error, the oxDone output parameter is set and the UID is provided in the input area. The length of the UID is displayed at the oiRcvdLength output parameter. This data is kept as long as the oxDone output parameter remains set (see chapter 6.4.2).

Page 23: Easy command interface Library descriptionThe Unity Pro library DTE102 contains a code package for a Schneider Electric Modicon M340 controller to facilitate data exchange with a DTE102

23

6.4.4 Read an area of the USER memory of the tag

An area of the tag's USER memory is read as follows:

Set the ixUserMem input parameter to TRUE

Indicate the address in the USER memory of that tag as from where reading is to be effected at the iiRdWrStartAddr input parameter

Set the number of the bytes to be read at the iiRdWrLength input parameter

The rising edge at the ixRead input parameter adopts the iiRdWrStartAddr and iiRdWrLength input parameters and starts reading from the tag.

The data read by the tag is stored in the receive buffer. If the indicated data length cannot be transferred within one single read cycle, the function block automatically carries out several read cycles with the corresponding address offsets in the source and target buffer. That means that the length of the data to be read is only limited by the receive buffer indicated and the memory of the tag. On completion of the command, the result of processing is displayed (see chapter 6.4.2). The total length of the data is displayed in the oiRcvdLength output parameter. The data is kept as long as the oxDone output parameter is set.

6.4.5 Write an area of the USER memory of the tag

An area of the USER memory of a tag is written on as follows:

Set the ixUserMem input parameter to TRUE

Enter the data to be written in the send buffer set at the iarbSendBuf input parameter

Indicate the address in the USER memory of the tag as from where the data is to be written at the iiRdWrStartAddr input parameter

Set the number of bytes to be transferred at the iiRdWrLength input parameter

The rising edge at the ixWrite input parameter adopts the iiRdWrStartAddr and iiRdWrLength input parameters and starts writing on the tag memory.

If the indicated data length cannot be transferred within one single write cycle, the function block automatically carries out several write cycles with the corresponding address offsets in the source and target buffer. That means that the length of the data to be written is only limited by the transmit buffer indicated and the memory of the tag.

The data in the send buffer must not be changed while the command is being processed.

On completion of the command, the result of processing is displayed (see chapter 6.4.2).

Page 24: Easy command interface Library descriptionThe Unity Pro library DTE102 contains a code package for a Schneider Electric Modicon M340 controller to facilitate data exchange with a DTE102

24

6.4.6 Displays at the owStatus output parameter

Status displays

owStatus Description

0x0000 Function completed without error

0x1000 Waiting for ixConnOK input parameter = TRUE

0x2000

0x2101 0x2102 0x2103

0x2201 0x2202 0x2203

0x2402 0x2403

Check start-up signals for the data exchange

Activate the start-up of the USER memory mode Synchronise the start-up of "read USER memory" Complete the start-up of "read USER memory"

Activate the start-up of the USER memory mode Synchronise the start-up of "write USER memory" Complete the start-up of "write USER memory"

Synchronise the start-up of "read diagnostic data" Complete the start-up of "read diagnostic data"

0x3000 Wait for ixAntOff input parameter = FALSE

0x7000

0x7101 0x7102 0x7103

0x7201 0x7202 0x7203

0x7301 0x7302 0x7303

0x7401 0x7402 0x7403

Wait for the start of a command

Activate the USER memory mode Read the USER memory Complete reading of the USER memory

Activate the USER memory mode Write to the USER memory Complete writing to the USER memory

Activate the UID access Read UID Complete reading UID

Complete change to USER memory or UID Read diagnostic data Complete reading the diagnostic data

0x8*** Error code (see Table 11)

Table 10

Page 25: Easy command interface Library descriptionThe Unity Pro library DTE102 contains a code package for a Schneider Electric Modicon M340 controller to facilitate data exchange with a DTE102

25

Error codes

owStatus Description

0x8000 Evaluation unit indicates an error; evaluate the diagnostic data in the oardwDiagData output parameter.

0x8101 0x8102 0x8103 0x8104 0x8105 0x8106

iiChannelNo input parameter invalid iarbDTE102 input parameter invalid oarbDTE102 input parameter invalid Different sizes of the iarbDTE102 input parameter and oarbDTE102 output parameter iarbSendBuf input parameter invalid oarbRcvBuf output parameter invalid

0x8201 0x8202

ixConnOK input parameter = FALSE during data transmission Timeout; evaluation unit does not react

0x8301 0x8302 0x8303 0x8304 0x8305 0x8306 0x8307

Start of a command while the function block is busy (oxBusy = TRUE) Start of a command with antenna switched off (ixAntOff = TRUE) Simultaneous start of the read and write command Start of a command without tag in the antenna field iiRdRwLength input parameter <= 0 or greater than the defined receive buffer (oarbRcvBuf) iiRdRwLength input parameter <= 0 or greater than the defined send buffer (iarbSendBuf) Write UID is not supported by the system

0x8401 (oarbRcvBuf) receive buffer too small for cyclically read UID

Table 11