Configuring alarms according to the message numbering

Một phần của tài liệu Automating with SIMATIC s7 400 inside TIA portal publicis (2013) (Trang 237 - 242)

Add (any) function block as a “message function block” and define an input param- eter in the INPUT declaration section, which is the basis for an alarm (this is not the alarm-triggering signal). The name of the input parameter is the alarm name. For the data type, select an alarm data type which depends on the message block used from the drop-down list. The name of an alarm data type is the name of the message block with a preceding “C_”, e.g. C_ALARM for the ALARM message block. Excep-

tion: Message blocks without instance data all have the same alarm data type C_ALARM_S.

Now move the message block from the program elements catalog under Expanded instructions > Alarms into the program of the function block. The instance data of the message block, if it has any, is found in the instance data of the calling “message function block”.

The input parameter with the alarm data type must be created at parameter EV_ID of the message block. Now supply the other parameters of the message block as de- scribed in Chapters 5.9.3 “Message blocks for PLC alarms with instance data” on page 241 and 5.9.4 “Message blocks for PLC alarms without instance data” on page 244.

For each alarm, repeat the declaration of the “alarm input parameter” and the pro- gramming of the message block. In the “message function block”, several alarms can also be programmed with various types of message blocks. Supplement the program with your system-specific statements. You can also create more than one

“alarm function block”.

Define alarm properties in the alarm type

In the “Message function block”, select the “Alarm input parameter” and set the alarm properties in the inspection window in the Properties > Alarm tab: Under Texts enter the infotext, the alarm text and, if needed, the additional texts and enter the display class, priority, alarm class, and group ID for the alarm group under Attri- butes (Fig. 5.38). You can activate or deactivate logging of the alarm and the acknowledgment requirement. Not every alarm type has all of the properties listed here.

Clicking on the chain symbol for an alarm property allows you to lock (closed chain link) or unlock the property (open chain link). All of the alarm properties of the alarm type are passed on to the alarm instance. The locked properties can no longer be changed in the alarm instance. Unlocked ones can be changed.

In the “Message function block” (at the alarm type), set the preferred alarm prop- erties which are relevant to all of the alarm instances.

Fig. 5.38 Example of alarm properties in the inspector window

Define alarm properties in the alarm instance

If you call up the “Message function block” in the program of another block, specify the storage location of the instance data belonging to the call, either in its own in- stance data block or in the instance data block of the calling function block. You can also call up the “Message function block” several times with different instance data in each case. The program editor generates an alarm instance for each call from the alarm type in the function block with its own CPU-wide unique alarm number. This is the “actual” alarm.

To set or change the properties of this alarm, open the instance data block – for a multi-instance, then open the local instance of the “Message function block” – and select the alarm in the INPUT declaration section (the input parameter with the alarm name). In the Properties > Alarm tab in the inspector window, you can then change the alarm properties which were unlocked in the alarm data type.

After an alarm property is changed, a symbol (“type symbol”) shows that the alarm property has changed compared to the alarm type. If you click on the type symbol, the original value is adopted again from the alarm type.

Setting alarm properties in the alarm editor

After you have programmed the alarm types (in the “Message function block”) and the alarm instances (when the “Message function block” is called), you can also set the alarm properties using the alarm editor.

To start the alarm editor, double-click on PLC alarms in the project tree under the PLC station. In the PLC alarms tab in the upper section of the work window in the PLC alarms table, the alarm editor shows the programmed alarm types and it shows the alarm instances of the selected alarm type in the bottom section in the Alarm instances table. The alarm properties are displayed in both tables (Fig. 5.39). Indi- vidual columns can be hidden and shown: Right-click in a column title and then se- lect the Show/hide columns > … command from the shortcut menu.

You can change the alarm properties directly in the tables of the alarm editor or in the properties tab of the inspector window (as described in sections “Define alarm properties in the alarm type” on page 237 and “Define alarm properties in the alarm instance” on page 238).

Fig. 5.39 Example of PLC alarms in the alarm editor

For a multi-channel message block, you can assign individual texts and in part in- dividual attributes to each individual channel (to each “subalarm”) after opening in the PLC alarms table or in the Alarm instances table.

Inserting associated values

In an alarm text, you can insert one or more associated values at any point. You define an associated value at the SD or SD_n parameter of the message block. You then insert the following expression into the alarm text for each associated value:

@<Associated value number><Element type><Format>@. Table 5.12 shows the per- missible element types and formats.

Example: The expression @2R%6.2f@ means that the associated value at parameter SD_2 (“2”), which is in the REAL data type (“R”), with a total of 6 places including 2 decimal places (“%6.2”), is to be displayed as a fixed-point number (“f”).

If too few places are specified in the format specification, the associated value is nevertheless displayed in its full length. If the number of places is too great, leading spaces are inserted.

You can also insert text from a text list into an alarm as an associated value. The ex- pression for this is: @index%t#name@; index is the reference to the text in the text list name.

Example: In the Temperatures text list, the text is selected based on decimal value ranges (Fig. 5.40). The configured alarm text

The temperature in the tank is @1W%t#Temperatures@.

is output as alarm text

The temperature in the tank is increased.

if the first associated value with the data type WORD has the value 63.

Table 5.12 Element types and formats for associated values Element

type

Data type of the associ- ated value

Format Representation of the associated value as

Y W X I D B C R

BYTE WORD DWORD

INT DINT BOOL CHAR REAL

%nX

%nu

%nd

%nb

%n.mf

%ns

Hexadecimal number with n places Decimal number without sign with n places Decimal number with sign and n places Binary number with n places

Fixed-point number with sign and n total places, including m places after the decimal point; “m” can also be omitted Character string with n places

(display up to the character value B#16#00)

Configuring text lists for alarm texts

Texts which are assigned to an individual value or a value range are managed in a text list. A text from a text list can thus be searched for (referenced) based on a val- ue. Each text list has a unique name. A text list can be assigned to a station or to a project.

To create a new text list, double-click on Text lists in the project tree under the PLC station (station-assigned) or on Common data > Text lists under the project (cross- station). In the Text lists table in the upper section of the work window, add a new text list and give it a unique name (Fig. 5.40). In the Selection column, define the value range with which the texts of the text list will be referenced:

b “Decimal” if a decimal number or a range of decimal numbers (values 0 to 216–1) is the reference

b “Binary” if a bit or a bit range in a doubleword (bits 0 to 31) is the reference b “Bit” if a bit (“0” or “1”) is the reference

Select the text list. In the Text list entries from <list name> table in the bottom section of the work window, define reference ranges. In the Entry column, define the asso- ciated texts.

Configuring alarm classes

To configure an alarm class, double-click on Common data > Alarm classes in the project tree under the project. In the Alarm classes table, enter the name of the alarm class and the display name and activate or deactivate the mandatory acknowledgement for the alarm class. Now you can assign an alarm to the new alarm class when configuring the alarm properties.

Fig. 5.40 Example of a text list

Recording and saving signals

An alarm event is “incoming” if the alarm-triggering signal at parameter SIG or SIG_n changes from status “0” to status “1” (rising signal edge). An alarm event is

“outgoing” if a signal edge falls.

The message blocks have a memory area with two spaces for each alarm event. If the message block detects an incoming alarm event, the trigger for the alarm is entered in the first memory space. The first memory space is freed up again once the alarm has been generated.

If another incoming alarm event is detected before the previous alarm has been generated, the second memory space is occupied. Once the alarm trigger has been completely processed in the first memory space, the alarm trigger that is currently in the second memory space is transferred to the first memory space and pro- cessed.

If there is more than one incoming alarm event during the generation of an alarm, the second memory space is “overwritten” with the respective current alarm trig- ger. This loss of an alarm is displayed on the STATUS parameter and is sent with the next alarm to the display device.

Alarm with mandatory acknowledgement

For an alarm without mandatory acknowledgement, the alarm is displayed when the alarm event arrives. The display is ended when the alarm event leaves again.

For an alarm with mandatory acknowledgement, the alarm is displayed when the alarm event arrives. The display remains until the alarm is acknowledged on the display device. The display is ended when the alarm is acknowledged and the alarm event has left.

The alarms grouped into an alarm group are collectively acknowledged. If the man- datory acknowledgement is activated, the message block will not generate a new alarm for this signal until the “incoming” alarm has been acknowledged. The next alarm that the message block generates is an “outgoing” alarm, which is not ac- knowledged. The next “incoming” alarm must then be acknowledged again.

If an “incoming” alarm is acknowledged, all of the preceding (and not yet acknowl- edged) signal state changes for this alarm are also acknowledged.

The acknowledgment status is displayed at the output parameters of the message blocks with instance data, or it can be scanned with ALARM_SC for message blocks without instance data.

Một phần của tài liệu Automating with SIMATIC s7 400 inside TIA portal publicis (2013) (Trang 237 - 242)

Tải bản đầy đủ (PDF)

(747 trang)