Siemens S7-300F-2 PN, DP manual Task, Supplementing the symbol table, Generating FB1

Page 55

Industry Automation and Drive Technologies - SCE

5.12FB1 Control Program

It is now possible to generate the control program with the completed blocks.

Task:

In our sample program, two command strings with two requests each will be processed.

With the START_SLG1 (I0.0), the command chain of the first reader is executed.

First, the MDS status information will be read, and then a write command is carried out on Reader1. With Reader1, we write 8 bytes that are stored in DB48 starting with DBB0 to the MDS. With the RESET_SLG1 (I0.1), the error is reset if there is an error (LED at Reader1 flashes red) and a “init_run command“ to reset the first reader is executed.

With the RF300_ISO (I02), switching between MDS types (for example RF360T) or ISO transponder (for example, Moby D ISO) is to be carried out on the first reader (RF310R).

With the START_SLG2 (I1.0), the command string of the second reader is executed.

First, the MDS diagnosis information will be read and then a read command will be executed at Reader2. With Reader2, we read 8 bytes from the transponder and then write them to DB48 starting with DBB50.

With RESET_SLG2 (I1.1) the error is reset if there is an error (LED at SLG2 flashes red) and a “init_run command“ is executed to reset the second reader.

In addition, the attendance time of the transponders is to be recorded on the readers.

Supplementing the symbol table

Symbol

Address

 

Data

Comment

 

 

 

Type

 

START_SLG1

I

0.0

BOOL

Command start of Reader1

RESET_SLG1

I

0.1

BOOL

Reset Reader1 error

RF300_ISO

I

0.2

BOOL

Value 0 = RF300, Value 1 = ISO

START_SLG2

I

1.0

BOOL

Command start of SLG2

RESET_SLG2

I

1.1

BOOL

Reset Reader2 error

AWZ_SLG1

MD

40

TIME

Attendance time of transponder at SLG1

AWZ_SLG2

MD

50

TIME

Attendance time of transponder at SLG2

STATUS_SLG_1

VAT

1

 

SLG1 variable table

STATUS_SLG_2

VAT

2

 

SLG2 variable table

Generating FB1

Set up a new FB1.

TIA Training Document

Page 55 of 65

Module E11

 

Status: 01/2010

Radio Frequency Identification (RFID) with SIMATIC S7-300F-2PN/DP and

RF180C

 

Image 55
Contents Industry Automation and Drive Technologies SCE Module E11Industry Automation and Drive Technologies SCE Preface Page Objective S7’Prerequisites Simatic RF180C ASM Industry Automation and Drive Technologies SCE CPU Rfid Fundamentals DB47 Data structure of the German language UDTs is as followsPage Industry Automation and Drive Technologies SCE Page Industry Automation and Drive Technologies SCE Industry Automation and Drive Technologies SCE Value range for the address of the gateway router Industry Automation and Drive Technologies SCE MAC addressValue range for the IP address Value range for the subnet screen formIndustry Automation and Drive Technologies SCE Industry Automation and Drive Technologies SCE Industry Automation and Drive Technologies SCE Page Page Page Save and close DB48 Generating DB48 Open DB48, set up 1024 bytesGenerating DB49 Open DB49 and insert UDT261 and UDT271 Page Generating DB50 Open DB50 and insert UDT111 and UDT281 Save and close DB50 Generate DB47 Open DB47 and add UDT21 for each request Save and close DB47 DB45, UDT11 is called for each reader Generating DB45 Open DB45 and insert UDT11 for each readerData view of DB45 to byte DB47 request data block is referred to in DB45Save and close DB45 Page Generating Function FC11 Set up in variables Set up OUT variablesSave and close FC11 Reading data from the transponder Data View of the UDT21 Command OverviewCommand Writing data to the transponderRead out Reader status Command NextCommand END Initialize TransponderTransponder Status Switching the reader aerial on/offExample of a command string in DB47 Data view of the UDT11 Variable Description Parameter commandDBaddress Value = 50 for Reader2 507 Industry Automation and Drive Technologies SCE ISO MDS Page Page Industry Automation and Drive Technologies SCE Variable Description Control bits from Bit8 to Bit15Moby U/D or RF300 Generating FB10 Then, set up in variables Next, set up OUT variablesReader block Network 1 Command start Network 2 Reset Reader Industry Automation and Drive Technologies SCE Networks 4 to Page Task Supplementing the symbol tableGenerating FB1 Industry Automation and Drive Technologies SCE FB10 is inserted as a multi-instance block Industry Automation and Drive Technologies SCE Network Industry Automation and Drive Technologies SCE Network 4 to Page Open OB1 and call FB1 with DB1 Page Page Industry Automation and Drive Technologies SCE Symbol Table