Page 221 - Programmable Logic Controllers, Fifth Edition - Mobile version
P. 221

9.11  Suspend Instruction
                                           Main program
                                                                     The suspend (SUS) instruction is used to trap and iden-
                    Inputs
                L1                                                   tify specific conditions during system troubleshooting
                               SW 12                                 and program debugging. Figure  9-28 shows a suspend
                                       TON                  EN
                                       TIMER ON DELAY                instruction in a ladder logic rung. The execution of the
                                       Timer         T4:2   DN       instruction can be summarized as follows:
                        SW 13          Time base (sec)  1.0
                                       Preset          5               •  When you program the SUS instruction, you must
                                       Accumulated     0
                                                                          enter a suspend ID number (number 100 is used in
                                T4:2                        LT4           this example).
                                                                       •  When the rung is true, the SUS output
                                  DN                                      instruction places the controller in the suspend
                               SW 13      Temporary end                   mode and the PLC immediately terminates
                                                                          scan cycling.
                                                           TND
                                                                       •  All ladder logic outputs are de-energized, but other
                                SW 1                        LT1           status files have the data present when the suspend
                                                             L            instruction is executed.
                                                                       •  The SUS instruction writes the suspend ID number
                                SW 2                        LT1
                                                             U            (100) to S:7 as it executes.
                                                                       •  You can include several SUS instructions in a pro-
                                                                          gram, each with a different suspend ID and read S:7
                                SW 3
                                       RTO                  EN            to determine which SUS instruction caused the PLC
                                       RETENTIVE TIMER ON                 to halt.
                                       Timer         T4:3   DN
                                       Time base (sec)  1.0            •  Status file S:8 will contain the number of the pro-
                                       Preset         50                  gram file that was executing when the SUS instruc-
                                       Accumulated     0
                                                                          tion executed.
                                PB 1                        T4:3
                                                            RES
                                      Remainder of main program
                                                                                             SUS
                                                                                             Suspend
                                                                                             Suspend ID  100

                Figure 9-27  Temporary end (TND) instruction.        Figure 9-28  Suspend (SUS) instruction.































               202        Chapter 9  Program Control Instructions







          pet73842_ch09_184-206.indd   202                                                                              03/11/15   4:01 PM
   216   217   218   219   220   221   222   223   224   225   226