19.08.2013 Views

Safety Integrated - Industry - Siemens

Safety Integrated - Industry - Siemens

Safety Integrated - Industry - Siemens

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Sample Code<br />

Preliminary Remarks<br />

Enclosed, we offer you the STEP 7 project as sample code with<br />

which you can reset the functionality described here.<br />

The sample code is always assigned to the components used<br />

in the functional examples and implements the required functionality.<br />

Problems not dealt with in this document are to be<br />

realized by the user; the sample code may serve as a basis.<br />

Password<br />

In all cases, the passwords used for the safety-relevant part is<br />

„siemens“.<br />

Use of the STEP 7 project<br />

The STEP 7 project enables you to safely monitor the connection<br />

with the laser scanner LS4. If the LS4 recognizes a safety<br />

zone violation, the fail-safe S7-CPU switches the output channel<br />

at the actuator (here: indicator light) safely off.<br />

Download the STEP 7 project<br />

To call the corresponding project file, open the<br />

"as_fe_i_010_v10_code_clscanner.zip" file offered as a separate<br />

download (on the HTML page) and extract it into a user<br />

defined directory.<br />

For downloading the project into the F-CPU please proceed as<br />

follows:<br />

■ First load the hardware configuration into the S7-CPU<br />

■ Switch to the SIMATIC Manager.<br />

■ Select the "Blocks" container.<br />

■ Menu "Options" -> Edit safety program.<br />

■ Click the "Download" button.<br />

The sample code with the given configurations enables the<br />

following:<br />

■ Connecting a laser scanner to a fail-safe S7-CPU via<br />

PROFIBUS DP<br />

■ Switching between two prepared zone pairs (SZ1/WZ1 and<br />

SZ2/WZ2)<br />

Download of the LS4Soft project<br />

For parameterizing the LS4 project, please load the sample<br />

project as_fe_i_010_v10_code_plscanner.ls to the LS4 (instructions<br />

are available on page 302 under „Configuration and<br />

diagnosis software LS4Soft“), which is also available as separate<br />

download (on the HTM-page)<br />

Program procedure<br />

The standard user program consists mainly of three networks<br />

of OB 1:<br />

Network 1<br />

"START"<br />

STOP"<br />

"INSTANZ_<br />

FB3".EN<br />

"P" "SR"<br />

P<br />

SR<br />

>=1<br />

"COND"<br />

=<br />

The signal for an operational start (START) and stop (STOP) request<br />

for the actuator (here simulated by an indicator light) is<br />

given in network 1.<br />

The "INSTANZ_FB3" bit includes the status of an SR flip-flop in<br />

the safety program (FB3, NW1) and in this case prevents the<br />

starting of the actuator (here simulated by an indicator light)<br />

with an acknowledgement transmitted in the safety program.<br />

As long as "INSTANZ_FB3".EN="0", COND= "0" remains, also if<br />

the start push button is pressed since the reset function has<br />

priority in this flip-flop type.<br />

The information of the memory bit "COND" from network 1 is<br />

read as memory bit COND1 in the safety program. This allocation<br />

occurs in the cyclic interrupt OB 35 for the following reason:<br />

If you want to read data from the standard user program<br />

(memory bits or PII of standard I/O) in the safety program<br />

(here: COND), which can be changed by the standard user<br />

program or an operator control and monitoring system during<br />

the runtime of an F run-time group, it is required to use separate<br />

memory bits (here: COND1). Data from the standard user<br />

program have to be written to these memory bits immediately<br />

before calling the F runtime group. Only these memory bits<br />

may then be accessed in the safety program.<br />

In this example it has already been realized. Generally, however,<br />

the following applies:<br />

Note<br />

If the above section is not observed the F CPU may go to<br />

STOP mode.<br />

Network 2<br />

In OB 1 the "Proxy-Enable" bit (Bit 6 of the cyclic output data)<br />

is reset as the default value "0".<br />

Functional Example No. AS-FE-I-010-V11-EN 311<br />

G_FB_XX_184<br />

Ex. No.<br />

10

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!