In the case of contacts you scan the binary tags, e.g. inputs, and link the scanned signal states by arranging the contacts in series or parallel. You use an NO or NC contact to define the influence of the scanned signal state on the logic operation.
Further functions for contacts are negation of the signal flow, edge evaluation for a binary tag, and the comparison function (Fig. 7.3).
7.2.1 NO and NC contacts
An NO or NC contact is used to scan the signal state of a binary tag. An NO contact passes on the scanned signal state directly to the logic operation, an NC contact first negates the signal state.
To program a contact, drag it with the mouse from the program elements catalog under Basic instructions > Bit logic operation to the working area. You can subse- quently change the function (NO or NC contact) using a drop-down list which you can open using the small yellow triangle when the contact is selected.
You write the binary tag to be scanned above the contact. This can be an input, out- put, bit memory or data bit, or also a SIMATIC timer or counter function. Assign- ment with a constant (TRUE or FALSE) is not permissible.
The example in Fig. 7.4 shows the two “Start” and “Stop” pushbuttons. When pressed, they output the signal state “1” in the case of an input module with sinking input. The SR function is set or reset with this signal state.
The “/Fault” signal is not active in the normal case. Signal state “1” is then present and is negated by scanning with an NC contact, and the SR function therefore remains uninfluenced. If “/Fault” becomes active, the SR function is to be reset. The active signal “/Fault” delivers signal state “0”, which resets the SR function by means of the scan with an NC contact as signal state “1”.
Fig. 7.3 Overview of the contacts described in this chapter Binary tag
Normally open contact Normally closed contact NOT contact
Positive edge of binary tag Negative edge of binary tag Comparison function Binary tag
NOT
Binary tag Binary tag
P N
Edge trigger flag Edge trigger flag
Function Data type Digital tag 1
Digital tag 2 Contacts
7.2.2 Series and parallel connection of contacts
With a series connection, two or more contacts are positioned one behind the other.
Current flows through a series connection when all contacts are closed (“AND func- tion”, see Chapter 12.1.3 “AND function, series connection” on page 464).
A parallel connection means that two or more contacts are positioned underneath each other. Current flows through a parallel connection when one of the contacts is closed (“OR function”, see Chapter 12.1.4 “OR function, parallel connection” on page 465).
Series and parallel connections can be combined. If contacts arranged in parallel are connected in series to other contacts arranged in parallel (series connection of parallel connections), this corresponds to an AND logic operation on OR functions.
An OR logic operation on AND functions is the parallel connection of series connec- tions.
To program a branch, use the mouse to drag the symbol for Open branch or Close branch from the program elements catalog under Basic instructions > General into the current path. Gray boxes indicate the permissible positioning, a green box iden- tifies the position at which the branch will be opened or closed if you release the mouse button. You close a branch if you drag the end of the branch to the position at which it is to be closed.
Fig. 7.5 shows a simple example of the interconnection of contacts. Two fans signal with signal state “1” that they are running. A coil is to be activated for display is only one fan is running. The logic operation in network 3 is: (#Fan1.works AND not
#Fan2.works) OR (not #Fan1.works AND #Fan2.works). Network 4 solves the task with the logic operation (#Fan1.works OR #Fan2.works) AND (not #Fan1.works OR not #Fan2.works).
Fig. 7.4 Principle of operation of NO and NC contacts
"Fan"
%I1.3
%I1.2
%I1.1
%Q4.
L+
G
1
"Start" "Stop" "/Fault"
Example of application of NO and NC contacts
SR S
R1 Q
7.2.3 T branch, open parallel branch
You can “divide” a current path so that it has two different terminations. If this is not simply a parallel connection of coils or boxes, but a case of both branches hav- ing different logic operations, this is referred to as a “T branch” or an “open” paral- lel branch.
To program a T branch, use the mouse to drag the symbol for Open branch from the program elements catalog under Basic instructions > General to the position in the current path at which the T branch is to commence.
Fig. 7.6 shows a T branch. The parallel connection of #Fan1.works and #Fan2.works is followed by the branch in which a series connection of a NOT contact and an NO contact leads to a further coil.
Series and parallel contact connections can be programmed following a T branch. A further T branch can also be opened within a T branch. However, you cannot enter logic operations which lead from the left-hand power rail to a T branch.
Fig. 7.5 Example of series and parallel connection of contacts
Fig. 7.6 Example of a T branch (open parallel branch) and the NOT contact
7.2.4 Negating result of logic operation
The NOT contact negates the result of the logic operation (the “current flow”).
To program a NOT contact, drag it with the mouse from the program elements catalog under Basic instructions > Bit logic operation to the working area.
You can position the NOT contact like a standard contact in a branch which com- mences on the left-hand power rail. Positioning following a T branch is also permis- sible. Positioning of the NOT contact is not permissible in a parallel branch which commences in the middle of the current path. The NOT contact can also be used to negate the result of the logic operation (the “current flow”) at box inputs and out- puts.
In Fig. 7.6 the parallel connection of #Fan1.works and #Fan2.works is negated. The resulting logic operation is: Not #Fan1.works AND not #Fan2.works. If no fan is working, the #Display.nofan tag flashes at 2 Hz.
7.2.5 Edge evaluation of a binary tag
An edge evaluation detects the change in a binary signal.
To program an edge evaluation, drag the P or N contact with the mouse from the program elements catalog under Basic instructions > Bit logic operation to the work- ing area.
The edge contact has the signal state “1” for one processing cycle if the signal state of the binary tags positioned above it changes from “0” to “1” (P contact, rising edge) or from “1” to “0” (N contact, falling edge). It responds like a “passing con- tact”. This “pulse” is linked to the result of the logic operation present prior to the contact.
The edge trigger flag is present underneath the edge contact. This is a flag or data bit which saves the signal state of the binary tag. The signal edge is recognized by comparing the signal states of binary tags and edge trigger flags (see also Chapter 12.2.5 “Edge evaluation” on page 472).
The example in Fig. 7.7 shows an application of edge evaluation. Let us assume that an alarm has “arrived”, i.e. the alarm signal's state changes from “0” to “1”. Signal
Fig. 7.7 Example of an edge evaluation of a binary tag
state “1” is then present after the P contact for one program cycle. The
#Alarm_memory tag is set by this, and the #Alarm_lamp tag flashes at 0.5 Hz. The alarm memory can be reset using an #Acknowledge button. The alarm memory re- mains reset if #Acknowledge has the signal state “0” again and #Alarm_bit is still present. #Alarm_memory is only set again by a further positive edge of #Alarm_bit (if #Acknowledge then no longer has signal state “1”).
7.2.6 Comparison contacts
A comparison contact compares two digital values and outputs a binary signal. A comparison which is correct is equivalent to a closed contact (“current” is flowing through the comparison contact). The contact is open if the comparison is incor- rect. The comparison function is described in Chapter 13.3 “Comparison functions”
on page 518.
To program a comparison function, drag it with the mouse from the program elements catalog under Basic instructions > Comparator operations to the working area. You position the comparison contact like a standard contact in the current path. You can then use drop-down lists to set the comparison mode and data type (Fig. 7.8).
Fig. 7.9 shows two comparison contacts. If the #Mea- surement_temperature tag is above a lower limit and below an upper limit (series connection), the coil is activated and the #Measurement_in_range tag is set.