The text of a manual · part 13 of 35
Series One Programmable Controllers, Series One/One Plus User's Manual: Chapter 5 Programming, pages 111 to 120
Pages 111 to 120 of 300, from Series One Programmable Controllers, Series One/One Plus User's Manual
The original document is the PDF (40 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
For the GE Fanuc IC610CPU105A, GE Fanuc IC610CPU105C, Fanuc IC610CPU105A, GE IC610CPU105A, Fanuc IC610CPU105C and GE IC610CPU105C
Page 111
5-21
Programming
Basic Relay Logic (Motor Starter) With this background on the basics of pro gramming a Series One and Series One Plus PC, Figure 5.5 provides a simple example to illustrate relay ladder programming. The references used were selected for illustrative purposes and can be adjusted as necessary to meet your application needs. This is a simple motor starter and seal circuit. An input module is assumed to be installed next to the CPU (005 = start pushbutton input, and 006 = stop pushbutton). Adjacent to the input module is assumed to be an output module (010 = output to motor starter). The program does not care whether these input and output modules are 115 V ac or 24 V dc. The programmer keys to be depressed to enter this logic are also shown in the figure. The start key begins a new rung of logic; this example and most that follow assume an empty memory so the example begins at address 0000.
START
KEY
ON LED’S
STR I
STR SHF
SW 0
STR STR. SHF ADR
STOP
KEY
DtSPLAY
IANdl
ON LED’S
DIS PLAY
AND AND. NOT
5 0001
OR
SHF ]
AND. NOT. SHF
6 I
AND. NOT, SHF
IF]
ADR
[
I
OR. SHF
6 0003
OUT
1
I SW
OUT. SHF oft SHF
10
El 1
OUT, SHF
1
ADR
0 0 0.2
00
OUT, SHF
10
EN’I I
ADR
OR, SW
0 0 0 4
Figure 5-5. Sample Relay Logic (Motor Starter) Motor Starter Logic Description The first reference is entered (STR, SHF, 5, ENT) and a normally open contact is established since the NOT key was not depressed. Referring to Figure 5.5, the next function moving from the left (contact 005) to the right along the top line of the logic rung, is a parallel contact referenced as 010. Parallel logic is represented by the OR function, which is selected followed by the desired reference (10) and the Enter key to load the memory. Again moving to the right of the top line, the next contact is in series with the logic completed so far. Thus the ANTI key is selected (for series logic). Since this contact is normally closed, the NOT key is also selected followed by the reference 6 and the Enter key. The final element of this logic is the coil or output of the rung. Selecting the Output key does not ensure a “real world” output will be generated; it also must refer to an I/D reference and have an output module inserted in the proper slot. To establish the rung output coil, the output key is selected followed by the Shift key, the reference (10) and the Enter key. Outputs can be paralleled by entering additional OUT functions immediately after the initial one.
Page 112
Programming
5-22
GEK-90842
Normally Closed Input After completing the logic of Figure 5.5, several features of progr amming should be noticed. First, all elements of the program are entered directly into CMOS memory as the Enter @NT) key is depressed. Thus, if power should be interrupted while a program is being entered or altered, it will be totally saved except possibly for the one element being worked on. Second, there is feedback on the programmer for all entries. Something happens (LED ON, display changes, error codes appear, etc) for each key selected. Third, the logic is set up for inputs that are wired normally open. If an input is wired normally closed, an adjustment must be made to the symbol (NO or NC) used for that input. Referring to Figure 5.6, inputs sense voltage at their field terminals. They can not detect if a voltage is from a normally open limit switch that is depressed or from a normally closed pushbutton that is not depressed. Cover up the two field devices wired to inputs 002 or 003. If you were the input module, and both applied voltage to the field terminals, could you tell which was wired normally closed and which normally open? Because of this, the programmer or system designer must compensate.
Figure 5-6. Example of Normally Closed Inputs In a previous discussion, it was stated that inputs are like relays with many poles and you are selecting which type of pole is to be used when you program. In the lower half of Figure 5.6, coil 002 is shown in the de-energized position; however it is wired to a normally closed pushbutton. When you want power to flow if the pushbutton is NOT depressed, which contact type do you choose, NO or NC? The answer is normally open since coil 002 is always energized except when the pushbutton is depressed. Therefore, in pqGimmin g with the Series One or Series One Plus PCs, a normally open contact is appropriate. If the stop button of Figure 5.6 were wired normally closed, its internal logic should be normally open to compensate] However, this concept does not normally cause problems for the programmer. Since PCs are reprogrammable, if an error is made and discovered when the system is exercised, it is easy to correct
Page 113
Programming
5-23
GEK-90842
Push-Down Stack Two very useful functions are programmed using a 2-key sequence, the AND STR and the OR STR. The AND STR provides a common series connection between a block of logic and the OR STR provides a common parallel connection for a block of logic. These instructions provide the connecting links not allowed with any of the previously mentioned instructions. The logic used with this type of operation is referred to as a push-down stack. The push-down stack can accommodate up to eight levels (groups) of logic. A push-down stack can be thought of as a temporary storage area to allow the combining of elements in series (AND) or parallel (OR) connections. Figure 5.7 illustrates the use of these functions.
a40545
Figure 5-7. AND STR and OR STR Connections The following pages contain a more detailed description of a pushdown stack and programming with the AND SIR/or STR instructions.
Page 114
5-24 Programming nn = GEK-90842
Detailed Example of AND STR, OR STR
The push-down stack can be used for several groups of contacts, either in series or in parallel, and can be reused many times in the user’s logic. As mentioned previously, the stack has eight levels or storage locations where an ON/OFF (1/0) condition is stored.
PUSH-DOWN STACK ON (1) Location 1 ON (1) Location 2 OFF (0) Location 3 ON (1) Location 4 OFF (0) Location 5 OFF (0) Location 6 ON (1) Location 7 OFF (0) Location 8
Figure 5-8. Push-Down Stack Storage Locations
Description of Operation
There are four basic rules that govern the operation of the push-down stack and they are explained in the following examples.
Rule Number 1: A STR X instruction pushes the contents of each position in the stack down one location. The contents of location number 1 are pushed down to location number 2, the contents of location number 2 are pushed down to location number 3, and so forth. The logical status of reference X is then moved into location number 1 of the stack.
Rule Number 2: The AND Y/OR Y instruction logically ANDs/ORs the status of reference Y (ON/OFF) with the ON/OFF status of location number 1 in the stack and writes the result back into location 1.
AND (SERIES) OR (PARALLEL)
BEFORE AFTER BEFORE AFTER
LOCATION LOCATION LOCATION LOCATION Y NUMBER 1 NUMBER 1 Y NUMBER 1 NUMBER 1 wee nn nee ee ee oa ee ew en ee ene pe eee eee eee OFF OFF OFF OFF OFF OFF ON OFF OFF ON OFF ON OFF ON OFF OFF ON ON ON ON ON ON ON ON
Figure 5-9. Push-Down Stack Logical Operations
Page 115
Programming
S-25
GEL90842
Rule Number 3: The AND STR or OR SIR instructions logically AND or OR location number 1 in the stack with location number 2 and writes the result into location number 1. In other words, these instructions put one group of contacts in series or parallel with another group of contacts. This instruction also moves the contents of positions 3 through 8 up one location. Rule Number 4: An OUT Y instruction sets Y to reflect the status of location number 1 in the stack. If the status of location number 1 is ON (I), output Y will be turned off. If the status of location number 1 is OFF (O), output Y will be turned off.
LOCATKIN NUMBER
1
2
Figure 540. AND STR/OR STR Example Number 1
Page 116
s-26
Programming GEK-90842
ED SIR f
4 6
ANDNOT ORSTR iEFsTR
20
LOCATION c ANDSTR
, our
20
20
4’H’t - ;IH'C
Figure 5-11. AND STR/OR STR Example Number 2 Use of Retentive Coils as Latches All coils referenced so far have not been retentive upon power failure. Thus if a non-retentive coil is ON when power is removed fkom the CPU, it will be OFF upon reapplication of power (if Switch 1 on the CPU module is ON). Them axt 28 special coil references (340-373) that axe retained upon power failure. Thus if they were ON prior to loss of power, they will be ON when power is restored; they will be OFF while power is OFF since no scanning is being performed. In addition to these 28 references, latches can be built using shift register references (400-577) that are not being used to perform shift register functions. Either retentive coils (340-373) or shift registers (400-577) can be used to control contacts, both normally open and normally closed wherever required. ‘Ikis special retentive function is derived from their use as coils to complete or store the results of relay logic rungs.
Programming a Latched Relay Latches require two separate functions or inputs similar to hard-wired relays, a SET (turn ON) and a RESET (turn OFF). These functions are commonly referred to as latch and unlatch. If both are active, the last one in the scan will be controlling the state of the coil. To turn on a latch, the function SET
Page 117
Programming
527
GE&90842 followed by the retentive coil reference (for example, 340-373 or 400-577) is used instead of OUT, plus the coil number at the end of a logic rung. Once power flows to that coil, it will be energized (turned ON) and remain ON even if power flow to it should be interrupted. To turn a latch off (de-energize) separate relay logic should be built ending in a RST (Reset) function and the [same] coil number. In many applications, it is useful to allow the system to clear (turn OFF) coils when power fails so that an orderly restart is possible when power is restored, whether that is 2 seconds or several hours, or several days later. Other applications require the control system to remember the status of key items such as part position, operations completed, elevators up or down, etc. The Series One and Series One Plus are provided with both standard and retentive coils to allow the user to tailor the program to fit their requirements. Figure 5.12 illustrates the programmin g of retentive (latched) relays. Coil 340 is used only as m example. The logic to either set or reset a retentive coil can be of any convenient size similar to standard coil logic. When power flows through the top rung to the SET coil 340 function, it will be energized and remain ON even if power flow is removed. Anytime the power flows through the lower rung (regardless of path), coil 340 will be turned OFF. Since the set coil 340 is programmed before the reset, it is placed in earlier memory locations and the reset function will have overriding control if they are both energized.
271
132
037
175
340
STR AND OR OR STR NOT AND OR AND SET STR AND STR AND RESET OR SET
067
306
036
340
AND NOT RESET
271 132 135 377 037 175 267 STR 340 067 306 015 307 SfR 036 340
1 1 14 WORDS PER ELEMENT
1
Figure 5-12. Example of Latching Logic Master Control Relay Functional Description To control large quantities of coils on a supervisory basis, a Master Control relay function is provided. This function allows an efficient method of programmin g to turn off large quantities of coils in case some major permissive is not satisfied. One approach would be to incorporate a permissive contact in each rung controlling one of the coils. This may require many contacts and inefficient use of memory. Another method is to bracket those rungs over which master control is desired; this is similar to quotation marks around a direct statement (one at each end to define exactly where the statement starts and where it ends). The permissive logic is first built starting to the left of the ladder diagram adjacent to the “hot” power rail. Then an MC!? (Master Control Start) function is entered, followed by the logic it is to control, and ending with an MCR (Master Control Reset) function. The MCS and MCR axe like quotations around the logic to be controlled. When power flows to the MCS, the logic enclosed will operate normally. If
Page 118
548
Programming GEK-90842 there is no power flow to MCS, the coils will be forced to the OFF state regardless of the internal logic conditions, timers will be reset to zero, and counters will stop (frozen) but not reset. The amount of logic controlled by the Master Control relay function is limited only by the memory provided.
STR AND MCS STR OR AND OUT 152
156
010
271
SPAN Of CONTROL
~+--+t-++-e 265 +--it---u+ 043 r
STR AND AND NOT OUT STR AND OUT -MCR STR AND OR AND NOT OUT
003 005 007 043 021 052 152 156 010 271 152 027 265 017 012 315 303 043
1 18 WORDS PER ELEMENT
1
Figure 543. Example of Master Control Relay Logic Programming a Master Control Relay Function Figure 5.13 illustrates the use of one pair of MCS/MCR functions. In many cases it is convenient to view the MCS function as defining a sub-left power rail whose connection to the main power rail is dependent upon some relay logic. The conditional logic (IO03 - 1125 in this example) is built fkst using the normal relay logic. The MCS function is entered without any reference to create the beginning point of the control. Logic is built using normal functions within the control area. Note the duplication of contact 152, which cost only one memory word, there is no need to count or limit the quantity of relay contacts used in PCs. To end the master control, the MCR function is entered returning control to the next power rail to the left and conventional logic can now be built. Unless both references 003 !andA 005 are energized (ON) in this example, coils 052,271, and 265 will be OFF. When these contacts are passing power, coils 052, 271, and 265 will respond to their normal logic.
Multiple Master Control Relay Functions Multiple master control functions are possible in any logic program. They can be embedded within the scope of the first MCS and the last MCR as necessary, as illustrated in Figure 5.14. The f&t group of coils under the Master Control of references 010 [or] 011 is 204-213 which includes two smaller groups (207-210 and 212-213). Group 207 and 210 are under the Master Control of 010 or 011 and 015, while group 212 and 213 are controlled by 010 or 011 and 022. Note the requirement for two successive MCRs to end both the group 212-213 and the larger group 204-213. To operate correctly there must be an equal number of MCS and MCR fhnctions in your program.
Page 119
Programming
5-29
GEK-90842
ST-R
010 011
5
-
OUT SfR
204 012 205 013
AND Not
014
SfR MCS STR NOT i:
Sm wr
OUT
[
E MCA
STR ANoNof OUT STR MCS STR OUT SfR NOT ANDNOT
L r
$i
-MCR
016 207 012 210
STR AND Lbof Out
I1 22 WOROS
023 021 :;: 024 212 025 026 213 030 031 033 032 27:
PER ELEMEN’
]
Figure 5-14. Multiple Master Control Relay Logic Disabling of Outputs In addition to Master Control functions, all outputs can be affected by an internal special function coil referenced as 376. When this coil is energized by user logic, all outputs in the hardware I/O structure will be turned OFF. Internal coils and statuses will still operate, but only internally. The only exception is to coils that are programmed as SET OUT functions rather than the OUT function. These will still be able to provide their normal output status (ON or OFF) to the I/O section. Figure 5.15 illustrates the use of coil 376. In this example, when either reference 003 or 056 (inputs, outputs, or internal depending upon hardware I/O configuration) is energized, coil 376 will also be energized. This will cause all coils programmed with the OUT function, such as 010, to be turned OFF at their output module, although they will function normally internally. However, coils driven by the SET OUT function, such as 011, will not be affected by the status of coil 376. Table 5.7 summarizes the effectof coil 376 on the OUT and SET OUT functions. NOTE It is not recommended that the Output Disabler coil (376) be used with retentive coils (latches).
Table 5-7. Effect of Coil 376 (Output Disabler) Coil 376 OFF
I OFF ON
I
OFF ON
Coil 376 ON
OFF
ON
Page 120
5-30
Progra.mming GE&90842
003
376
II
STR OR OUT STR OR ANDNOT OUT STR OR ANDNOT SET OUT
?
056 i 0 t
005 It
L c
006 #
010
010 I I
\
005
003 056 370 005 010 006 010 005 011 006 011
006 SET
I11 00 WORDS PER ELEMENT Figure 5-15. Sample Coil Disabler Logic Timer and Counter Functional Description In addition to relay logic, there are a wide variety of functions that are standard with the Series One and Series One Plus. Timing and Counting are two of the most commonly used non-relay functions. These functions are special coils using references 600-677. Up to 64 total timers and/or counters can be built within the Series One or Series One Plus. They end a rung of logic similar to using an OUT function for relay logic. Unlimited contacts, both normally closed (timed OFF delay) and normally open (timed ON delay) can be referenced to any timer/counter coil. A preset value is used to indicate how many seconds, tenths of seconds, or counts, the function should delay before energizing its coil. When the coil is energized, time or counts continue to be recorded. All presets can be up to four decimal digits (0001 to 9999), which allow timers to be set from 0.1 to 999.9 seconds, and counters from 1 to 9999 counts. Timers can be set from 0.01 to 99.99 seconds with the Series One Plus 3.7K PC only. Timers are set to a .Ol second duration by setting output reference 770 (SET 770). Caution must be used when doing this, since reference 770 being reset in the same program would cause the timers to revert back to .l second duration.
Special Timer/Counter References The four references 674-677 obtain their presets from external thumbwheels via the thumbwheel interface. Additionally, a Timer/Counter Setpoint unit can be used with the Series One Plus to enter the preset values. When a preset value is selected with the Timer/Counter Setpoint unit, the values are simultaneously entered into &bit registers, (two registers for each 4digit BCD value). The registers can then be used to specify the preset value for any Timer or Counter. It should be noted that only 1 Thumbwheel Interface unit or 1 Timer/Counter Setpoint unit can be used with a series One Plus PC, not both at the same time. These four references cannot use internal presets; however, they will count up to 9999 and can be used to drive sequencers without the thumbwheel interface.
Programming Timers Timers (Figure 5.16) can be programmed in either seconds or tenths of seconds (or hundredths of seconds with a Series One Plus 3.7K PC) and require only one line of logic to control their operation. When power flows to the timer coil, it will begin recording time at the rate of one count every 0.1