20
PIB "Proxy Ident Block" SIMOTION in connection with the interface module ASM 456 and the write / read device (SLG) Moby D using the FB “PIB“ (Proxy Ident Block)

PIB Proxy Ident Block - Siemens AG · PIB "Proxy Ident Block" SIMOTION in connection with the interface ... “CPU_HD.upd”. As shown in the figure 2-14, if the checkbox "Activate

  • Upload
    buinhu

  • View
    218

  • Download
    1

Embed Size (px)

Citation preview

Page 1: PIB Proxy Ident Block - Siemens AG · PIB "Proxy Ident Block" SIMOTION in connection with the interface ... “CPU_HD.upd”. As shown in the figure 2-14, if the checkbox "Activate

PIB "Proxy Ident Block"

SIMOTION in connection with the interface module ASM 456 and the write / read device (SLG) Moby D using the FB “PIB“ (Proxy Ident Block)

Page 2: PIB Proxy Ident Block - Siemens AG · PIB "Proxy Ident Block" SIMOTION in connection with the interface ... “CPU_HD.upd”. As shown in the figure 2-14, if the checkbox "Activate

General Notes

PIB "Proxy Ident Block"

Version 1.0 16.04.2007 2/20

Cop

yrig

ht ©

Sie

men

s A

G 2

007

All

right

s re

serv

ed

We reserve the right to make technical changes to this product.

Copyright Reproduction, transmission or use of this document or its contents is not permitted without express written authority. Offenders will be liable for damages. All rights, including rights created by patent grant or registration or a utility model or design, are reserved.

Page 3: PIB Proxy Ident Block - Siemens AG · PIB "Proxy Ident Block" SIMOTION in connection with the interface ... “CPU_HD.upd”. As shown in the figure 2-14, if the checkbox "Activate

General Notes

PIB "Proxy Ident Block"

Version 1.0 16.04.2007 3/20

Cop

yrig

ht ©

Sie

men

s A

G 2

007

All

right

s re

serv

ed

General Notes

Note The Application Examples are not binding and do not claim to be complete regarding the circuits shown, equipping and any eventuality. The Application Examples do not represent customer-specific solutions. They are only intended to pro-vide support for typical applications. You are responsible in ensuring that the de-scribed products are correctly used. These Application Examples do not relieve you of the responsibility in safely and professionally using, installing, operating and servicing equipment. When using these Application Examples, you recognize that Siemens cannot be made liable for any damage/claims beyond the liability clause described. We reserve the right to make changes to these Application Examples at any time without prior notice. If there are any deviations between the recommendations provided in these Application Examples and other Siemens publications - e.g. Catalogs - then the contents of the other documents have priority.

Warranty, liability and support We do not accept any liability for the information contained in this document.

Any claims against us - based on whatever legal reason - resulting from the use of the examples, information, programs, engineering and performance data etc., described in this Application Examples shall be excluded. Such an exclusion shall not apply in the case of mandatory liability, e.g. under the German Product Liability Act (“Produkthaftungsgesetz”), in case of intent, gross negligence, or injury of life, body or health, guarantee for the quality of a product, fraudulent concealment of a deficiency or breach of a condition which goes to the root of the contract (“wesentliche Vertragspflichten”). However, claims arising from a breach of a condition which goes to the root of the contract shall be limited to the foreseeable damage which is intrinsic to the contract, unless caused by intent or gross negligence or based on mandatory liability for injury of life, body or health The above provisions does not imply a change in the burden of proof to your detriment.

Copyright© 2007 Siemens A&D. It is not permissible to transfer or copy these standard applications or excerpts of them without first having prior authorization from Siemens A&D in writing. For questions regarding this application please contact us at the following e-mail address:

mailto:[email protected]

Page 4: PIB Proxy Ident Block - Siemens AG · PIB "Proxy Ident Block" SIMOTION in connection with the interface ... “CPU_HD.upd”. As shown in the figure 2-14, if the checkbox "Activate

General Notes

PIB "Proxy Ident Block"

Version 1.0 16.04.2007 4/20

Cop

yrig

ht ©

Sie

men

s A

G 2

007

All

right

s re

serv

ed

Qualified personnel In the sense of this documentation qualified personnel are those who are knowledgeable and qualified to mount/install, commission, operate and service/maintain the products which are to be used. He or she must have the appropriate qualifications to carry-out these activities

e.g.:

• Trained and authorized to energize and de-energize, ground and tag circuits and equipment according to applicable safety standards.

• Trained or instructed according to the latest safety standards in the care and use of the appropriate safety equipment.

• Trained in rendering first aid.

There is no explicit warning information in this documentation. However, reference is made to warning information and instructions in the Operating Instructions for the particular product.

Reference regarding export codes AL: N

ECCN: N

Page 5: PIB Proxy Ident Block - Siemens AG · PIB "Proxy Ident Block" SIMOTION in connection with the interface ... “CPU_HD.upd”. As shown in the figure 2-14, if the checkbox "Activate

Table of Contents

PIB "Proxy Ident Block"

Version 1.0 16.04.2007 5/20

Cop

yrig

ht ©

Sie

men

s A

G 2

007

All

right

s re

serv

ed

Table of Contents 1 Question .......................................................................................................... 6

2 Solution ........................................................................................................... 7 2.1 SIMOTION SCOUT Project .............................................................................. 7 2.1.1 Hardware Configuration.................................................................................... 7 2.1.2 I/O Variables ................................................................................................... 14 2.1.3 Execution System ........................................................................................... 14 2.1.4 ASM 456 Parameterization commands .......................................................... 15 2.1.5 Example description ....................................................................................... 16 2.1.6 Example execution ......................................................................................... 18

Appendix ..................................................................................................................... 20

3 Project data ................................................................................................... 20

4 Glossary ........................................................................................................ 20

5 Literature/references .................................................................................... 20

Page 6: PIB Proxy Ident Block - Siemens AG · PIB "Proxy Ident Block" SIMOTION in connection with the interface ... “CPU_HD.upd”. As shown in the figure 2-14, if the checkbox "Activate

Question

Version 1.0 16.04.2007 6/20

Cop

yrig

ht ©

Sie

men

s A

G 2

007

All

right

s re

serv

ed

1 Question

The main goal of this FAQ document is to help using the function block PIB (Proxy Ident Block) on the SIMOTION in order to write and read data on a Mobile Data Memory by means of the interface module ASM 456 and the write / read device Moby D.

Overview The following diagram shows the general dataflow between SIMOTION and the Mobile Data Memory (MDS, from the German term abbreviation: Mobile DatenSpeicher).

Figure 1-1 Dataflow between SIMOTION and the Mobile Data Memory

System requirements The program was tested with the following software. Table 1-1

Component Version

SIMATIC STEP 7 (Software) V5.4 SIMOTION SCOUT (Software) V4.0 ASM 456 (Hardware) V3.2

SIMOTION

FB PIB

ASM 456

MOBY D

MDS 1Kb

Write data Read data

Page 7: PIB Proxy Ident Block - Siemens AG · PIB "Proxy Ident Block" SIMOTION in connection with the interface ... “CPU_HD.upd”. As shown in the figure 2-14, if the checkbox "Activate

Solution

Version 1.0 16.04.2007 7/20

Cop

yrig

ht ©

Sie

men

s A

G 2

007

All

right

s re

serv

ed

2 Solution

A small SIMOTION SCOUT Project will be used in order to exemplify the mentioned function block. This document contains a description of the SIMOTION SCOUT project, its hardware configuration and a short explanation of three commands used for the parameterization of the interface module ASM 456.

The following project description and screen shots were done using SIMOTION SCOUT with English language.

2.1 SIMOTION SCOUT Project

This SIMOTION SCOUT project consists of a ST (Structured Text) unit, which is independent of the SIMOTION SCOUT version and can be changed and parameterized according to the hardware used. This ST unit contains three programs (pib_program, pib_techf und pib_perif). In order to carry out this example, the commands will be given using the symbol browser.

2.1.1 Hardware Configuration

Open a new project in SIMOTION SCOUT and create a new device according to the hardware available. Open the HW Configuration of the device (right click on the device and Open HW Configuration) and proceed with the corresponding steps to set the hardware configuration.

2.1.1.1 Installing GSD File

In order to select the ASM 456 in the HW Configuration, the appropriate GSD-File (e.g. SIEM8114.GSD for German language) must be installed otherwise the ASM 456 will not be displayed in the device catalog. The GSD file can be found on the RFID Systems Software & Documentation CD.

Select the option Install GSD File under Menu options Install GSD file and select the file as shown in the following figure.

Page 8: PIB Proxy Ident Block - Siemens AG · PIB "Proxy Ident Block" SIMOTION in connection with the interface ... “CPU_HD.upd”. As shown in the figure 2-14, if the checkbox "Activate

Solution

Version 1.0 16.04.2007 8/20

Cop

yrig

ht ©

Sie

men

s A

G 2

007

All

right

s re

serv

ed

Figure 2-1 Install GSD File in the HW Configuration

Figure 2-2 Selection of the GSD File

2.1.1.2 Adding the ASM 456 Interface module and setting the PROFIBUS Address

After the GSD file installation, the ASM 456 interface module must be added in the hardware configuration. In order to do that, a master system must be added in the PROFIBUS interface used to connect the ASM 456 to SIMOTION. In this example, the master system will be added to the DP2 / MPI Interface.

Page 9: PIB Proxy Ident Block - Siemens AG · PIB "Proxy Ident Block" SIMOTION in connection with the interface ... “CPU_HD.upd”. As shown in the figure 2-14, if the checkbox "Activate

Solution

Version 1.0 16.04.2007 9/20

Cop

yrig

ht ©

Sie

men

s A

G 2

007

All

right

s re

serv

ed

Figure 2-3 Adding a Master System

Figure 2-4 System added to the DP2/MPI interface

The next step is to drag and drop the ASM 456 into the PROFIBUS (1): DP master system (2). Figure 2-5 Interface Module ASM 456 selection from the Hardware catalog

Page 10: PIB Proxy Ident Block - Siemens AG · PIB "Proxy Ident Block" SIMOTION in connection with the interface ... “CPU_HD.upd”. As shown in the figure 2-14, if the checkbox "Activate

Solution

Version 1.0 16.04.2007 10/20

Cop

yrig

ht ©

Sie

men

s A

G 2

007

All

right

s re

serv

ed

After dropping the ASM 456 into the PROFIBUS (1): DP master system (2), the next window for the PROFIBUS address will appear: Figure 2-6 Setting PROFIBUS address to the ASM 456

The PROFIBUS address defines the station address at which the ASM 456 distributed I/O system is found on the PROFIBUS DP. This PROFIBUS address must match the PROFIBUS address set in the connection block. The connection block used in this example is ECOFAST and its PROFIBUS address can be set as follows:

1. Loosen the screw connection of the configuration plug with the ECOFAST connection block and remove the plug.

Figure 2-7 Loosening the configuration plug

2. Loosen the screw connection for the cover cap on the configuration

plug and remove the latter.

Page 11: PIB Proxy Ident Block - Siemens AG · PIB "Proxy Ident Block" SIMOTION in connection with the interface ... “CPU_HD.upd”. As shown in the figure 2-14, if the checkbox "Activate

Solution

Version 1.0 16.04.2007 11/20

Cop

yrig

ht ©

Sie

men

s A

G 2

007

All

right

s re

serv

ed

3. Set the PROFIBUS address using the DIL switches. In this example, set the address to 5.

Figure 2-8 Setting PROFIBUS address on configuration plug

4. Screw the cover cap back down, plug the configuration plug onto the connection block and screw the configuration plug to the connection block.

Note that changes to the PROFIBUS DP address only takes effect after switching on the ASM 456 interface module.

For more information regarding another connection blocks, read the Operating instructions: SIMATIC Sensors, RFID systems and ASM 456 interface module.

After setting the PROFIBUS address on configuration block, some properties have to be set on the ASM 456.

Figure 2-9 Parameter Assignment

Double click on the ASM 456 Interface module and select under "Parameter Assignment" - "Device-specific Parameters". Then set:

"USER-Mode" "RFID standard profile" (in German: "RFID Normprofil")

"MOBY-Mode" "MOBY U/D/RF300 normal addressing"

Page 12: PIB Proxy Ident Block - Siemens AG · PIB "Proxy Ident Block" SIMOTION in connection with the interface ... “CPU_HD.upd”. As shown in the figure 2-14, if the checkbox "Activate

Solution

Version 1.0 16.04.2007 12/20

Cop

yrig

ht ©

Sie

men

s A

G 2

007

All

right

s re

serv

ed

Figure 2-10 Parameter assignment ASM 456

After the parameter assignment, drag and drop the Word: 2 IN/OUT DP-V1 module, and set the start address of the input / output area to 600.

Figure 2-11 2 IN/OUT DP- V1 module

Page 13: PIB Proxy Ident Block - Siemens AG · PIB "Proxy Ident Block" SIMOTION in connection with the interface ... “CPU_HD.upd”. As shown in the figure 2-14, if the checkbox "Activate

Solution

Version 1.0 16.04.2007 13/20

Cop

yrig

ht ©

Sie

men

s A

G 2

007

All

right

s re

serv

ed

Figure 2-12 Address assignment

2.1.1.3 Firmware update ASM 456

The firmware of the ASM 456 can be updated via PROFIBUS. The update takes place via the HW Config. For this purpose, the required update files (.upd) must be copied to a folder, and the ASM 456 selected in the hardware configuration. The required update files can be found on the RFID Systems Software & Documentation CD. The folder can be selected in the HW Config under PLCs Firmware. From the three files: “456v32.upd, “bg_abl.upd” and “CPU_HD.upd”, select the file “CPU_HD.upd”. As shown in the figure 2-14, if the checkbox "Activate firmware after loading” is checked, the Firmware will be activated automatically after the download otherwise the ASM 456 has to be switched off and on in order to activate the new Firmware. Figure 2-13 Firmware update

Page 14: PIB Proxy Ident Block - Siemens AG · PIB "Proxy Ident Block" SIMOTION in connection with the interface ... “CPU_HD.upd”. As shown in the figure 2-14, if the checkbox "Activate

Solution

Version 1.0 16.04.2007 14/20

Cop

yrig

ht ©

Sie

men

s A

G 2

007

All

right

s re

serv

ed

Figure 2-14 Firmware file selection

2.1.2 I/O Variables

After setting the hardware configuration and activating the firmware on the ASM 456, create the following I/O-variables in the SIMOTION SCOUT project:

• i_pib: PIB 600: Array 4 ("PIB": Peripheral Input: Byte)

• q_pib: PQB 600: Array 4 ("PQB": Peripheral Output: Byte)

The 600 is the I/O address, which was set in the HW Config and is independent from the PROFIBUS address. Figure 2-15 Input / Output Variables on the SCOUT Project

2.1.3 Execution System

The name of the ST unit used in this project is: ASM_PIB. This ST unit contains three programs, which will be assigned to the execution system of SIMOTION in the following way:

• BackgroundTask

o ASM_PIB.pib_program

Page 15: PIB Proxy Ident Block - Siemens AG · PIB "Proxy Ident Block" SIMOTION in connection with the interface ... “CPU_HD.upd”. As shown in the figure 2-14, if the checkbox "Activate

Solution

Version 1.0 16.04.2007 15/20

Cop

yrig

ht ©

Sie

men

s A

G 2

007

All

right

s re

serv

ed

• TechnologicalFaultTask

o ASM_PIB.pib_techf

• PeripheralFaultTask

o ASM_PIB.pib_perif

2.1.4 ASM 456 Parameterization commands

The function blocks PIB (PIB_1kb, PIB_16kb, PIB_32kb) support different commands, which are used depending on the Moby mode and on the desired application. In this example, the following three commands will be used: “WRITE_CONFIG”, “PHYSICAL WRITE” and “PHYSICAL READ”. For more information about the commands supported by the PIB functions blocks, read the following Handbooks:

• Functions Handbook SIMATIC Sensors, RFID - Systems, RFID – Normprofile; Standard Function for RFID – Systems

• Functions Handbook SIMOTION, Standard functions for RFID-Systems.

2.1.4.1 Write Config

The WRITE-CONFIG command is used to parameterize the operation of the communication module, in this case the interface module The configuration data is set on the module using the transmit buffer. The configuration data is manufacturer-specific. The command WRITE CONFIG is usually called automatically from the FB, while the command INIT is executed. This command can be called using the EXECUTE parameter as well. Note that the command WRITE CONFIG must be the first command in the command buffer, if it is called using the command INIT.

The following variables will be used in order to execute the WRITE CONFIG command:

• ASM456_D_NA_WC_LEN

ASM 456 Moby D Normal Addressing Write Config Length

• ASM456_D_NA_WC_DAT

ASM 456 Moby D Normal addressing Write Config Data

In this example, the variables values will be set as follows:

ASM456_D_NA_WC_LEN:= 16;

ASM456_D_NA_WC_DAT: =

[ 4 , 0 , 0 , 0 , 0 , 16#0A , 0 , 0 , 0 , 16#25 , 2 , 16#02 , 0 , 1 , 0 , 1 ]

Page 16: PIB Proxy Ident Block - Siemens AG · PIB "Proxy Ident Block" SIMOTION in connection with the interface ... “CPU_HD.upd”. As shown in the figure 2-14, if the checkbox "Activate

Solution

Version 1.0 16.04.2007 16/20

Cop

yrig

ht ©

Sie

men

s A

G 2

007

All

right

s re

serv

ed

Please note that these configuration data correspond to the Tag – Type MOBY D. In order to use other Tags, the configuration data must be modified.

2.1.4.2 Physical Write

The PHYSICAL WRITE command writes data on a MDS. This command uses the physical start address and the length of the data to be written.

2.1.4.3 Physical Read

The PHYSICAL READ command reads data from the MDS. This command uses the physical star address and the length of the data to be read. The output parameter TRLEN shows the number of the received bytes.

2.1.5 Example description

In this example, the function block _pib_001kb will be used in order to exchange data between SIMOTION and a Mobile Data Memory (MDS), using the interface module ASM 456 and the write/read device (SLG) MOBY D. This function block is needed for a MDS of 1kb. For using another MDS (16kb or 32kb) the following variables have to be set accordingly:

• PIB_TX_BUFFER_LEN_1024

• PIB_RX_BUFFER_LEN_1024

• iTagDataLength

The procedure of exchanging data (writing and reading) between SIMOTION and the MDS can be explained in the following way:

Write Config: First of all, the FB PIB must be initialised after startup. This is done by executing the command "INIT". Note that the command "INIT" comprises setting the PIB input parameter "init" to true and executing the PIB command "WRITE_CONFIG". Before executing INIT, the manufacturer specific data (i.e. the CONFIG data) must be stored into the transmit buffer. After setting "geCommand" and "gboExecuteCmd " you must wait until the variable " gboCmdDone " is true. This flag signals that the command was run successfully. Otherwise the variable "gboError" will be true, and the FB output parameter "errorID" has to be read for appropriate program control. After the command INIT ran successfully, the device is ready to process other commands.

Writing data: A string variable (gsgMDSData_W) will be typed in SIMOTION SCOUT. This string variable will be converted into an array of byte. This array will be written into the transmit buffer and finally sent to the MDS via the interface module ASM 456 and the write / read device Moby D. This procedure will be done by executing the command “cmdPhWrite” in the example program.

Page 17: PIB Proxy Ident Block - Siemens AG · PIB "Proxy Ident Block" SIMOTION in connection with the interface ... “CPU_HD.upd”. As shown in the figure 2-14, if the checkbox "Activate

Solution

Version 1.0 16.04.2007 17/20

Cop

yrig

ht ©

Sie

men

s A

G 2

007

All

right

s re

serv

ed

Reading data: A byte array will be read from the MDS and converted into a string variable (gsgMDSData_R). This procedure will be done by executing the command “cmdPhRead” in the example program.

As mentioned in before, the following three commands will be used in order to carry out this example: “WRITE_CONFIG”, “PHYSICAL WRITE” and “PHYSICAL READ”. These commands are represented in the program with the following enum command names:

WRITE_CONFIG = cmdInit

PHYSICAL WRITE = cmdPhWrite

PHYSICAL READ = cmdPhRead

These commands will be controlled by means of the symbol browser of SIMOTION SCOUT. Each command can be selected by setting the parameter “geCommand” to the command to be executed. Finally the selected command will be executed by changing the parameter “gboExecuteCmd” to TRUE.

For example, to start the command "PHYSICAL WRITE":

Set: geCommand = cmdPhWrite

gboExecuteCmd = TRUE

2.1.5.1 Name convention for variables

The name of the variables used in this example was given according to a specific programming guideline. For more information about this guideline, read SIMOTION Applications and Standard Functions Using Structured Text (ST).

First character: ‘g’ Project - global variable

Second / third character: ‘e’ enumeration type

‘bo’ bool variable

‘sg’ string variable

‘dw’ DWORD variable

‘i’ integer variable

For example:

geCommand : global variable “Command”, which accepts a “enumeration” value.

Page 18: PIB Proxy Ident Block - Siemens AG · PIB "Proxy Ident Block" SIMOTION in connection with the interface ... “CPU_HD.upd”. As shown in the figure 2-14, if the checkbox "Activate

Solution

Version 1.0 16.04.2007 18/20

Cop

yrig

ht ©

Sie

men

s A

G 2

007

All

right

s re

serv

ed

2.1.6 Example execution

Now, the example project is ready to be tested. Go to the online mode with SIMOTION, download the project and set the device operating mode to RUN.

The first command to execute is Write Config (cmdInit). Using the symbol browser, set:

geCommand = cmdInit, gboExecuteCmd = TRUE Figure 2-16 Commands in the symbol browser

Wait until “gboCmdDone” is TRUE. This flag signals that the command was executed successfully. After that, the commands write and read can be executed.

Figure 2-17 gboCmdDone

To execute the command PHYISCAL WRITE, type the desired text in the string variable: gsgMDSData_W. Then set:

geCommand = cmdPhWrite, gboExecuteCmd = TRUE

Then wait until “gboCmdDone” is true. It means that the command was executed successfully and the data was written on the MDS.

Page 19: PIB Proxy Ident Block - Siemens AG · PIB "Proxy Ident Block" SIMOTION in connection with the interface ... “CPU_HD.upd”. As shown in the figure 2-14, if the checkbox "Activate

Solution

Version 1.0 16.04.2007 19/20

Cop

yrig

ht ©

Sie

men

s A

G 2

007

All

right

s re

serv

ed

Figure 2-18 Command PHYISCAL WRITE

In a similar way, the command PHYSICAL READ can be executed:

geCommand = cmdPhRead, gboExecuteCmd = TRUE

Wait until “gboCmdDone” is true. The read data will be displayed on the variable: gsgMDSData_R. Figure 2-19 Command PHYSICAL READ

Page 20: PIB Proxy Ident Block - Siemens AG · PIB "Proxy Ident Block" SIMOTION in connection with the interface ... “CPU_HD.upd”. As shown in the figure 2-14, if the checkbox "Activate

Project data

Version 1.0 16.04.2007 20/20

Cop

yrig

ht ©

Sie

men

s A

G 2

007

All

right

s re

serv

ed

Appendix

3 Project data

The SIMOTION SCOUT example is enclosed to this document.

4 Glossary

PIB Proxy Ident Block

MDS Mobile Data Memory (Tag) (German term: Mobile DatenSpeicher)

SLG Write / Read Device (Reader) (German term: Schreib-LeseGerät)

5 Literature/references

Literature/references This list is in no way complete and only reflects a selection of suitable literature. Table 5-1

Subject Title /1/ RFID Systems

with SIMATIC Functions Handbook SIMATIC Sensors, RFID - Systems, RFID – Normprofile; Standard Function for RFID – Systems.

/2/ ASM 456 Interface Module

Operating instructions: SIMATIC Sensors, RFID systems and ASM 456 interface module.

/3/ RFID – Systems with SIMOTION

Functions Handbook SIMOTION, Standard Functions for RFID – Systems

/4/ ST Styleguide SIMOTION Applications and Standard Functions Using Structured Text (ST)