Coils control binary tags such as outputs or bit memories. Coils are available with an additional inscription and a special functionality such as coils with timer or counter functions (Fig. 7.10). Further coils such as those for jumps or the opening of a data block are described in Chapter 14 “Program flow control” on page 560.
Fig. 7.9 Example of comparison contacts
Fig. 7.8 Drop-down lists for setting the comparison mode and data type
7.3.1 Simple coil, assignment
A simple coil directly assigns the current flow to the tag present on the coil: The tag is set to signal state “1” when current flows into the coil, and is reset to signal state
“0” when current no longer flows.
To program a simple coil, drag it with the mouse from the program elements cata- log under Basic instructions > Bit logic operation to the working area. Gray boxes in- dicate the permissible positioning, a green box identifies the position at which the coil will be inserted if you release the mouse button.
The simple coil requires a preceding logic operation; it cannot be connected directly to the left-hand power rail. A coil can be positioned at the end of a current path, or in the middle. This also applies to a T branch. Positioning in a “closed” parallel branch is not permissible.
Fig. 7.10 Overview of the coils described in this chapter
Fig. 7.11 Example of arrangement for a simple coil
xx = CU CD
Count up Count down Binary tag
SIMATIC timer
SIMATIC counter SIMATIC counter
Time value
Count value
Binary tag Binary tag
xx
SC xx
S R
Coils
Simple coil Set coil
xx =
Reset coil
SP SE SD SS SF
Start pulse timer
Start extentend pulse timer Start on-delay timer Start retentive on-delay timer Start off-delay timer
Simple coils can be connected in series or – at the end of a current path – in parallel.
Simple coils do not change the result of the logic operation (the “current flow”).
Fig. 7.11 shows the possible arrangements for a simple coil. In the current path, the
#Display.nofan, #Display.onefan and #Display.twofans tags are controlled by simple coils. Two coils are connected in parallel at the end of the current path, and respond in identical manners.
7.3.2 Set and reset coils
A set or reset coil is used to assign signal state “1” or “0” to a binary tag in the case of a result of logic operation “1”. A result of logic operation “0” has no effect.
To program the corresponding coil, drag it with the mouse from the program ele- ments catalog under Basic instructions > Bit logic operation to the working area. Gray boxes indicate the permissible positioning, a green box identifies the position at which the coil will be inserted if you release the mouse button.
Set and reset coils require a preceding logic operation and terminate a current path. The reset coil can also be used to reset a SIMATIC timer or -counter function.
In Fig. 7.12, #Fan1.start with signal state “1” sets the #Fan1.drive tag. With signal state “1” at #Fan1.stop, #Fan1.drive is reset. As a result of positioning of the reset coil after the set coil, the memory response is “reset dominant”: If both contacts have signal state “1”, #Fan1.drive is reset or remains reset.
7.3.3 Retentive response due to latching
The memory function in a circuit diagram is usually realized through latching of the output to be triggered. This realization can also be integrated into the ladder diagram. However, compared to the memory box, it has the disadvantage that the memory function is not recognized immediately. The latching principle is simple:
The binary tag triggered by the coil is scanned, and this scan (the “coil contact”) is connected in parallel to the set condition.
Fig. 7.13 shows both types of memory function through latching, namely set dom- inant and reset dominant. Network 10: If #Fan2.start closes, #Fan2.drive has signal state “1” and closes the contact parallel to #Fan2.start. If #Fan2.start then opens Fig. 7.12 Example of set and reset coils
again, #Fan2.drive remains switched on. #Fan2.drive is switched off if #Fan2.stop opens. If signal state “1” is present at both #Fan2.start and #Fan2.stop, no current flows into the coil (reset dominant). This situation looks different in network 11: If signal state “1” is present at both #Fan3.start and #Fan3.stop, current flows into the coil (set dominant).
7.3.4 Coils with time response
A coil with time response is a single element of a SIMATIC timer function. The timer function is usually applied as a box which contains all elements. The coil with time response corresponds to the S input of the time box. Attention must be paid to the sequence in the program when using the single elements. The time response of the coils is described in Chapter 12.3 “SIMATIC timer functions” on page 477.
To program the corresponding coil, drag it with the mouse from the program elements catalog under Basic instructions > Timer operations to the working area.
A coil with time response requires a preceding logic operation and terminates a current path. It can be connected parallel to all other coils. Positioning at the end of a T branch is also possible.
The time tag is positioned above the coil with a time response. This is an operand from the range of SIMATIC timers (T). The time value is specified in the data format S5TIME underneath the coil.
In Fig. 7.14, the timer “Fan4.delay” is started by the positive edge of #Fan4.start. Fol- lowing expiry of the duration (5 s in the example), the fan #Fan4.drive is switched on. If #Fan4.start has the signal state “0” prior to expiry of the duration, the fan is not even switched on.
Fig. 7.13 Retentive response due to latching
7.3.5 Coils with counter response
A coil with counter response is a single element of a SIMATIC counter function. The counter function is usually applied as a box which contains all elements. The SC coil corresponds to the S input of the counter box, the CU coil to the CU input and the CD coil to the CD input. Attention must be paid to the sequence in the program when using the single elements. The response of these coils is described in Chapter 12.5 “SIMATIC counter functions” on page 495.
To program the corresponding coil, drag it with the mouse from the program elements catalog under Basic instructions > Counter operations to the working area.
A current path is terminated by a coil with counter response. It can be connected parallel to all other coils. Positioning at the end of a T branch is also possible.
The counter tag is positioned above the coil with a counter response. This is an operand from the range of SIMATIC counters (C). The counter value in data format WORD is specified underneath the SC coil, where the numerical range extends from W#16#0000 to W#16#0999 or from C#000 to C#999.
Fig. 7.15 counts the switch-on processes of #Fan1.start with the SIMATIC counter
“Fan1.number”. The #Acknowledge signal resets the counter to 0.
Fig. 7.14 Example of a coil with time response
Fig. 7.15 Example of coils with counter response