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 in<br />

which readback is demonstrated.<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 />

implemented 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 />

A three-phase asynchronous motor is started via a push button<br />

(NO) and stopped via a push button (NC). In case of emergency<br />

the motor can also be stopped via an emergency stop<br />

push button.<br />

This functionality is used as a framework to show how the signals<br />

are read back from the actuator and evaluated within the<br />

STEP 7 program.<br />

Download<br />

The download is available via the following link:<br />

http://support.automation.siemens.com/WW/view/en/<br />

21331098<br />

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

"f07_readback_v10.zip" file offered as separate download (on<br />

the HTML page) and extract it into a user-defined directory.<br />

To download the project to the F CPU please proceed as follows:<br />

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

■ Switch to the SIMATIC Manager<br />

■ Select the "Blocks" folder<br />

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

■ Click the "Download" button<br />

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

following:<br />

■ Starting and stopping a three-phase asynchronous motor<br />

considering the signals read back from the actuator.<br />

■ Emergency stop for shutdown in case of a fault.<br />

Note<br />

The focus of this functional example is to demonstrate<br />

how the readback signal is connected to the hardware<br />

and how it is evaluated using software (STEP 7). Running<br />

the motor is a means to an end. The emergency<br />

stop functionality is used for safety reasons if the example<br />

is reproduced.<br />

Program procedure<br />

The standard user program basically consists of two networks<br />

in OB1:<br />

Network 1<br />

"K1_HELP"<br />

"K2_HELP"<br />

The auxiliary contacts of K1 and K2 are evaluated under the<br />

memory bit FEEDBACK in the safety program.<br />

Network 2<br />

"START"<br />

"STOP"<br />

"INSTANZ_<br />

FB1".EN<br />

The switch-on condition COND="1" is only possible if the R input<br />

of the flip-flop is on "0" signal (if "1" signal at S and R input<br />

the reset function is predominant in this flip-flop).<br />

INSTANZ_FB1.EN characterizes the signal state of a flip-flop in<br />

the safety program (used as static variable in the safety program).<br />

As long as a necessary acknowledgement has not been<br />

transmitted in the safety program this bit remains on "0" and<br />

it cannot be started.<br />

The information of the flag "COND" is read as flag COND1 in<br />

the safety program. This assignment takes place in the cyclic<br />

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

Note<br />

The reason below also applies to the memory bit<br />

FEEDBACK from network 1.<br />

&<br />

"FL_P" "SR"<br />

P<br />

SR<br />

S<br />

>=1<br />

R Q<br />

"FEEDBACK"<br />

=<br />

"COND"<br />

=<br />

Functional Example No. AS-FE-I-007-V10-EN 255<br />

G_FB_XX_147<br />

G_FB_XX_148<br />

Ex. No.<br />

7

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

Saved successfully!

Ooh no, something went wrong!