GE Fanuc Automation Programmable Control Products Series 90-30/20/Micro Programmable Controllers Reference Manual GFK-0467K September 1998
GFL-002 Warnings, Cautions, and Notes as Used in this Publication Warning Warning notices are used in this publication to emphasize that hazardous voltages, currents, temperatures, or other conditions that could cause personal injury exist in this equipment or may be associated with its use. In situations where inattention could cause either personal injury or damage to equipment, a Warning notice is used. Caution Caution notices are used where equipment might be damaged if care is not taken.
Preface This manual describes the system operation, fault handling, and Logicmaster 90™ programming instructions for the Series 90™-30, Series 90™-20 and Series 90™ Micro programmable logic controllers. Series 90-30 PLCs, Series 90-20 PLCs, and Series 90 Micro PLCs are all members of the Series 90™ family of programmable logic controllers from GE Fanuc Automation. Revisions to This Manual There are new 350 and 360 series CPUs.
Preface Appendix B. Interpreting Fault Tables: describes how to interpret the message structure format when reading the fault tables using Logicmaster 90-30/20/Micro software. Appendix C. Instruction Mnemonics: lists mnemonics that can be typed to display programming instructions while searching through or editing a program. Appendix D. Key Functions: lists the special keyboard assignments used for the Logicmaster 90-30/20/Micro software. Appendix E.
Preface We Welcome Your Comments and Suggestions At GE Fanuc Automation, we strive to produce quality technical documentation. After you have used this manual, please take a few moments to complete and return the Reader's Comment Card located on the next page. David D. Bruton Sr.
Contents Chapter 1 Introduction ......................................................................................................... 1-1 Additional Reference Information: See the appendices in the back of this manual....1-2 Chapter 2 System Operation ................................................................................................ 2-1 Section 1: PLC Sweep Summary ..................................................................... 2-2 Standard Program Sweep ..........................
Contents Elapsed Time Clock ........................................................................................................2-34 Time-of-Day Clock .........................................................................................................2-34 Watchdog Timer .............................................................................................................2-35 Constant Sweep Timer ................................................................................................
Contents Application Fault......................................................................................................3-12 No User Program Present .........................................................................................3-13 Corrupted User Program on Power-Up ....................................................................3-13 Password Access Failure ..........................................................................................3-13 PLC CPU System Software Failure..
Contents Example: ...........................................................................................................4-16 OFDT........................................................................................................................4-17 Parameters:........................................................................................................4-18 Valid Memory Types: .......................................................................................4-19 Example: ..........
Contents Example 2: ........................................................................................................4-46 Section 5: Bit Operation Functions ............................................................... 4-47 AND and OR (WORD) ........................................................................................4-49 Parameters:........................................................................................................4-49 Valid Memory Types: ..........................
Contents Valid Memory Types: .......................................................................................4-74 Example: ...........................................................................................................4-74 BLKCLR (WORD)...............................................................................................4-75 Parameters:........................................................................................................4-75 Valid Memory Types: ..............
Contents Parameters:......................................................................................................4-101 Valid Memory Types: .....................................................................................4-102 Example: .........................................................................................................4-102 —>WORD (REAL)............................................................................................4-103 Parameters:............................
Contents SVCREQ #2: Read Window Values .....................................................................4-137 SVCREQ #3: Change Prog.Communications Window Mode & Timer Value......4-139 Example: .........................................................................................................4-140 SVCREQ #4: Change System Comm. Window Mode and Timer Value .............4-141 SVCREQ #6: Change/Read Number of Words to Checksum ..............................4-143 To Read the Current Word Count: ....
Contents PID Parameter Block: .....................................................................................4-173 Operation of the PID Instruction.....................................................................4-175 Internal Parameters in RefArray......................................................................4-178 PID Algorithm Selection (PIDISA or PIDIND) and Gains.............................4-179 CV Amplitude and Rate Limits.............................................................
Contents Figure 2-1. PLC Sweep..................................................................................................................................2-3 Figure 2-2. Programmer Communications Window Flow Chart.................................................................2-10 Figure 2-3. System Communications Window Flow Chart.........................................................................2-11 Figure 2-4. PCM Communications with the PLC..................................................
Contents Table 2-1. Sweep Time Contribution ............................................................................................................2-4 Table 2-2. I/O Scan Time Contributions for the 90-30 350 and 360 Series (in milliseconds)......................2-5 Table 2-3. Register References....................................................................................................................2-20 Table 2-4. Discrete References...........................................................
Contents Table B-5. PLC Fault Data - Illegal Boolean Opcode Detected.................................................................. B-7 Table B-6. PLC Fault Time Stamp .............................................................................................................. B-7 Table B-7. I/O Fault Table Format Indicator Byte ...................................................................................... B-9 Table B-8. I/O Reference Address.....................................................
Chapter Introduction 1 The Series 90-30, 90-20, and Micro PLCs are members of the GE Fanuc Series 90™ family of Programmable Logic Controllers (PLCs). They are easy to install and configure, offer advanced programming features, and are compatible with the Series 90-70 PLC. The Series 90-20 PLC provides a cost-effective platform for low I/O count applications. The primary objectives of the Series 90-20 PLC are as follows: • To provide a small PLC that is easy to use, install, upgrade, and maintain.
1 an alert, such as a low battery signal to indicate that the voltage of the battery protecting the memory is low and should be replaced. The condition or failure is called a fault. Faults are handled by a software alarm processor function that records the faults in either the PLC fault table or the I/O fault table. (The Model 331 and Model 340/341 CPUs also time-stamp the faults.
Chapter System Operation 2 This chapter describes certain system operations of the Series 90-30, 90-20, and Micro PLC systems. These system operations include: GFK-0467K • A summary of PLC sweep sequences (see Section 1). • Program organization and user references/data (see Section 2). • Power-up and power-down sequences (see Section 3). • Clocks and timers (see Section 4). • System security through password assignment (see Section 5). • Model 30 I/O modules (see Section 6).
2 Section 1: PLC Sweep Summary The logic program in the Series 90-30, 90-20, and Micro PLCs execute repeatedly until stopped by a command from the programmer or a command from another device. The sequence of operations necessary to execute a program one time is called a sweep. In addition to executing the logic program, the sweep includes obtaining data from input devices, sending data to output devices, performing internal housekeeping, servicing the programmer, and servicing other communications.
2 All of these steps execute every sweep. Although the Programmer Communications Window opens each sweep, programmer services only occur if a board fault has been detected or if the programming device issues a service request; that is, the Programmer Communications Window first checks for work to do and exits if there is none. The sequence of the standard program sweep is shown in the following figure.
2 As shown in the PLC sweep sequence, several items are included in the sweep. These items contribute to the total sweep time as shown in the following table. Table 2-1. Sweep Time Contribution Sweep Element Description Time Contribution (ms) 4 351/352 (350 and 360 series—see note) Housekeeping • Calculate sweep time. • Schedule start of next sweep. • Determine mode of next sweep. • Update fault reference tables. • Reset watchdog timer. 0.
2 Table 2-2. I/O Scan Time Contributions for the 90-30 350 and 360 Series (in milliseconds) Module Type CPU 350 and 360 Series Main Rack 8-point discrete input .030 16-point discrete input .030 32-point discrete input .043 8-point discrete output .030 16-point discrete output .030 32-point discrete output .042 Combination discrete input/output .060 4-channel analog input .075 2-channel analog output .058 16-channel analog input .978 (current or voltage) 8-channel analog output 1.
2 Sweep Time Calculation Table 2-1 lists the seven items that contribute to the sweep time of the PLC. The sweep time consists of fixed times (housekeeping and diagnostics) and variable times. Variable times vary according to the I/O configuration, size of the user program, and the type of programming device connected to the PLC. Example of Sweep Time Calculation An example of the calculations for determining the sweep time for a Series 90-30 model 331 PLC are shown in the table shown below.
2 time. In order to maintain accuracy, the actual start of sweep is recorded in 100 microsecond increments. Each timer has a remainder field which contains the number of 100 microsecond increments that have occurred since the last time the timer value was incremented. Input Scan Scanning of inputs occurs during the input scan portion of the sweep, just prior to the logic solution.
2 Application Program Logic Scan or Solution The application program logic scan is when the application logic program actually executes. The logic solution always begins with the first instruction in the user application program immediately following the completion of the input scan. Solving the logic provides a new set of outputs. The logic solution ends when the END instruction is executed (the END is invisible unless you are using a Hand-Held Monitor).
2 Output Scan Outputs are scanned during the output scan portion of the sweep, immediately following the logic solution. Outputs are updated using data from %Q (for discrete outputs) and %AQ (for analog outputs) memory, as appropriate. If the Genius Communications Module is configured to transmit global data, then data from %G memory is sent to the GCM, GCM+, or GBC. The Series 90-20 and Micro output scans include discrete outputs only.
2 The following figure is a flow chart for the programmer communications portion of the sweep. a45659 START PROGRAMMER ATTACHED ATTACHED NO PREVIOUS STATUS ? PROGRAMMER REQUEST ? PROGRAMMER ATTACHED STATUS HAND-HELD PROGRAMMER ATTACHED NOT ATTACHED NOT ATTACHED ABORT OPERATION IN PROGRESS SETUP FOR HAND-HELD PROGRAMMER PREVIOUS STATUS ? ATTACHED KEY PRESSED ? YES PROCESS REQUEST NO YES SETUP FOR SERIES 90 PROTOCOL SEND INITIAL DISPLAY PROCESS KEY SEND NEW DISPLAY STOP Figure 2-2.
2 In the default Run-to-Completion mode, the length of the system communications window is limited to 50 milliseconds. If an intelligent option module makes a request that requires more than 50 milliseconds to process, the request is spread out over multiple sweeps so that no one sweep is impacted by more than 50 milliseconds. START a43066 ANY REQUESTS IN QUEUE ? NO YES DEQUEUE A REQUEST PROCESS THE REQUEST NO WINDOW TIMER TIMEOUT ? YES POLLING STOPPED ? NO YES RESTART POLLING STOP Figure 2-3.
2 PCM Communications with the PLC (Models 331 and Higher) There is no way for intelligent option modules (IOM), such as the PCM, to interrupt the CPU when they need service. The CPU must poll each intelligent option module for service requests. This polling occurs asynchronously in the background during the sweep (see flow chart below). When an intelligent option module is polled and sends the CPU a service request, the request is queued for processing during the system communications window.
2 Standard Program Sweep Variations In addition to the normal execution of the standard program sweep, certain variations can be encountered or forced. These variations, described in the following paragraphs, can be displayed and/or changed from the programming software. Constant Sweep Time Mode In the standard program sweep, each sweep executes as quickly as possible with a varying amount of time consumed each sweep.
2 Communication Window Modes The default window mode for the programmer communication window is “Limited” mode. That means that if a request takes more than 6 milliseconds to process, it is processed over multiple sweeps, so that no one sweep is impacted by more than 6 milliseconds. For the 313, 323, and 331 CPUs, the sweep impact may be as much as 12 milliseconds during a RUN-mode store.
2 Clearing the Fault Table with the Key Switch If you turn the key from the RUN to STOP and back to RUN position during the 5 seconds when the RUN light is flashing this will cause the faults to be cleared and the CPU will be placed into RUN mode. The light will stop flashing and will go solid ON at this point. The switch is required to be kept in either RUN or STOP position for at least 1/2 second before switching back to the other position.
2 Section 2: Program Organization and User References/Data The total logic size for the Series 90-30 programmable controller can be up to 6 KB in size for a Model 311 or Model 313 CPU, up to 16 KB in size for a Model 331, up to 32 KB in size for Model 340 CPUs, 74 KB for Model 350 (32 KB for program logic) and, prior to Release 9, up to 80 KB for Models 341, 351 and 352 CPUs. Beginning with Release 9 CPUs, some memory sizes for the 351, 352 and 360 series are configurable.
2 Note Subroutine blocks are not available for the Series 90-20 PLC or for the Micro. The use of subroutines is optional. Dividing a program into smaller subroutines can simplify programming, enhance understanding of the control algorithm, and reduce the overall amount of logic needed for the program.
2 Examples of Using Subroutine Blocks As an example, the logic for a program could be divided into three subroutines, each of which could be called as needed from the program. In this example, the program block might contain little logic, serving primarily to sequence the subroutine blocks. a45661 SUBROUTINE 2 PROGRAM SUBROUTINE 3 SUBROUTINE 4 A subroutine block can be used many times as the program executes.
2 In addition to being called from the program, subroutine blocks can also be called by other subroutine blocks. A subroutine block may even call itself. a45663 SUBROUTINE 2 SUBROUTINE 4 PROGRAM SUBROUTINE 3 The PLC will only allow eight nested calls before an “Application Stack Overflow” fault is logged and the PLC transitions to STOP/Fault mode. The call level nesting counts the main program as level 1.
2 User References The data used in an application program is stored as either register or discrete references. Table 2-3. Register References Type Description %R The prefix %R is used to assign system register references, which will store program data such as the results of calculations. %AI The prefix %AI represents an analog input register. This prefix is followed by the register address of the reference (for example, %AI0015).
2 Table 2-4. Discrete References - Continued Type Description %T The %T prefix represents temporary references. These references are never checked for multiple coil use and can, therefore, be used many times in the same program even when coil use checking is enabled. %T may be used to prevent coil use conflicts while using the cut/paste and file write/include functions.
2 When %Q or %M references are used with retentive coils, or are used as function block outputs, the contents are retained through power loss and RUN-TO-STOP-TO-RUN transitions. Retentive coils include retentive coils —(M)—, negated retentive coils —(/M)—, retentive SET coils —(SM)—, and retentive RESET coils —(RM)—. The last time a %Q or %M reference is programmed on a coil instruction determines whether the %Q or %M reference is retentive or non-retentive based on the coil type.
2 Data Types Data types include the following: Table 2-5. Data Types Type Name Description INT Signed Integer Signed integers use 16-bit memory data locations, and are represented in 2’s complement notation. The valid range of an INT data type is –32,768 to +32,767. DINT Double Precision Signed Integer Double precision signed integers are stored in 32-bit data memory locations (actually two consecutive 16-bit memory locations) and represented in 2’s complement notation. (Bit 32 is the sign bit.
2 System Status References System status references in the Series 90 PLC are assigned to %S, %SA, %SB, and %SC memory. They each have a nickname. Examples of time tick references include T_10MS, T_100MS, T_SEC, and T_MIN. Examples of convenience references include FST_SCN, ALW_ON, and ALW_OFF. Note %S bits are read-only bits; do not write to these bits. You may, however, write to %SA, %SB, and %SC bits. Listed below are available system status references, which may be used in an application program.
2 Table 2-6. System Status References - Continued GFK-0467K Reference Name %S0017 %S0018 %S0019 SNPXACT SNPX_RD SNPX_WT Definition SNP-X host is actively attached to the CPU. SNP-X host has read data from the CPU. SNP-X host has written data to the CPU. %S0020 Set ON when a relational function using REAL data executes successfully. It is cleared when either input is NaN (Not a Number). %S0032 Reserved for use by the programming software.
2 Table 2-6. System Status References - Continued Reference Nickname Definition %SB0010 BAD_RAM Set when the CPU detects corrupted RAM memory at power-up. Cleared when the CPU detects that RAM memory is valid at power-up. %SB0011 BAD_PWD Set when a password access violation occurs. Cleared when the PLC fault table is cleared. %SB0013 SFT_CPU Set when the CPU detects an unrecoverable error in the software. Cleared by clearing the PLC fault table.
2 For a coil, the reference represents a location in memory that is controlled by the flow of power into the coil. In this example, if power flows into the left side of the coil, reference %Q0004 is turned ON. %Q0004 –( )– The programming software and the Hand-Held Programmer both have a coil check function that checks for multiple uses of %Q or %M references with relay coils or outputs on functions.
2 Function Block Parameters Each line entering the left side of a function block represents an input for that function. There are two forms of input that can be passed into a function block: constants and references. A constant is an explicit value. A reference is the address of a value. In the following example, input parameter I1 comes into the ADD function block as a constant, and input parameter I2 comes in as a reference.
2 For functions which operate on tables, a length can be selected for the function. In the following function block, a string length of up to 256 words can be selected for the logical AND function. _____ | | (enable) —| AND |— (ok) | | | | ???????—|I1 Q|—??????? | | | | ???????—|I2 | |_____| Timer, counter, BITSEQ, and ID functions require an address for the location of three words (registers) which store the current value, preset value, and a control word or “Instance” of the function.
2 Section 3: Power-Up and Power-Down Sequences There are two possible power-up sequences in the Series 90-30 PLC; a cold power-up and a warm power-up. The CPU normally uses the cold power-up sequence. However, in a Model 331 or higher PLC system, if the time that elapses between a power-down and the next power-up is less than five seconds, the warm power-up sequence is used. Power-Up A cold power-up consists of the following sequence of events. A warm power-up sequence skips Step 1. 1.
2 * Go to Clear All Process a45680 START 1 HHP CLR M KEYS T TRUE * CLEAR ALL FALSE 2 USD PRESENT AND VALID TRUE 3 FALSE 4 USD PRG SRC = PROM URAM PRG SRC = PROM FALSE TRUE FALSE 11 TRUE URAM CORRUPT 5 USD REG SRC = PROM URAM PRG SRC = PROM 6 8 TRUE 13 12 7 TRUE * CLEAR ALL FALSE FALSE TRUE HHP LD NOT KEYS TRUE STOP MODE FALSE COPY PRG ,CFG, & REGS FROM USD TO URAM 14 FALSE 9 USD NOT PRESENT FALSE FALSE HHP LD NOT KEYS TRUE TRUE HHP NOT RUN KEYS COPY PRG & CFG F
2 FLOW CHART TERMS: PRG = user program CFG = user configuration REGS = user registers (%I, %Q, %M, %G, %R, %AI, and %AQ references). USD = user storage device, either an EEPROM or flash device. URAM = non-volatile user ram which contains PRG, CFG, and REGS.
2 Power-Down System power-down occurs when the power supply detects that incoming AC power has dropped for more than one power cycle or the output of the 5-volt power supply has fallen to less than 4.9 volts DC.
2 Section 4: Clocks and Timers Clocks and timers provided by the Series 90-30 PLC include an elapsed time clock, a time-of-day clock (Models 331, 340/341, 350 and 360 series of 90-30 CPUs and the 28-point Micro), a watchdog timer, and a constant sweep timer. Three types of timer function blocks include an ondelay timer, an off-delay timer, and a retentive on-delay timer (also called a watch clock timer). Four time-tick contacts cycle on and off for 0.01 second, 0.1 second, 1.
2 Watchdog Timer A watchdog timer in the Series 90-30 PLC is designed to catch catastrophic failure conditions that result in an unusually long sweep. The timer value for the watchdog timer is 200 milliseconds (500 milliseconds in the 350 and 360 series of PLC CPUs); this is a fixed value that cannot be changed. The watchdog timer always starts from zero at the beginning of each sweep.
2 Section 5: System Security Security in Series 90-30, Series 90-20, and in the Micro PLCs is designed to prevent unauthorized changes to the contents of a PLC. There are four security levels available in the PLC. The first level, which is always available, provides only the ability to read PLC data; no changes are permitted to the application. The other three levels have access to each level protected by a password. Each higher privilege level permits greater change capabilities than the lower level(s).
2 Privilege Level Change Requests A programmer requests a privilege level change by supplying the new privilege level and the password for that level. A privilege level change is denied if the password sent by the programmer does not agree with the password stored in the PLC’s password access table for the requested level. The current privilege level is maintained and no change will occur.
2 Section 6: Series 90-30, 90-20, and Micro I/O System The PLC I/O system provides the interface between the Series 90-30 PLC and user-supplied devices and equipment. Series 90-30 I/O is called Model 30 I/O. Model 30 I/O modules plug directly into slots in the CPU baseplate or into slots in any of the expansion baseplates for the Series 90-30 PLC Model 331 or higher. Model 331, 340, and 341 I/O systems support up to 49 Model 30 I/O modules (5 racks).
2 Model 30 I/O Modules Model 30 I/O modules are available as five types, discrete input, discrete output, analog input, analog output, and option modules. The following table lists the Model 30 I/O modules by catalog number, number of I/O points, and a brief description of each module. Note All of the I/O modules listed below may not be available at the time this manual is printed. For current availability, consult your local GE Fanuc PLC distributor or GE Fanuc sales representative.
2 Table 2-7. Model 30 I/O Modules - Continued Catalog Number Points Description Pub Number Discrete Modules - Output IC693MDL310 12 120 VAC, 0.5A GFK-0898 IC693MDL330 IC693MDL340 IC693MDL390 8 16 5 120/240 VAC, 2A 120 VAC, 0.5A 120/240 VAC Isolated, 2A GFK-0898 GFK-0898 GFK-0898 IC693MDL730 IC693MDL731 8 8 12/24 VDC Positive Logic, 2A 12/24 VDC Negative Logic, 2A GFK-0898 GFK-0898 IC693MDL732 8 12/24 VDC Positive Logic, 0.
2 Table 2-7.
2 Global Data The Series 90-30 PLC supports very fast sharing of data between multiple CPUs using Genius global data. The Genius Bus Controller, IC693BEM331 in CPU, version 5 and later, and the Enhanced Genius Communications Module, IC693CMM302, can broadcast up to 128 bytes of data to other PLCs or computers. They can receive up to 128 bytes from each of the up to 30 other Genius controllers on the network. Data can be broadcast from or received into any memory type, not just %G global bits.
2 Micro PLCs The following Series 90 Micro PLCs are available. Each Micro is listed by catalog number, number of I/O points, and a brief description. The CPU, power supply, and I/O are all part of one unit. For the specifications and wiring information of each module, refer to the Series 90 Micro Programmable Controller User’s Manual, GFK-1065. Catalog Number GFK-0467K Description I/O Points IC693UDR001 CPU, Power Supply, and I/O (all one unit) Micro–14 pt.
Chapter Fault Explanation and Correction 3 This chapter is an aid to troubleshooting the Series 90-30, 90-20, and Micro PLC systems. It explains the fault descriptions, which appear in the PLC fault table, and the fault categories, which appear in the I/O fault table. Each fault explanation in this chapter lists the fault description for the PLC fault table or the fault category for the I/O fault table.
3 Section 1: Fault Handling Note This information on fault handling applies to systems programmed using Logicmaster 90-30/20/Micro software. Faults occur in the Series 90-30 , 90-20, or Series 90 Micro PLC system when certain failures or conditions happen which affect the operation and performance of the system. These conditions, such as the loss of an I/O module or rack, may affect the ability of the PLC to control a machine or process.
3 Note For information specific to Micro PLC fault handling, refer to chapter 7 of the Series 90 Micro PLC User’s Manual (GFK-1065). System Reaction to Faults Typically, hardware failures require that either the system be shut down or the failure is tolerated. I/O failures may be tolerated by the PLC system, but they may be intolerable by the application or the process being controlled. Operational failures are normally tolerated.
3 Fault Action Faults may be fatal, diagnostic or informational. Fatal faults cause the fault to be recorded in the appropriate table, any diagnostic variables to be set, and the system to be halted. Diagnostic faults are recorded in the appropriate table, and any diagnostic variables are set. Informational faults are only recorded in the appropriate table. Possible fault actions are listed in the following table. Table 3-2. Fault Actions Fault Action Response by CPU Fatal Log fault in fault table.
3 Fault Reference Definitions The alarm processor maintains the states of the 128 system discrete bits in %S memory. These fault references can be used to indicate where a fault has occurred and what type of fault it is. Fault references are assigned to %S, %SA, %SB, and %SC memory, and they each have a nickname. These references are available for use in the application program as required. Refer to Chapter 2, “System Operation,” for a list of the system status references.
3 The programming software may be in any operating mode. If the programming software is in OFFLINE mode, no faults are displayed. In ONLINE or MONITOR mode, I/O fault data is displayed. In ONLINE mode, faults can be cleared (this feature may be password protected). Once cleared, faults which are still present are not logged again in the table. Accessing Additional Fault Information The fault tables contain basic information regarding the fault.
3 Section 2: PLC Fault Table Explanations Each fault explanation contains a fault description and instructions to correct the fault. Many fault descriptions have multiple causes. In these cases, the error code, displayed with the additional fault information, is used to distinguish different fault conditions sharing the same fault description. The error code is the first two hexadecimal digits in the fifth group of numbers, as shown in the following example.
3 Fault Actions Fatal faults cause the PLC to enter a form of STOP mode at the end of the sweep in which the error occurred. Diagnostic faults are logged and corresponding fault contacts are set. Informational faults are simply logged in the PLC fault table. Loss of, or Missing, Option Module The Fault Group Loss of, or Missing Option Module occurs when a PCM, CMM, or ADC fails to respond. The failure may occur at power-up if the module is missing or during operation if the module fails to respond.
3 Reset of, Addition of, or Extra, Option Module The Fault Group Reset of, Addition of, or Extra Option Module occurs when an option module (PCM, ADC, etc.) comes online, is reset, or a module is found in the rack, but none is specified in the configuration. The fault action for this group is Diagnostic. Three bytes of fault specific data provide additional information regarding the fault. Correction: (1) Update the configuration file to include the module. (2) Remove the module from the system.
3 System Configuration Mismatch The Fault Group Configuration Mismatch occurs when the module occupying a slot is different from that specified in the configuration file. The fault action is Fatal.
3 Option Module Software Failure The Fault Group Option Module Software Failure occurs when a non-recoverable software failure occurs on a PCM or ADC module. The fault action for this group is Fatal. Error Code: All Name: COMMREQ Frequency Too High Description: COMMREQs are being sent to a module faster than it can process them. Correction: Change the PLC program to send COMMREQs to the affected module at a slower rate.
3 Constant Sweep Time Exceeded The Fault Group Constant Sweep Time Exceeded occurs when the PLC CPU operates in CONSTANT SWEEP mode, and it detects that the sweep has exceeded the constant sweep timer. The fault extra data contains the actual time of the sweep in the first two bytes and the name of the program in the next eight bytes. The fault action for this group is Diagnostic. Correction: (1) Increase constant sweep time. (2) Remove logic from application program.
3 No User Program Present The Fault Group No User Program Present occurs when the PLC CPU is instructed to transition from STOP to RUN mode or a store to the PLC and no user program exists in the PLC. The PLC CPU detects the absence of a user program on power-up. The fault action for this group is Informational. Correction: Download an application program before attempting to go to RUN mode.
3 PLC CPU System Software Failure Faults in the Fault Group PLC CPU System Software Failure are generated by the operating software of the Series 90-30, 90-20 or Micro PLC CPU. They occur at many different points of system operation. When a Fatal fault occurs, the PLC CPU immediately transitions into a special ERROR SWEEP mode. No activity is permitted when the PLC is in this mode. The only way to clear this condition is to cycle power on the PLC. The fault action for this group is Fatal.
3 Error Code: Name: Description: Correction: Error Code: Name: Description: Correction: Error Code: Name: Description: Correction: Error Code: Name: Description: Correction: Error Code: Name: Description: Correction: Error Code: Name: Description: Correction: GFK-0467K 14, 27 Corrupted PLC Program Memory The PLC operating software generates these errors when certain PLC operating software problems occur. These should not occur in a production system.
3 Communications Failure During Store The Fault Group Communications Failure During Store occurs during the store of program blocks and other data to the PLC. The stream of commands and data for storing program blocks and data starts with a special start-of-sequence command and terminates with an end-of-sequence command. If communications with the programming device performing the store is interrupted or any other failure occurs which terminates the load, this fault is logged.
3 Section 3: I/O Fault Table Explanations The I/O fault table reports data about faults in three classifications: • Fault category. • Fault type. • Fault description. The faults described on the following page have a fault category, but do not have a fault type or fault group. Each fault explanation contains a fault description and instructions to correct the fault. Many fault descriptions have multiple causes.
3 Addition of I/O Module The Fault Category Addition of I/O Module applies to Model 30 discrete and analog I/O modules. There are no fault types or fault descriptions associated with this category. The fault action is Diagnostic. 3-18 Description: The PLC operating software generates this error when an I/O module which had been faulted returns to operation. Correction: (1) No action necessary if the module was removed or replaced, or the remote rack was power cycled.
Chapter Series 90-30/20/Micro Instructions Set 4 Programming consists of creating an application program for a PLC. Because the Series 90-30, 90-20, and Series 90 Micro PLCs have a common instruction set, all three can be programmed using this software. This chapter describes the programming instructions that may be used to create ladder logic programs for the Series 90-30 and Series 90-20 programmable controllers.
4 Section 1: Relay Functions This section explains the use of contacts, coils, and links in ladder logic rungs. Function Page Coils and negated coils. 4-3 Normally open and normal closed contacts. 4-2 Retentive and negated retentive coils. 4-4 Positive and negative transition coils. 4-5 SET and RESET coils. 4-6 Retentive SET and RESET coils. 4-7 Horizontal and vertical links. 4-7 Continuation coils and contacts. 4-8 Using Contacts A contact is used to monitor the state of a reference.
4 Using Coils Coils are used to control discrete references. Conditional logic must be used to control the flow of power to a coil. Coils cause action directly; they do not pass power flow to the right. If additional logic in the program should be executed as a result of the coil condition, an internal reference should be used for that coil or a continuation coil/contact combination may be used. Coils are always located at the rightmost position of a line of logic. A rung may contain up to eight coils.
4 Normally Open Contact —| |— A normally open contact acts as a switch that passes power flow if the associated reference is ON (1). Normally Closed Contact —|/|— A normally closed contact acts as a switch that passes power flow if the associated reference is OFF (0). Example: The following example shows a rung with 10 elements having nicknames from E1 to E10. Coil E10 is ON when reference E1, E2, E5, E6, and E9 are ON and references E3, E4, E7, and E8 are OFF.
4 Retentive Coil —(M)— Like a normally open coil, the retentive coil sets a discrete reference ON while it receives power flow. The state of the retentive coil is retained across power failure. Therefore, it cannot be used with references from strictly non-retentive memory (%T). Negated Retentive Coil —(/M)— The negated retentive coil sets a discrete reference ON when it does not receive power flow. The state of the negated retentive coil is retained across power failure.
4 SET Coil —(S) — SET and RESET are non-retentive coils that can be used to keep (“latch”) the state of a reference (e.g., E1) either ON or OFF. When a SET coil receives power flow, its reference stays ON (whether or not the coil itself receives power flow) until the reference is reset by another coil. SET coils write an undefined result to the transition bit for the given reference. (Refer to the information on “Transitions and Overrides” in chapter 2, “System Operation.
4 Retentive SET Coil —(SM)— Retentive SET and RESET coils are similar to SET and RESET coils, but they are retained across power failure or when the PLC transitions from STOP to RUN mode. A retentive SET coil sets a discrete reference ON if the coil receives power flow. The reference remains ON until reset by a retentive RESET coil. Retentive SET coils write an undefined result to the transition bit for the given reference.
4 Continuation Coils (———<+>) and Contacts (<+>———) Continuation coils (—————<+>) and continuation contacts (<+>———) are used to continue relay ladder rung logic beyond the limit of ten columns. The state of the last executed continuation coil is the flow state that will be used on the next executed continuation contact. There needs to be a continuation coil before the logic executes a continuation contact.
4 Section 2: Timers and Counters This section explains how to use on-delay and stopwatch-type timers, up counters, and down counters. The data associated with these functions is retentive through power cycles.
4 The control word stores the state of the boolean inputs and outputs of its associated function block, as shown in the following format: 7 15 14 13 12 11 10 9 8 6 5 4 3 2 1 0 Reserved Reserved Reset input Enable input, previous execution Q (counter/timer status output) EN (enable input) Bits 0 through 11 are used for timer accuracy; bits 0 through 11 are not used for counters. Note Use care if you use the same address for PV as the second word in the block of three words.
4 ONDTR A retentive on-delay timer (ONDTR) increments while it receives power flow and holds its value when power flow stops. Time may be counted in tenths of a second (the default selection), hundredths of a second, or thousandths of a second. The range is 0 to +32,767 time units. The state of this timer is retentive on power failure; no automatic initialization occurs at power-up. When the ONDTR first receives power flow, it starts accumulating time (current value).
4 _____ | | (enable) —|ONDTR|— Q | | |0.10s| | | (reset) —|R | | | | | (preset value) —|PV | |_____| (address) Parameters: Parameter address Description The ONDTR uses three consecutive words (registers) of %R memory to store the following: • Current value (CV) = word 1. • Preset value (PV) = word 2. • Control word = word 3. When you enter an ONDTR, you must enter an address for the location of these three consecutive words (registers) directly below the graphic representing the function.
4 Example: In the following example, a retentive on-delay timer is used to create a signal (%Q0011) that turns on 8.0 seconds after %Q0010 turns on, and turns off when %Q0010 turns off. | _____ | %Q0010 | | %Q0011 |——| |———|ONDTR|———————————————————————————————————————————————————————————( )— | | 0.
4 TMR The simple on-delay timer (TMR) function increments while it receives power flow and resets to zero when power flow stops. Time may be counted in tenths of a second (the default selection), hundredths of a second, or thousandths of a second. The range is 0 to +32,767 time units. The state of this timer is retentive on power failure; no automatic initialization occurs at power-up. When the TMR receives power flow, the timer starts accumulating time (current value).
4 Parameters: Parameter Description address The TMR uses three consecutive words (registers) of %R memory to store the following: • Current value (CV) = word 1. • Preset value (PV) = word 2. • Control word = word 3. When you enter a TMR, you must enter an address for the location of these three consecutive words (registers) directly below the graphic representing the function. Note: Do not use this address with other instructions.
4 Example: In the following example, a delay timer (with address) TMRID is used to control the length of time that coil DWELL is on. When the normally open (momentary) contact DO_DWL is on, coil DWELL is energized. The contact of coil DWELL keeps coil DWELL energized (when contact DO_DWL is released), and also starts the timer TMRID. When TMRID reaches its preset value of one-half second, coil REL energizes, interrupting the latched-on condition of coil DWELL.
4 OFDT The off-delay timer (OFDT) increments while power flow is off, and resets to zero when power flow is on. Time may be counted in tenths of a second (the default selection), hundredths of a second, or thousandths of a second. The range is 0 to +32,767 time units. The state of this timer is retentive on power failure; no automatic initialization occurs at power-up. When the OFDT first receives power flow, it passes power to the right, and the current value (CV) is set to zero.
4 _____ | | (enable) —|OFDT |— Q | | | time| | | | | | | (preset value) —|PV | |_____| (address—3 words) When the OFDT is used in a program block that is not called every sweep, the timer accumulates time between calls to the program block unless it is reset. This means that it functions like a timer operating in a program with a much slower sweep than the timer in the main program block.
4 Valid Memory Types: Parameter flow %I %Q %M %T %S %G %R address • %AI %AQ const none • • • • • enable • PV • Q • • • • • • • • Valid reference or place where power may flow through the function. Example: In the following example, an OFDT timer is used to turn off an output (%Q0001) whenever an input (%I0001) turns on. The output is turned on again 0.3 seconds after the input goes off.
4 UPCTR The Up Counter (UPCTR) function is used to count up to a designated value. The range is 0 to +32,767 counts. When the up counter reset is ON, the current value of the counter is reset to 0. Each time the enable input transitions from OFF to ON, the current value is incremented by 1. The current value can be incremented past the preset value PV. The output is ON whenever the current value is greater than or equal to the preset value.
4 Valid Memory Types: Parameter flow %I %Q %M %T %S %G address • R • PV • %AI %AQ const none • enable Q %R • • • • • • • • • • • • Valid reference or place where power may flow through the function. Example: In the following example, every time input %I0012 transitions from OFF to ON, up counter PRT_CNT counts up by 1; internal coil %M0001 is energized whenever 100 parts have been counted. Whenever %M0001 is ON, the accumulated count is reset to zero.
4 DNCTR The Down Counter (DNCTR) function is used to count down from a preset value. The minimum preset value is zero; the maximum present value is +32,767 counts. The minimum current value is –32,768. When reset, the current value of the counter is set to the preset value PV. When the enable input transitions from OFF to ON, the current value is decremented by one. The output is ON whenever the current value is less than or equal to zero.
4 Valid Memory Types: Parameter flow %I %Q %M %T %S %G address enable • R • Q %AI %AQ const none • • • PV • %R • • • • • • • • • • Valid reference or place where power may flow through the function. Example: In the following example, the down counter identified as COUNTP counts 5000 new parts before energizing output %Q0005.
4 Example: In the following example, the PLC is used to keep track of the number of parts contained in a temporary storage area. There are two ways of accomplishing this function using the Series 9030/20/Micro instruction set. The first method is to use an up/down counter pair with a shared register for the accumulated or current value. When the parts enter the storage area, the up counter increments by 1, increasing the current value of the parts in storage by a value of 1.
4 The second method, shown below, uses the ADD and SUB functions to provide storage tracking.
4 Section 3: Math Functions This section describes the math functions of the Series 90-30/20/Micro Instruction Set: † Abbreviation Function ADD Addition SUB Subtraction MUL Multiplication DIV Description Page Add two numbers. 4-27 Subtract one number from another. 4-27 Multiply two numbers. 4-27 Division Divide one number by another, yielding a quotient. 4-27 MOD Modulo Division Divide one number by another, yielding a remainder.
4 Standard Math Functions (ADD, SUB, MUL, DIV) Math functions include addition, subtraction, multiplication, and division. When a function receives power flow, the appropriate math function is performed on input parameters I1 and I2. These parameters must be the same data type. Output Q is the same data type as I1 and I2. Note DIV rounds down; it does not round to the closest integer. (For example, 24 DIV 5 = 4.) Math functions operate on these types of data: Data Type INT Description Signed integer.
4 Parameters: Parameter Description enable When the function is enabled, the operation is performed. I1 I1 contains a constant or reference for the first value used in the operation. (I1 is on the left side of the mathematical equation, as in I1 — I2). I2 I2 contains a constant or reference for the second value used in the operation. (I2 is on the right side of the mathematical equation, as in I1 — I2).
4 Math Functions and Data Types Function ADD INT Operation Displays as Q(16 bit) = I1(16 bit) + I2(16 bit) 5-digit base 10 number with sign ADD DINT Q(32 bit) = I1(32 bit) + I2(32 bit) 8-digit base 10 number with sign ADD REAL* Q(32 bit) = I1(32 bit) + I2(32 bit) 7-digit base 10 number, sign and decimal SUB INT Q(16 bit) = I1(16 bit) – I2(16 bit) 5-digit base 10 number with sign SUB DINT Q(32 bit) = I1(32 bit) – I2(32 bit) 8-digit base 10 number with sign SUB REAL* Q(32 bit) = I1(32 bit)
4 A common application is to scale analog input values with a MUL operation followed by a DIV and possibly an ADD operation. With a range up to 32000, using a MUL INT will overflow. Using an %AI value for a MUL DINT will also not work as the 32-bit I1 will combine 2 analog inputs at the same time. You must move the analog input to the low word of a double register, then test the sign and set the second register to 0 if positive or –1 if it was negative.
4 MOD (INT, DINT) The Modulo (MOD) function is used to divide one value by another value of the same data type, to obtain the remainder. The sign of the result is always the same as the sign of input parameter I1. The MOD function operates on these types of data: Data Type INT DINT Description Signed integer. Double precision signed integer. The default data type is signed integer; however, it can be changed after selecting the function.
4 Valid Memory Types: Parameter flow %I %Q %M %T enable • I1 o o o I2 o o o o o o ok %G %R %AI %AQ const o o • • • •† o o • • • •† o o • • • • Q • o † %S none • Valid reference or place where power may flow through the function. Valid reference for INT data only; not valid for DINT. Constants are limited to values between –32,768 and +32,767 for double precision signed integer operations.
4 SQRT (INT, DINT, REAL) The Square Root (SQRT) function is used to find the square root of a value. When the function receives power flow, the value of output Q is set to the integer portion of the square root of the input IN. The output Q must be the same data type as IN. The SQRT function operates on these types of data: Data Type INT Description Signed integer. DINT Double precision signed integer. REAL Floating Point.
4 Valid Memory Types: Parameter flow enable • IN ok o † %Q %M %T o o o o %S %G %R o • %AI %AQ const • • • Q • %I none •† • o o o o o • • • Valid reference or place where power may flow through the function. Valid reference for INT data only; not valid for DINT and REAL. Constants are limited to values between –32,768 and +32,767 for double precision signed integer operations.
4 Trig Functions (SIN, COS, TAN, ASIN, ACOS, ATAN) The SIN, COS, and TAN functions are used to find the trigonometric sine, cosine, and tangent, respectively, of its input. When one of these functions receives power flow, it computes the sine (or cosine or tangent) of IN, whose units are radians, and stores the result in output Q. Both IN and Q are floating-point values. The ASIN, ACOS, and ATAN functions are used to find the inverse sine, cosine, and tangent, respectively, of its input.
4 Parameters: Parameter enable Description When the function is enabled, the operation is performed. IN IN contains the constant or reference real value to be operated on. ok The ok output is energized when the function is performed without overflow, unless an invalid operation occurs and/or IN is NaN. Q Output Q contains the trigonometric value of IN.
4 Logarithmic/Exponential Functions (LOG, LN, EXP, EXPT) The LOG, LN, and EXP functions have two input parameters and two output parameters. When the function receives power flow, it performs the appropriate logarithmic/exponential operation on the real value in input IN and places the result in output Q. • For the LOG function, the base 10 logarithm of IN is placed in Q. • For the LN function, the natural logarithm of IN is placed in Q.
4 Valid Memory Types: Parameter flow enable • IN* ok • %I %Q %M Q * • %T %S %G %R %AI %AQ const • • • • none • • • • For the EXPT function, input IN is replaced by input parameters I1 and I2. Valid reference or place where power may flow through the function. Example: In the following example, the value of %AI0001 is raised to the power of 2.5 and the result is placed in %R0001.
4 Radian Conversion (RAD, DEG) When the function receives power flow, the appropriate conversion (RAD_TO_DEG or DEG_TO_RAD, i.e., Radian to Degree or vice versa) is performed on the real value in input IN and the result is placed in output Q. The ok output will receive power flow unless IN is NaN (Not a Number).
4 Valid Memory Types: Parameter flow enable • IN ok • %I %Q %M %T %S %G Q • %R %AI %AQ const • • • • none • • • • Valid reference or place where power may flow through the function. Example: In the following example, +1500 is converted to DEG and is placed in %R0001. | _____ |ALW_ON | | |——] [———————————————————————————| RAD_| | | | | | TO_| | | | | | DEG | | CONST | | | +1500.000 —|IN Q|— %R0001 | |_____| 85943.
4 Section 4: Relational Functions Relational functions are used to compare two numbers. This section describes the following relational functions: Abbreviation Function EQ Equal Description Page Test two numbers for equality. 4-41 NE Not Equal Test two numbers for non-equality. 4-41 GT Greater Than Test for one number greater than another. 4-41 GE Greater Than or Equal Test for one number greater than or equal to another. 4-41 LT Less Than Test for one number less than another.
4 Parameters: Parameter Description enable When the function is enabled, the operation is performed. I1 I1 contains a constant or reference for the first value to be compared. (I1 is on the left side of the relational equation, as in I1 < I2). I2 I2 contains a constant or reference for the second value to be compared. (I2 is on the right side of the relational equation, as in I1 < I2). Q Output Q is energized when I1 and I2 match the specified relation. Note I1 and I2 must be valid numbers, i.e.
4 Example: In the following example, two double precision signed integers, PWR_MDE and BIN_FUL, are compared whenever %I0001 is set. If PWR_MDE is less than or equal to BIN_FUL, coil %Q0002 is turned on.
4 RANGE (INT, DINT, WORD) The RANGE function is used to determine if a value is between the range of two numbers. Note This function is available only to Release 4.41 or later CPUs. The RANGE function operates on these types of data: Data Type INT DINT WORD Description Signed integer. Double precision signed integer. Word data type. The default data type is signed integer; however, it can be changed after selecting the function.
4 Parameters: Parameter Description enable When the function is enabled, the operation is performed. L1 L1 contains the start point of the range. L2 L2 contains the end point of the range. IN IN contains the value to be compared against the range specified by L1 and L2. Q Output Q is energized when the value in IN is within the range specified by L1 and L2, inclusive.
4 Example 1: In the following example, %AI0001 is checked to be within a range specified by two constants, 0 and 100.
4 Section 5: Bit Operation Functions Bit operation functions perform comparison, logical, and move operations on bit strings. The AND, OR, XOR, and NOT functions operate on a single word. The remaining bit operation functions may operate on multiple words, with a maximum string length of 256 words. All bit operation functions require WORD data.
4 The following bit operation functions are described in this section: Abbreviation Function AND Logical AND If a bit in bit string I1 and the corresponding bit in bit string I2 are both 1, place a 1 in the corresponding location in output string Q. 4-49 OR Logical OR If a bit in bit string I1 and/or the corresponding bit in bit string I2 are both 1, place a 1 in the corresponding location in output string Q.
4 AND and OR (WORD) Each scan that power is received, the AND or OR function examines each bit in bit string I1 and the corresponding bit in bit string I2, beginning at the least significant bit in each. For each two bits examined for the AND function, if both are 1, then a 1 is placed in the corresponding location in output string Q. If either or both bits are 0, then a 0 is placed in string Q in that location.
4 Valid Memory Types: Parameter flow %I %Q %M %T %S %G %R enable • I1 • • • • • • • • • • I2 • • • • • • • • • • • • • • •† • • • • ok • none • Q • † %AI %AQ const Valid reference or place where power may flow through the function. %SA, %SB, or %SC only; %S cannot be used. Example: In the following example, whenever input %I0001 is set, the 16-bit strings represented by nicknames WORD1 and WORD2 are examined.
4 XOR (WORD) The Exclusive OR (XOR) function is used to compare each bit in bit string I1 with the corresponding bit in string I2. If the bits are different, a 1 is placed in the corresponding position in the output bit string. Each scan that power is received, the function examines each bit in string I1 and the corresponding bit in string I2, beginning at the least significant bit in each. For each two bits examined, if only one is 1, then a 1 is placed in the corresponding location in bit string Q.
4 Valid Memory Types: Parameter flow %I %Q %M %T %S %G %R enable • I1 • • • • • • • • • • I2 • • • • • • • • • • • • • • •† • • • • ok none • Q • † %AI %AQ const • Valid reference or place where power may flow through the function. %SA, %SB, or %SC only; %S cannot be used. Example: In the following example, whenever %I0001 is set, the bit string represented by the nickname WORD3 is cleared (set to all zeros).
4 NOT (WORD) The NOT function is used to set the state of each bit in the output bit string Q to the opposite of the state of the corresponding bit in bit string I1. All bits are altered on each scan that power is received, making output string Q the logical complement of I1. The function passes power flow to the right whenever power is received.
4 Valid Memory Types: Parameter flow enable • I1 ok %Q %M %T %S %G %R • • • • • • • %AI %AQ const • • • Q • † %I none • • • • • • •† • • • • Valid reference or place where power may flow through the function. %SA, %SB, or %SC only; %S cannot be used. Example: In the following example, whenever input %I0001 is set, the bit string represented by the nickname TAC is set to the inverse of bit string CAT.
4 SHL and SHR (WORD) The Shift Left (SHL) function is used to shift all the bits in a word or group of words to the left by a specified number of places. When the shift occurs, the specified number of bits is shifted out of the output string to the left. As bits are shifted out of the high end of the string, the same number of bits is shifted in at the low end.
4 (enable) (word to be shifted) (number of bits) (bit shifted in) _____ | | —| SHL_| | | | WORD| | | —|IN B2|— (last bit shifted out) | LEN | |00001| | | | | —|N Q|— (output parameter Q) | | —|B1 | |_____| Parameters: Parameter Description enable When the function is enabled, the shift is performed. IN IN contains the first word to be shifted. N N contains the number of places (bits) that the array is to be shifted. B1 B1 contains the bit value to be shifted into the array.
4 Example: In the following example, whenever input %I0001 is set, the output bit string represented by the nickname WORD2 is made a copy of WORD1, left-shifted by the number of bits represented by the nickname LENGTH. The resulting open bits at the beginning of the output string are set to the value of %I0002.
4 ROL and ROR (WORD) The Rotate Left (ROL) function is used to rotate all the bits in a string a specified number of places to the left. When rotation occurs, the specified number of bits is rotated out of the input string to the left and back into the string on the right. The Rotate Right (ROR) function rotates the bits in the string to the right. When rotation occurs, the specified number of bits is rotated out of the input string to the right and back into the string on the left.
4 Valid Memory Types: Parameter flow %I %Q %M %T %S enable • IN • • • • • N • • • • • • • • ok %R %AI %AQ const • • • • • • • • • • • • • Q • † %G none • • •† Valid reference or place where power may flow through the function. %SA, %SB, or %SC only; %S cannot be used. Example: In the following example, whenever input %I0001 is set, the input bit string %R0001 is rotated 3 bits and the result is placed in %R0002.
4 BTST (WORD) The Bit Test (BTST) function is used to test a bit within a bit string to determine whether that bit is currently 1 or 0. The result of the test is placed in output Q. Each sweep power is received, the BTST function sets its output Q to the same state as the specified bit. If a register rather than a constant is used to specify the bit number, the same function block can test different bits on successive sweeps.
4 Valid Memory Types: Parameter flow %I %Q %M %T %S %G %R enable • IN • • • • • • • • • BIT • • • • • • • • Q • • %AI %AQ const none • • Valid reference or place where power may flow through the function. Example: In the following example, whenever input %I0001 is set, the bit at the location contained in reference PICKBIT is tested. The bit is part of string PRD_CDE. If it is 1, output Q passes power flow, and the coil %Q0001 is turned on.
4 BSET and BCLR (WORD) The Bit Set (BSET) function is used to set a bit in a bit string to 1. The Bit Clear (BCLR) function is used to clear a bit within a string by setting that bit to 0. Each sweep that power is received, the function sets the specified bit to 1 for the BSET function or to 0 for the BCLR function. If a variable (register) rather than a constant is used to specify the bit number, the same function block can set different bits on successive sweeps.
4 Valid Memory Types: Parameter flow %I %Q %M %T %S %G %R enable • IN • • • • † • • • • BIT • • • • • • • • ok • † • %AI %AQ const none • • Valid reference or place where power may flow through the function. %SA, %SB, or %SC only; %S cannot be used. Example: In the following example, whenever input %I0001 is set, bit 12 of the string beginning at reference %R0040 is set to 1.
4 BPOS (WORD) The Bit Position (BPOS) function is used to locate a bit set to 1 in a bit string. Each sweep that power is received, the function scans the bit string starting at IN. When the function stops scanning, either a bit equal to 1 has been found or the entire length of the string has been scanned. POS is set to the position within the bit string of the first non-zero bit; POS is set to zero if no nonzero bit is found. A string length of 1 to 256 words can be selected.
4 Valid Memory Types: Parameter flow %I %Q %M %T %S %G %R enable • IN • • • • • • • • • POS • • • • • • • • ok • • %AI %AQ const none • Valid reference or place where power may flow through the function. Example: In the following example, if %I0001 is set, the bit string starting at %M0001 is searched until a bit equal to 1 is found, or 6 words have been searched. Coil %Q0001 is turned on.
4 MSKCMP (WORD, DWORD) The Masked Compare (MSKCMP) function (available for Release 4.41 or later CPUs) is used to compare the contents of two separate bit strings with the ability to mask selected bits. The length of the bit strings to be compared is specified by the LEN parameter (where the value of LEN specifies the number of 16-bit words for the MSKCMPW function and 32-bit words for the MSKCMPD function).
4 (enable) (input parameter I1) (input parameter I2) (bit string mask) (bit number) _____ | | —|MASK_|| | |COMP_| | | | WORD| | | —|I1 MC|— (miscompare) | LEN | |00001| | | —|I2 Q|— (output parameter Q) | | | | —|M BN|— (bit number for last miscompare) | | | | —|BIT | |_____| Parameters: Parameter enable Description Permissive logic to enable the function. I1 Reference for the first bit string to be compared. I2 Reference for the second bit string to be compared.
4 Example: In the following example, after first scan, the MSKCMPW function block is executed. %M0001 through %M0016 is compared with %M0017 through %M0032. %M0033 through %M0048 contains the mask value. The value in %R0001 determines at which bit position the comparison starts within the two input strings.
4 Section 6: Data Move Functions Data move functions provide basic data move capabilities. This section describes the following data move functions: GFK-0467K Abbreviation Function Description MOVE Move Copy data as individual bits. The maximum length allowed is 256 words, except MOVE_BIT is 256 bits. Data can be moved into a different data type without prior conversion. 4-70 BLKMOV Block Move Copy a block of seven constants to a specified memory location.
4 MOVE (BIT, INT, WORD, REAL) Use the MOVE function to copy data (as individual bits) from one location to another. Because the data is copied in bit format, the new location does not need to be the same data type as the original location. The MOVE function has two input parameters and two output parameters. When the function receives power flow, it copies data from input parameter IN to output parameter Q as bits.
4 Parameters: Parameter Description enable When the function is enabled, the move is performed. IN IN contains the value to be moved. For MOVE_BIT, any discrete reference may be used; it does not need to be byte aligned. However, 16 bits, beginning with the reference address specified, are displayed online. ok The ok output is energized whenever the function is enabled. Q When the move is performed, the value at IN is written to Q.
4 Example 1: When enabling input %Q0014 is ON, 48 bits are moved from memory location %M0001 to memory location %M0033. Even though the destination overlaps the source for 16 bits, the move is done correctly (except for the 351 and 352 CPUs as noted on previously).
4 BLKMOV (INT, WORD, REAL) Use the Block Move (BLKMOV) function to copy a block of seven constants to a specified location. Note The REAL data type is only available on 350 and 360 series CPUs, Release 9 or later, or on all releases of CPU352. The BLKMOV function has eight input parameters and two output parameters. When the function receives power flow, it copies the constant values into consecutive locations, beginning at the destination specified in output Q.
4 Valid Memory Types: Parameter flow enable • %I %Q %M %T %S %G %R %AI %AQ const IN1 — IN7 ok none • • • Q • • • • o† • • • • Note: For REAL data, the only valid types are %R, %AI, and %AQ. • o † Valid reference for place where power may flow through the function. Valid reference for WORD data only; not valid for INT or REAL. %SA, %SB, %SC only; %S cannot be used.
4 BLKCLR (WORD) Use the Block Clear (BLKCLR) function to fill a specified block of data with zeros. The BLKCLR function has two input parameters and one output parameter. When the function receives power flow, it writes zeros into the memory location beginning at the reference specified by IN. When the data to be cleared is from discrete memory (%I, %Q, %M, %G, or %T), the transition information associated with the references is also cleared.
4 Valid Memory Types: Parameter flow enable • IN ok • † %I %Q %M %T %S %G %R • • • • •† • • %AI %AQ const • none • • • Valid reference or place where power may flow through the function. %SA, %SB, %SC only; %S cannot be used. Example: In the following example, at power-up, 32 words of %Q memory (512 points) beginning at %Q0001 are filled with zeros.
4 SHFR (BIT, WORD) Use the Shift Register (SHFR) function to shift one or more data words or data bits from a reference location into a specified area of memory. For example, one word might be shifted into an area of memory with a specified length of five words. As a result of this shift, another word of data would be shifted out of the end of the memory area.
4 Parameters: Parameter Description enable When enable is energized and R is not, the shift is performed. R When R is energized, the shift register located at ST is filled with zeros. IN IN contains the value to be shifted into the first bit or word of the shift register. For SHFR_BIT, any discrete reference may be used; it does not need to be byte aligned. However, 16 bits, beginning with the reference address specified, are displayed online.
4 Example 1: In the following example, the shift register operates on register memory locations %R0001 through %R0100. When the reset reference CLEAR is active, the shift register words are set to zero. When the NXT_CYC reference is active and CLEAR is not active, the word from output status table location %Q0033 is shifted into the shift register at %R0001. The word shifted out of the shift register from %R0100 is stored in output %M0005.
4 BITSEQ (BIT) The Bit Sequencer (BITSEQ) function performs a bit sequence shift through an array of bits. The BITSEQ function has five input parameters and one output parameter. The operation of the function depends on the previous value of the parameter EN, as shown in the following table. R Current Execution EN Previous Execution EN Current Execution OFF OFF OFF Bit sequencer does not execute. OFF OFF ON Bit sequencer increments/decrements by 1. OFF ON OFF Bit sequencer does not execute.
4 (enable) (reset) (direction) (number) (starting address) _____ | | —| BIT_|— (ok) | | | SEQ | | | —|R | | LEN | |00001| —|DIR | | | | | —|STEP | | | | | —|ST | | | |_____| (address) - Enter the beginning address here. The control word stores the state of the boolean inputs and outputs of its associated function block, as shown in the following format: 15 14 13 12 11 10 9 7 8 6 5 4 3 2 1 0 Reserved Reserved O K (status input) E N (enable input) Note Bits 0 through 13 are not used.
4 Note Coil checking, for the BITSEQ function, checks for 16 bits from the ST parameter, even when LEN is less than 16. Valid Memory Types: Parameter flow %I %Q %M %T %S %G address %AI %AQ const none • • • enable • R • DIR • STEP • • • • ST • • • • ok • † %R •† • • • • • • • • • • • Valid reference or place where power may flow through the function.
4 COMMREQ Use the Communication Request (COMMREQ) function if the program needs to communicate with an intelligent module, such as a Genius Communications Module or a Programmable Coprocessor Module. Note The information presented on the following pages shows the format of the COMMREQ function. You will need additional information to program the COMMREQ for each type of device. Programming requirements for each module that uses the COMMREQ function are described in the module’s documentation.
4 The command block has the following structure: Length (in words) address Wait/No Wait Flag address + 1 Status Pointer Memory address + 2 Status Pointer Offset address + 3 Idle Timeout Value address + 4 Maximum Communication Time address + 5 address + 6 Data Block to address + 133 Information required for the command block can be placed in the designated memory area using an appropriate programming function.
4 Example: In the following example, when enabling input %M0020 is ON, a command block located starting at %R0016 is sent to communications task 1 in the device located at rack 1, slot 2 of the PLC. If an error occurs processing the COMMREQ, %Q0100 is set.
4 Section 7: Table Functions Table functions are used to perform the following functions: Abbreviation Function ARRAY_MOVE Array Move Copy a specified number of data elements from a source array to a destination array. 4-87 SRCH_EQ Search Equal Search for all array values equal to a specified value. 4-91 SRCH_NE Description Search Not Equal Search for all array values not equal to a specified value.
4 ARRAY_MOVE (INT, DINT, BIT, BYTE, WORD) Use the Array Move (ARRAY_MOVE) function to copy a specified number of data elements from a source array to a destination array. The ARRAY_MOVE function has five input parameters and two output parameters. When the function receives power flow, the number of data elements in the count indicator (N) is extracted from the input array starting with the indexed location (SR + SNX — 1).
4 Parameters: Parameter Description enable When the function is enabled, the operation is performed. SR SR contains the starting address of the source array. For ARRAY_MOVE_ BIT, any reference may be used; it does not need to be byte aligned. However, 16 bits, beginning with the reference address specified, are displayed online. SNX SNX contains the index of the source array. DNX DNX contains the index of the destination array. N N provides a count indicator.
4 Example 1: In this example, %R0003 — %R0007 of the array %R0001 — %R0016 is read and then written into %R0104 — %R0108 of the array %R0100 — %R0115.
4 Example 3: Using word memory, for SR and DS, the third least significant bit of %R0001 through the second least significant bit of %R0002 of the array containing all 16 bits of %R0001 and four bits of %R0002 is read and then written into the fifth least significant bit of %R0100 through the fourth least significant bit of %R0101 of the array containing all 16 bits of %R0100 and four bits of %R0101.
4 SRCH_EQ and SRCH_NE (INT, DINT, BYTE, WORD) SRCH_GT and SRCH_LT SRCH_GE and SRCH_LE Use the appropriate Search function listed below to search for all array values for that particular operation. Abbreviation Function Description SRCH_EQ Search Equal SRCH_NE Search Not Equal Search for all array values equal to a specified value. Search for all array values not equal to a specified value. SRCH_GT Search Greater Than Search for all array values greater than a specified value.
4 Parameters: Parameter Description enable When the function is enabled, the operation is performed. AR AR contains the starting address of the array to be searched. Input NX Input NX contains the index into the array at which to begin the search. IN IN contains the object of the search. Output NX Output NX holds the position within the array of the search target. FD FD indicates that an array element has been found and the function was successful.
4 Example 1: The array AR is defined as memory addresses %R0001 — %R0005. When EN is ON, the portion of the array between %R0004 and %R0005 is searched for an element whose value is equal to IN. If %R0001 = 7, %R0002 = 9, %R0003 = 6, %R0004 = 7, %R0005 = 7, and %R0100 = 7, then the search will begin at %R0004 and conclude at %R0004 when FD is set ON and a 4 is written to %R0101.
4 Section 8: Conversion Functions Use the conversion functions to convert a data item from one number type to another. Many programming instructions, such as math functions, must be used with data of one type. This section describes the following conversion functions: Abbreviation Function BCD-4 Convert to BCD-4 INT Convert to Signed Integer DINT 4-94 Description Page Convert a signed integer to 4-digit BCD format. 4-95 Convert BCD-4 or REAL to signed integer.
4 —>BCD-4 (INT) The Convert to BCD-4 function is used to output the 4-digit BCD equivalent of signed integer data. The original data is not changed by this function. Data can be converted to BCD format to drive BCD-encoded LED displays or presets to external devices such as high-speed counters. When the function receives power flow, it performs the conversion, making the result available via output Q.
4 Valid Memory Types: Parameter flow enable • IN ok %Q %M %T • • • • %S %G %R %AI %AQ const • • • • • • Q • %I none • • • • • • • • • Valid reference or place where power may flow through the function. Example: In the following example, whenever input %I0002 is set and no errors exist, the integer at input location %I0017 through %I0032 is converted to four BCD digits, and the result is stored in memory locations %Q0033 through %Q0048.
4 —>INT (BCD-4, REAL) The Convert to Signed Integer function is used to output the integer equivalent of BCD-4 or REAL data. The original data is not changed by this function. Note The REAL data type is only available on 350 and 360 series CPUs, Release 9 or later, or on all releases of CPU352. When the function receives power flow, it performs the conversion, making the result available via output Q. The function always passes power flow when power is received, unless the data is out of range.
4 Valid Memory Types: Parameter flow enable • IN ok %I %Q %M %T • • • • %S %G %R %AI %AQ const • • • • • • Q none • • • • • • • • • Note: For REAL data, the only valid types are %R, %AI, and %AQ. • Valid reference or place where power may flow through the function.
4 —>DINT (REAL) The Convert to Double Precision Signed Integer function is used to output the double precision signed integer equivalent of real data. The original data is not changed by this function. Note The REAL data type is only available on 350 and 360 series CPUs, Release 9 or later, or on all releases of CPU352. When the function receives power flow, it performs the conversion, making the result available via output Q.
4 Valid Memory Types: Parameter flow enable • IN ok %I %Q %M %T o o o o %S %G %R %AI %AQ const o • • • • • • • Q • • none • Valid reference or place where power may flow through the function. Example: In the following example, whenever input %I0002 is set, the real value at input location %R0017 is converted to a double precision signed integer, and the result is placed in location %R0001. The output %Q1001 is set whenever the function executes successfully.
4 —>REAL (INT, DINT, BCD-4, WORD) The Convert to Real function is used to output the real value of the input data. The original data is not changed by this function. When the function receives power flow, it performs the conversion, making the result available via output Q. The function passes power flow when power is received, unless the specified conversion would result in a value that is out of range.
4 Valid Memory Types: Parameter flow enable • IN ok • %I %Q o o %M %T o o %S %G %R %AI %AQ const o • • • • Q • o none • • • • Valid reference or place where power may flow through the function. Not valid for DINT_TO_REAL. Example: In the following example, the integer value of input IN is 678. The result value placed in %T0016 is 678.000.
4 —>WORD (REAL) The Convert to WORD function is used to output the WORD equivalent of real data. The original data is not changed by this function. Note This function is only available on the 350 and 360 series CPU. When the function receives power flow, it performs the conversion, making the result available via output Q. The function passes power flow when power is received, unless the specified conversion would result in a value that is outside the range 0 to FFFFh.
4 Valid Memory Types: Parameter flow enable • IN ok • Q • %I %Q %M %T %S %G %R %AI %AQ const • • • • none • • • • • • • • • Valid reference or place where power may flow through the function.
4 TRUN (INT, DINT) The Truncate function is used to round the real number toward zero. The original data is not changed by this function. Note The 350 and 360 series CPUs (Release 9 or later and all releases of CPU352) are the only Series 90-30 CPUs with floating point capability; therefore, the TRUN function has no applicability for other 90-30 CPUs. When the function receives power flow, it performs the conversion, making the result available via output Q.
4 Valid Memory Types: Parameter flow enable • IN ok • Q • o %I %Q %M %T %S %G %R %AI %AQ const • • • • none • o o o o o • • • Valid reference or place where power may flow through the function. Valid for REAL_TRUN_INT only. Example: In the following example, the displayed constant is truncated and the integer result 562 is placed in %T0001. | _____ |ALW_ON | | |——] [——————|REAL_|— | | | | |TRUN_| | | | | | INT | | CONST —|IN Q|—%T0001 |5.
4 Section 9: Control Functions This section describes the control functions, which may be used to limit program execution and alter the way the CPU executes the application program. (Refer to Chapter 2, section 1, “PLC Sweep Summary,” for information on the CPU sweep. Function Page CALL Causes program execution to go to a specified subroutine block. 4-108 DOIO Services for one sweep a specified range of inputs or outputs immediately.
4 CALL Use the CALL function to cause program execution to go to a specified subroutine block. ———————————————— | | -| CALL ??????? || | | (SUBROUTINE) | | | ———————————————— When the CALL function receives power flow, it causes the scan to go immediately to the designated subroutine block and execute it. After the subroutine block execution is complete, control returns to the point in the logic immediately following the CALL instruction.
4 DOIO The DO I/O (DOIO) function is used to update inputs or outputs for one scan while the program is running. The DOIO function can also be used to update selected I/O during the program in addition to the normal I/O scan. If input references are specified, the function allows the most recent values of inputs to be obtained for program logic. If output references are specified, DO I/O updates outputs based on the most current values stored in I/O memory.
4 The function passes power to the right whenever power is received, unless: • Not all references of the type specified are present within the selected range. • The CPU is not able to properly handle the temporary list of I/O created by the function. • The range specified includes I/O modules that are associated with a “Loss of I/O” fault.
4 Input Example 1: In the following example, when the enabling input %I0001 is ON, references %I0001 through %I0064 are scanned and %Q0001 is turned on. A copy of the scanned inputs is placed in internal memory from reference %M0001 through %M0064. The real input points are not updated. This form of the function can be used to compare the current values of input points with the values of input points at the beginning of the scan.
4 Output Example 1: In the following example, when the enabling input %I0001 is ON, the values at references %R0001 through %R0004 are written to analog output channels %AQ001 through %AQ004 and %Q0001 is turned on. The values at %AQ001 through %AQ004 are not written to the analog output modules.
4 Enhanced DO I/O Function for 331 and Later CPUs Caution If the Enhanced DO I/O function is used in a program, the program should not be loaded by a version of Logicmaster 90-30/20 software prior to 4.01. An enhanced version of the DO I/O (DOIO) function is available for Release 4.20, or later, of Models 331 and later CPUs. This enhanced version of the DOIO function can only be used on a single discrete input or discrete output 8-point, 16-point, or 32-point module.
4 SER The SER function (Sequential Event Recorder) function is used to collect data based on an event trigger. A function control block contains user-supplied information about function block execution, channel descriptions and operation parameters.
4 The Sequential Event Recorder function block is a 78-word array defining information about the data capture and trigger mechanism for the SER function. Perform these steps to configure parameters for the SER function block. 1. Set up the stored values for the array as defined in the table below. You can use block moves to initialize the registers, or initialize the data in the register table and store the table prior to activating the SER function. 2. Add the SER function to your ladder.
4 Parameter(Offset) Description Num of Samples(9) Specifies the sample buffer size, in bytes. Valid choices are 1 to 1024 samples. Num Samp After Trig(10) Specifies the number of samples that are stored in the sample buffer when the trigger condition becomes true. This parameter may be set to a value between 0 and (Number of Samples – 1). This parameter is valid only when the Trigger Mode is set to Trigger.
4 Status Extra Data The Status Extra Data provides additional state information for the SER function. GFK-0467K State Description Inactive State (1) State between the Reset State and the Active State. No actions are performed in this state. The Boolean output is held to no power flow. Transition to the Active State occurs when the function block receives enable power flow.
4 SER Data Block The SER Data Block contains the sample buffer, sample offsets, and trigger information. This information is supplied by the CPU and the user should only read from this data area. It is the users responsibility to allocate enough register space for the Data Block. The block format is as follows: Offset Parameter Description 0 Current sample offset number. References the location where the most recent sample was placed. The parameter is zero-based.
4 GFK-0467K • In a particular program, there can only be one Sequential Event Recorder function block that can be associated with each command and data block. • If the user selects an input module to be scanned the PLC will NOT verify the module is a DISCRETE INPUT MODULE, or that any Channel Descriptions associated with the module have valid lengths and offsets based upon the module size. The user is responsible for correctly setting up the sampling of an Input Module.
4 Example: In the following example, the offsets have been set up as described in the table below.
4 Offset Register 22 122 Parameter Description Value (dec) Value (hex) Channel description 5: Seg. Sel. : Length 8 0008 0 0000 -249 FF07 0 0000 23 123 Offset 24 124 Channel description 6: Seg. Sel. : Length 25 125 Offset The following is a description of the above control block. GFK-0467K • The status register is telling us that the FBK is in the Active state (2 - Active state).
4 last channel description is required to pad the sample buffer out to the 24 bits specified in the number of channels parameter. Since all 24 channels are configured there are no more channel descriptions needed and we have reached the end of our block.
4 END The END function provides a temporary end of logic. The program executes from the first rung to the last rung or the END function, whichever is encountered first. The END function unconditionally terminates program execution. There can be nothing after the end function in the rung. No logic beyond the END function is executed, and control is transferred to the beginning of the program for the next sweep.
4 MCR All rungs between an active Master Control Relay (MCR) and its corresponding End Master Control Relay (ENDMCR) function are executed without power flow to coils. An ENDMCR function associated with the MCR is used to resume normal program execution. Unlike the JUMP instruction, MCRs can only occur in the forward direction. The ENDMCR instruction must appear after its corresponding MCR instruction in a program.
4 Both forms of the MCR function have the same parameters. They both have an enable boolean input EN and also a name which identifies the MCR. This name is used again with an ENDMCR instruction. Neither the MCR nor the MCRN function has any outputs; there can be nothing after an MCR in a rung. ??????? [ MCR ] *[ ??????? or -[ *[ MCRN] MCRN] Differences Between MCRs and JUMPs With an MCR function, function blocks within the scope of the MCR are executed without power flow, and coils are turned off.
4 Example: In the following example, whenever %I0002 allows power flow into the MCR function, program execution will continue without power flow to the coils until the associated ENDMCR is reached. If %I0001 and %I0003 are ON, %Q0001 is turned OFF and %Q0003 remains ON.
4 ENDMCR Use the End Master Control Relay (ENDMCR) function to resume normal program execution after an MCR function. When the MCR associated with the ENDMCR is active, the ENDMCR causes program execution to resume with normal power flow. When the MCR associated with the ENDMCR is not active, the ENDMCR has no effect. Logicmaster 90-30/20/Micro software supports two forms of the ENDMCR function, a non-nested and a nested form. The non-nested form, ENDMCR, must be used with the non-nested MCR function, MCR.
4 JUMP Use the JUMP instruction to cause a portion of the program logic to be bypassed. Program execution will continue at the LABEL specified. When the JUMP is active, all coils within its scope are left at their previous states. This includes coils associated with timers, counters, latches, and relays. Logicmaster 90-30/20/Micro software supports two forms of the JUMP instruction, a non-nested and a nested form.
4 Non-nested JUMP: ——————————————————————— —————————>> ??????? Nested JUMP: ——————————————————————— ———N—————>> ??????? Caution To avoid creating an endless loop with forward and backward JUMP instructions, a backward JUMP must contain a way to make it conditional. Example: In the following examples, whenever JUMP TEST1 is active, power flow is transferred to LABEL TEST1.
4 LABEL The LABEL instruction functions as the target destination of a JUMP. Use the LABEL instruction to resume normal program execution after a JUMP instruction. There can be only one LABEL with a particular label name in a program. Programs without a matched JUMP/LABEL pair can be created and stored to the PLC, but cannot be executed. Logicmaster 90-30/20/Micro software supports two forms of the LABEL function, a non-nested and a nested form.
4 COMMENT Use the COMMENT function to enter a comment (rung explanation) in the program. A comment can have up to 2048 characters of text. It is represented in the ladder logic like this: (* COMMENT *) The text can be read or edited by moving the cursor to (* COMMENT *) after accepting the rung and selecting Zoom (F10). Comment text can also be printed. Longer text can be included in printouts using an annotation text file, as described below: 1. Create the comment: A.
4 SVCREQ Use the Service Request (SVCREQ) function to request one of the following special PLC services: Table 4-3. Service Request Functions Function Description 1 2 3 4 Change/Read Constant Sweep Timer. Read Window Values. Change Programmer Communications Window Mode and Timer Value. Change System Comm. Window Mode and Timer Value. 6 7 13 14 15 16 18 23 26/30 29 Change/Read Checksum Task State and Number of Words to Checksum. Change/Read Time-of-Day Clock. Shut Down the PLC. Clear Fault Tables.
4 Parameters: Parameter Description enable When enable is energized, the request service request is performed. FNC FNC contains the constant or reference for the requested service. PARM PARM contains the beginning reference for the parameter block for the requested service. ok The ok output is energized when the function is performed without error.
4 SVCREQ #1: Change/Read Constant Sweep Timer Beginning with 90-30 CPU Release 8, use SVCREQ function #1 to: • Disable CONSTANT SWEEP mode. • Enable CONSTANT SWEEP mode and use the old timer value. • Enable CONSTANT SWEEP mode and use a new timer value. • Set a new timer value only. • Read CONSTANT SWEEP mode state and timer value. Note Of the CPUs discussed in this manual, Service Request 1 is supported only by 90-30 CPUs, beginning with Release 8.0.
4 Note After using SVCREQ function #1 with the parameter block on the previous page, Release 8 and higher CPUs will provide the return values 0 for Normal Sweep, 1 for Constant Sweep. Do not confuse this with the input values shown below. Successful execution will occur, unless: 1. A number other than 0, 1, 2, or 3 is entered as the requested operation: 0 Disable CONSTANT SWEEP mode. 1 Enable CONSTANT SWEEP mode. 2 Set a new timer value only. 3 Read CONSTANT SWEEP mode and timer value.
4 Example: This example shows logic in a program block. When enabling contact OV_SWP is set, the constant sweep timer is read, the timer is increased by two milliseconds, and the new timer value is sent back to the PLC. The parameter block is in local memory at location %R3050. Because the MOVE and ADD functions require three horizontal contact positions, the example logic uses discrete internal coil %M0001 as a temporary location to hold the successful result of the first rung line.
4 SVCREQ #2: Read Window Values Use SVCREQ function #2 to obtain the current window mode time values for the programmer communications window, the system communications window, and the background task window. Note Of the CPUs discussed in this manual, Service Request 2 is supported only by 90-30 CPUs, beginning with Release 8.0.
4 Example: In the following example, when enabling output %Q0102 is set, the PLC operating system places the current time values of the three windows in the parameter block starting at location %R5010. Additional examples showing the Read Window Values function are included in the next three SYS REQ function descriptions.
4 SVCREQ #3: Change Programmer Communications Window Mode and Timer Value Use SVCREQ function #3 to change the programmer communications window mode and timer value. The change will occur in the CPU sweep following the sweep in which the function is called. Note Of the CPUs discussed in this manual, Service Request 3 is supported only by 90-30 CPUs, beginning with Release 8.0.
4 Example: In the following example, when %M0125 transitions on, the programmer communications window is enabled and assigned a value of 25 ms. The parameter block is in memory location %R5051.
4 SVCREQ #4: Change System Comm. Window Mode and Timer Value Use SVCREQ function #4 to change the system communications window mode and timer value. The change will occur in the CPU sweep following the sweep in which the function is called. Note Of the CPUs discussed in this manual, Service Request 4 is supported only by 90-30 CPUs, beginning with Release 8.0. The SVCREQ function #4 will pass power flow to the right unless a mode other than 0 (Limited), 1 (Constant), or 2 (Run-to-Completion) is selected.
4 Example: In the following example, when enabling output %M0125 transitions on, the mode and timer value of the system communications window is read. If the timer value is greater than or equal to 25 ms, the value is not changed. If it is less than 25 ms, the value is changed to 25 ms. In either case, when the rung completes execution the window is enabled. The parameter block for all three windows is at location %R5051.
4 SVCREQ #6: Change/Read Number of Words to Checksum Use the SVCREQ function with function number 6 in order to: • Read the current word count. • Set a new word count. Successful execution will occur, unless some number other than 0 or 1 is entered as the requested operation (see below). For the Checksum Task functions, the parameter block has a length of 2 words.
4 Example: In the following example, when enabling contact FST_SCN is set, the parameter blocks for the checksum task function are built. Later in the program when input %I0137 turns on, the number of words being checksummed is read from the PLC operating system. This number is increased by 16, with the results of the ADD_INT function being placed in the “hold new count for set” parameter. The second service request block requests the PLC to set the new word count.
4 SVCREQ #7: Change/Read Time-of-Day Clock Use the SVCREQ function with function number 7 to read and set the time-of-day clock in the PLC. Note This function is available only in 331 or higher 90-30 CPUs and on the 28-point Series 90 Micro PLC CPUs (that is, IC693UDR005, IC693UAA007, and IC693UDR010) and the 23-point Series 90 Micro PLC CPUs (IC693UAL006). Successful execution will occur unless: 1. Some number other than 0 or 1 is entered as the requested operation (see below). 2.
4 Example: In the following example, when called for by previous logic, a parameter block for the time-of-day clock is built to first request the current date and time, and then set the clock to 12 noon using the BCD format. The parameter block is located at global data location %R0300. Array NOON has been set up elsewhere in the program to contain the values 12, 0, and 0. (Array NOON must also contain the data at %R0300.) The BCD format requires six contiguous memory locations for the parameter block.
4 Parameter Block Contents Parameter block contents for the different data formats are shown on the following pages. For both data formats: • Hours are stored in 24-hour format. • Day of the week is a numeric value: Value Day of the Week 1 Sunday 2 Monday 3 Tuesday 4 Wednesday 5 Thursday 6 Friday 7 Saturday To Change/Read Date and Time Using BCD Format: In BCD format, each of the time and date items occupies a single byte. This format requires six words.
4 To Change/Read Date and Time using Packed ASCII with Embedded Colons Format In Packed ASCII format, each digit of the time and date items is an ASCII formatted byte. In addition, spaces and colons are embedded into the data to permit it to be transferred unchanged to a printing or display device. This format requires 12 words. High Byte 1 = change Low Byte or 0 = read 3 4-148 Example output parameter block: Read Date and Time in Packed ASCII Format (Mon, Oct.
4 SVCREQ #8: Reset Watchdog Timer Use SVCREQ function #8 to reset the watchdog timer during the sweep. Note Of the CPUs discussed in this manual, Service Request 8 is supported only by 90-30 CPUs, beginning with Release 8.0. When the watchdog timer expires, the PLC shuts down without warning. This function allows the timer to keep going during a time-consuming task (for example, while waiting for a response from a communications line).
4 SVCREQ #9: Read Sweep Time from Beginning of Sweep Use SVCREQ function #9 to read the time in milliseconds since the start of the sweep. The data is in 16-bit Word format. Note Of the CPUs discussed in this manual, Service Request 9 is supported only by 90-30 CPUs, beginning with Release 8.0. The parameter block is an output parameter block only; it has a length of one word.
4 SVCREQ #10: Read Folder Name Use SVCREQ function #10 to read the name of the currently-executing folder. Note Of the CPUs discussed in this manual, Service Request 10 is supported only by 90-30 CPUs, beginning with Release 8.0. The output parameter block has a length of four words. It returns eight ASCII characters; the last is a null character (00h). If the program name has fewer than seven characters, null characters are appended to the end.
4 SVCREQ #11: Read PLC ID Use SVCREQ function #11 to read the name of the Series 90 PLC executing the program. Note Of the CPUs discussed in this manual, Service Request 11 is supported only by 90-30 CPUs, beginning with Release 8.0. The output parameter block has a length of four words. It returns eight ASCII characters; the last is a null character (00h). If the PLC ID has fewer than seven characters, null characters are appended to the end.
4 SVCREQ #12: Read PLC Run State Use SVCREQ function #12 to read the current RUN state of the PLC CPU. Note Of the CPUs discussed in this manual, Service Request 12 is supported only by 90-30 CPUs, beginning with Release 8.0. The parameter block is an output parameter block only; it has a length of one word. 1 = run/disabled address 2 = run/enabled Example: In the following example, the PLC run state is always read into location %R4002.
4 SVCREQ #13: Shut Down (Stop) PLC Use SVCREQ function #13 in order to stop the PLC at the end of the next sweep. All outputs will go to their designated default states at the beginning of the next PLC sweep. An informational fault is placed in the PLC fault table, noting that a “SHUT DOWN PLC” function block was executed. The I/O scan will continue as configured. This function has no parameter block.
4 SVCREQ #14: Clear Fault Tables Use SVCREQ function #14 in order to clear either the PLC fault table or the I/O fault table. The SVCREQ output is set ON unless some number other than 0 or 1 is entered as the requested operation (see below). For this function, the parameter block has a length of 1 word. It is an input parameter block only. 0 = clear PLC fault table. address 1 = clear I/O fault table.
4 SVCREQ #15: Read Last-Logged Fault Table Entry Use SVCREQ function #15 in order to read the last entry logged in either the PLC fault table or the I/O fault table. The SVCREQ output is set ON unless some number other than 0 or 1 is entered as the requested operation (see below), or the fault table is empty. (For additional information on fault table entries, refer to chapter 3, “Fault Explanations and Correction.”) For this function, the parameter block has a length of 22 words.
4 In the first byte of word address + 1, the Long/Short indicator defines the quantity of fault specific data present in the fault entry. It may be: PLC Fault Table: I/O Fault Table: 00 01 02 03 = = = = -8 24 —5 21 bytes bytes bytes bytes (short) (long) (short) (long) Example 1: In the following example, when input %I0251 is on and input %I0250 is on, the last entry in the PLC fault table is read into the parameter block.
4 Example 2: In the next example, the PLC is shut down when any fault occurs on an I/O module except when the fault occurs on modules in rack 0, slot 9 and in rack 1, slot 9. If faults occur on these two modules, the system remains running. The parameter for “table type” is set up on the first sweep. The contact IO_PRES, when set, indicates that the I/O fault table contains an entry. The PLC CPU sets the normally open contact in the sweep after the fault logic places a fault in the table.
4 | _____ |FST_SCN | | |——| |———|MOVE_|— | | | | | INT | | | | | CONST —|IN Q|— %R0600 | 0001 | LEN | | | 0001| | |_____| | | _____ | IO_PRES| | %T0001 |——| |———| SVC_|————————————————————————————————————————————————————————————( )— | | | | | REQ | | | | | CONST —|FNC | | 0015 | | | | | |%R0600 —|PARM | | |_____| | | _____ |%T0001 | | |——| |———| EQ_ |— | | | | | INT | | | | %M0007 |%R0603 —|I1 Q|————————————————————————————————————————————————————————————( )— | | | | | | | CONST —|I2 | | 0109 |_____| | | _
4 SVCREQ #16: Read Elapsed Time Clock Use the SVCREQ function with function number 16 in order to read the value of the system’s elapsed time clock. This clock tracks elapsed time in seconds since the PLC powered on. The timer will roll over approximately once every 100 years. This function has an output parameter block only. The parameter block has a length of 3 words.
4 SVCREQ #18: Read I/O Override Status Use SVCREQ function #18 in order to read the current status of overrides in the CPU. Note This feature is available only for 331 or higher CPUs. For this function, the parameter block has a length of 1 word. It is an output parameter block only. 0 = No overrides are set. address 1 = Overrides are set. Note SVCREQ #18 reports only overrides of %I and %Q references. Example: In the following example, the status of I/O overrides is always read into location %R1003.
4 SVCREQ #23: Read Master Checksum Use SVCREQ function #23 to read the master checksums for the user program and the configuration. The SVCREQ output is always set to ON if the function is enabled, and the output block of information (see below) starts at the address given in parameter 3 (PARM) of the SVCREQ function. When a RUN MODE STORE is active, the program checksums may not be valid until the store is complete.
4 SVCREQ #26/30: Interrogate I/O Use SVCREQ function #26 (or #30—they are identical; i.e., you can use either number to accomplish the same thing) to interrogate the actual modules present and compare them with the rack/slot configuration, generating addition, loss, and mismatch alarms, as if a store configuration had been performed. This SVCREQ will generate faults on both the PLC and I/O fault tables, depending on the fault. This function has no parameter block and always outputs power flow.
4 SVCREQ #29: Read Elapsed Power Down Time Use the SVCREQ function #29 to read the the amount of time elapsed between the last power-down and the most recent power-up. The SVCREQ output is always set to ON, and the output block of information (see below) starts at the address given in parameter 3 (PARM) of the SVCREQ function. Note This function is available only in the 331 or higher CPUs. This function has an output parameter block only. The parameter block has a length of 3 words.
4 SVCREQ #46:Fast Backplane Status Access Use the SVCREQ function #46 to perform one of the following fast backplane access functions: 1. Read a word of extra status data from one of more specified smart modules. 2. Write a word of extra status data from one of more specified smart modules. 3. Read/Write: Read a word of extra status data from one or more specified modules and write the data value between 0 and 15 to the same module, all in one operations.
4 Use the table on the following page to interpret the output values: 4-166 Location Field Meaning Address Function 1 = read extra status data Address + 1 Error Code An error code is placed here if the function fails because any of the modules is not present, inappropriate, or not working.
4 Write Data (Function #2) The write data function writes a data value between 0 and 15 from the parameter block to one or more modules specified by a list in the parameter block. The parameter block requires (N + 4) words of reference memory, where N is the number of modules to which the data will be written.
4 Read/Write Data (Function #3) The read/write function reads a word of extra status data from a module specified in the parameter block, then writes a data value between 0 and 15 from the parameter block to that module. This read write process is repeated for each module in a list in the parameter block. The parameter block (N * 3) + 3 words of reference memory, where N is the number of modules with which data will be exchanged.
4 Example 1: The following example shows a Read of a single module at Rack 2, Slot 4. IN4 and IN5 must be set to zero (0). IN6 and IN7 are not important in this example. If the function completes successfully, the data will be in %R0004.
4 Example 2: This example reads the extra status data from the module in Rack 0, Slot 4 and from the module in Rack 1, Slot 1. It writes a 5 to the first module and a 9 to the second. Note that the modules do not need to be listed in order by slot numbers. Data read from the module in Rack 0, Slot 4 will be placed into %R0007. Data read from the module in Rack 1, Slot 1 will be placed in %R0004.
4 PID The Proportional plus Integral plus Derivative (PID) control function is the best known general purpose algorithm for closed loop process control. The Series 90 PID function block compares a Process Variable feedback with a desired process Set Point and updates a Control Variable output based on the error. The block uses PID loop gains and other parameters stored in an array of 40 16 bit words (discussed on page 4-173) to solve the PID algorithm at the desired time interval.
4 Parameters: Parameter Description enable When enabled through a contact, the PID function is performed. SP SP is the control loop or process set point. Set using PV Counts, the PID adjusts the output CV so that PV matches SP (zero error). PV Process Variable input from the process being controlled, often a %AI input. MAN When energized to 1 (through a contact), the PID block is in MANUAL mode. If the PID block is on manual off, the PID block is in automatic mode.
4 PID Parameter Block: Besides the 2 input words and the 3 Manual control contacts, the PID block uses 13 of the parameters in the RefArray. These parameters must be set before calling the block. The other parameters are used by the PLC and are non-configurable. The %Ref shown in the table below is the same RefArray Address at the bottom of the PID block. The number after the plus sign is the offset in the array.
4 Table 4-4.
4 Operation of the PID Instruction Normal Automatic operation is to call the PID block every sweep with power flow to Enable and no power flow to Manual input contacts. The block compares the current PLC elapsed time clock with the last PID solution time stored in the internal RefArray.
4 Table 4-5. PID Parameters Details Data Item Loop Number (00) Description This is an optional parameter available to identify a PID block. It is an unsigned integer that provides a common identification in the PLC with the loop number defined by an operator interface device. The loop number is displayed under the block address when logic is monitored from the Logicmaster 90-30/20/Micro software.
4 Table 4-5. PID Parameters Details - Continued Data Item Description CV Upper and Lower Clamps (09/10) INT values in CV Counts that define the highest and lowest value for CV. These values are required and the Upper Clamp must have a more positive value than the Lower Clamp, or the PID block will not work. These are usually used to define limits based on physical limits for a CV output. They are also used to scale the Bar Graph display for CV for the LM90 or ADS PID display.
4 Table 4-5. PID Parameters Details - Continued Data Item Manual Command (13) Control Word (14) Description This is an INT value set to the current CV output while the PID block is in Automatic mode. When the block is switched to Manual mode, this value is used to set the CV output and the internal value of the integrator within the Upper and Lower Clamp and Slew Time limits. This is an internal parameter that is normally left at 0.
4 As described in Table 4-6 on the previous pages, the PID block reads 13 user parameters and uses the rest of the 40 word RefArray for internal PID storage. Normally you would not need to change any of these values. If you are calling the PID block in Auto mode after a long delay, you may want to use SVC_REQ #16 to load the current PLC elapsed time clock into %Ref+23 to update the last PID solution time to avoid a step change on the integrator.
4 If an Integral Ki gain is used, the CV Bias would normally be 0 as the integrator acts as an automatic bias. Just start up in Manual mode and use the Manual Command word (%Ref+13) to set the integrator to the desired CV, then switch to Automatic mode. This also works if Ki is 0, except the integrator will not be adjusted based on the Error after going into Automatic mode.
4 Sample Period and PID Block Scheduling The PID block is a digital implementation of an analog control function, so the dt sample time in the PID Output equation is not the infinitesimally small sample time available with analog controls. The majority of processes being controlled can be approximated as a gain with a first or second order lag, possibly with a pure time delay. The PID block sets a CV output to the process and uses the process feedback PV to determine an Error to adjust the next CV output.
4 Plotting a step response at time t0 in the time domain provides an open loop unit reaction curve: CV Unit Step Output to Process a45709 PV Unit Reaction Curve Input from Process 1 K 0.
4 5. After suitable Kp and Ki gains are found, try adding Kd to get quicker responses to input changes providing it doesn’t cause oscillations. Kd is often not needed and will not work with noisy PV. 6. Check gains over different SP operating points and add Dead Band and Minimum Slew Time if needed.
4 Sample PID Call The following example has a Sample Period of 100 millisecond, a Kp gain of 4.00 and a Ki gain of 1.500. The Set Point is stored in %R1 with the Control Variable output in %AQ2 and the Process Variable returned in %AI3. CV Upper and CV Lower Clamps must be set, in this case to 20000 and 400, and an optional small Dead Band of +5 and –5 has been included. The 40 word RefArray starts in %R100.
4 | _____ _____ _____ | %M0006 | | | | | | |——| |———| BLK_|—————————|BLKMV|—————————————————|BLKMV|– | | | | | | | | | CLR_| | INT | | INT | | | WORD| | | | | |%R00100—|IN | CONST —|IN1 Q|—%R00102 CONST —|IN1 Q|— %R00109 | | LEN | +00010 | | +20000 | | | |00035| | | | | | |_____| CONST —|IN2 | CONST —|IN2 | | +00005 | | +00400 | | | | | | | | CONST —|IN3 | CONST —|IN3 | | +00005 | | +00000 | | | | | | | | CONST —|IN4 | CONST —|IN4 | | +00400 | | +00000 | | | | | | | | CONST —|IN5 | CONST —|IN5 | | +00000 |
Appendix Instruction Timing A The Series 90-30, 90-20, and Micro PLCs support many different functions and function blocks. This appendix contains tables showing the memory size in bytes and the execution time in microseconds for each function. Memory size is the number of bytes required by the function in a ladder diagram application program.
A Table A-1.
A Table A-1. Instruction Timing-Continued Function Enabled Group Function Disabled Increment 311 313 331 340/41 311 313 331 340/41 311 313 331 340/41 Size Bit Logical AND 67 37 37 22 42 0 0 1 – – – – 13 Operation Logical OR 68 38 38 21 42 0 0 1 – – – – 13 Logical Exclusive OR 66 38 37 20 42 0 1 1 – – – – 13 Logical Invert, NOT 62 32 31 17 42 0 1 1 – – – – 9 Shift Bit Left 139 89 90 47 74 26 23 13 11.61 11.61 12.04 6.
A Table A-1. Instruction Timing-Continued Function Enabled Disabled Increment 311 313 331 340/41 311 313 331 340/41 311 313 331 340/41 Size INT 198 159 124 83 79 39 36 21 1.93 1.93 2.48 1.52 19 DINT 201 163 132 84 79 37 35 21 6.49 6.47 6.88 3.82 19 BYTE 179 141 117 73 79 38 36 19 1.54 1.51 1.85 1.05 19 WORD 198 159 124 83 79 39 36 21 1.93 1.93 2.48 1.52 19 INT 198 160 125 82 79 37 38 19 3.83 3.83 4.41 2.
A Table A-1.
A Table A-1.
A Table A-1.
A Table A-1. InstructionTiming-Continued Function Group Function Data Move Table Enabled Disabled Increment Enabled Disabled Increment 350/351/36X 350/351/36X 350/351/36X 352 352 352 Size 10 13 Move (INT) 2 0 0.41 2 0 0.41 Move (BIT) 28 0 4.98 28 0 4.98 Move (WORD) 2 0 0.41 2 0 0.41 10 Move (REAL) 24 1 0.82 24 1 0.
A Table A-1. Instruction Timing-Continued Function Enabled Disabled Increment Enabled Disabled Increment 350/351/36x 350/351/36x 350/351/36x 352 352 352 Size INT 37 0 1.52 37 0 1.52 19 DINT 41 1 2.27 41 1 2.27 22 BYTE 37 0 1.41 37 0 1.41 19 WORD 37 0 1.52 37 0 1.52 19 INT 38 0 1.48 38 0 1.48 19 DINT 40 1 2.30 40 1 2.30 22 BYTE 37 0 1.24 37 0 1.24 19 WORD 38 0 1.48 38 0 1.
A Instruction Sizes for 350 and 360 Series CPUs Memory size is the number of bytes required by the instruction in a ladder diagram application program. 350 and 360 Series CPUs require three (3) bytes for most standard boolean functions— see Table A-2. Table A-2.
Appendix Interpreting Fault Tables B The Series 90-30 PLCs maintain two fault tables, the I/O fault table for faults generated by I/O devices (including I/O controllers) and the PLC fault table for internal PLC faults. The information in this appendix will enable you to interpret the message structure format when reading these fault tables. Both tables contain similar information. • • GFK-0467K The PLC fault table contains: o Fault location. o Fault description. o Date and time of fault.
B PLC Fault Table Access the PLC fault table through your programming software.
B The System Configuration Mismatch fault entry is explained below. (All data is in hexadecimal.) Field Value Description Long/Short 00 This fault contains 8 bytes of fault extra data. Rack 00 Main rack (rack 0). Slot 3. Slot 03 Task 44 Fault Group 0B System Configuration Mismatch fault. Fault Action 03 FATAL fault. Error Code 01 The following paragraphs describe each field in the fault entry. Included are tables describing the range of values each field may have.
B PLC Fault Group Fault group is the highest classification of a fault. It identifies the general category of the fault. Table B-1 lists the possible fault groups in the PLC fault table. The last non-maskable fault group, Additional PLC Fault Codes, is declared for the handling of new fault conditions in the system without the PLC having to specifically know the alarm codes. All unrecognized PLC-type alarm codes belong to this group. Table B-1.
B Fault Action Each fault may have one of three actions associated with it. These fault actions are fixed on the Series 90-30 PLC and cannot be changed by the user. Table B-2. PLC Fault Actions Fault Action Action Taken by CPU Informational Diagnostic Code Log fault in fault table. Log fault in fault table. Set fault references. Log fault in fault table. Set fault references. Go to STOP mode. Fatal 1 2 3 Error Code The error code further describes the fault.
B Table B-4 shows the error codes for all the other fault groups. Table B-4. Alarm Error Codes for PLC Faults Decimal Hexadecimal 44 45 255 2C 2D FF 2 1 2 3 5 11 13 401 8 10 23 PLC Error Codes for Loss of Option Module Group Option Module Soft Reset Failed. Option Module Soft Reset Failed. Option Module Communication Failed. Error Codes for Reset of, Addition of, or Extra Option Module Group 2 Module Restart Complete. All others Reset of, Addition of, or Extra Option Module.
B Fault Extra Data This field contains details of the fault entry. An example of what data may be present are: Corrupted User RAM Group: Four of the error codes in the System Configuration Mismatch group supply fault extra data: Table B-5.
B I/O Fault Table The following diagram identifies the hexadecimal information displayed in each field in the fault entry.
B The following paragraphs describe each field in the I/O fault table. Included are tables describing the range of values each field may have. Long/Short Indicator This byte indicates whether the fault contains 5 bytes or 21 bytes of fault specific data. Table B-7.
B Rack The rack number ranges from 0 to 7. Zero is the main rack, i.e., the one containing the PLC. Racks 1 through 7 are expansion racks. Slot The slot number ranges from 0 to 9. The PLC CPU always occupies slot 1 in the main rack (rack 0). Point Point ranges from 1 to 1024 (decimal). It tells which point on the block has the fault when the fault is a point-type fault. I/O Fault Group Fault group is the highest classification of a fault. It identifies the general category of the fault.
B I/O Fault Action The fault action specifies what action the PLC CPU should take when a fault occurs. Table B-11 lists possible fault actions. Table B-11. I/O Fault Actions Fault Action Action Taken by CPU Code Informational Log fault in fault table. 1 Diagnostic Log fault in fault table. Set fault references. 2 Fatal Log fault in fault table. Set fault references. Go to STOP mode. 3 I/O Fault Specific Data An I/O fault table entry may contain up to 5 bytes of I/O fault specific data.
B I/O Fault Time Stamp The six-byte time stamp is the value of the system clock when the fault was recorded by the PLC CPU. Values are coded in BCD format. Table B-13.
Appendix Instruction Mnemonics C In Program Display/Edit mode, you can quickly enter or search for a programming instruction by typing the ampersand (&) character followed by the instruction’s mnemonic. For some instructions, you can also specify a reference address or nickname, a label, or a location reference address. This appendix lists the mnemonics of the programming instructions for Logicmaster 9030/20/Micro programming software.
C Mnemonic Function Group Instruction INT DINT Math Addition &AD &AD_I &AD_DI Subtraction &SUB &SUB_I &SUB_DI Multiplication &MUL &MUL_I &MUL_DI Division &DIV &DIV_I &DIV_DI Modulo &MOD &MOD_I &MOD_DI Square Root &SQ &SQ_I &SQ_DI Sine &SIN Cosine &COS Tangent &TAN Inverse Sine &ASIN Inverse Cosine &ACOS Inverse Tangent &ATAN Base 10 Logarithm &LOG Natural Logarithm &LN Power of e &EXP Power of x &EXPT Equal &EQ &EQ_I &EQ_DI Not Equal &NE &NE_I &NE_DI
C Mnemonic Function Group Instruction All Data Move Table Control GFK-0467K INT DINT BIT BYTE &MOV_BI WORD Move &MOV &MOV_I Block Move &BLKM &BLKM_I Block Clear &BLKC Shift Register &SHF Bit Sequencer Communications Request &BI Array Move &AR &AR_I &AR_DI &AR_BY &AR_W Search Equal &SRCHE &SRCHE_I &SRCHE_DI &SRCHE_BY &SRCHE_W Search Not Equal &SRCHN &SRCHN_I &SRCHN_DI &SRCHN_BY Search Greater Than &SRCHGT &SRCHGT_I &SRCHGT_DI &SRCHGT_BY Search Greater Than or E
Appendix Key Functions D This appendix lists the keyboard functions that are active in the software environment. This information may also be displayed on the programmer screen by pressing ALT-K to access key help. Key Sequence Description Key Sequence Description Keys Available Throughout the Software Package ALT-A ALT-C ALT-M ALT-R ALT-E Abort. Clear field. Change Programmer mode. Change PLC Run/Stop state. Toggle status area. CTRL-Break Esc CTRL-Home CTRL-End ALT-J Toggle command line.
D The Help card on the next page contains a listing of the key help and also the instruction mnemonics help text for Logicmaster 90-30/20/Micro software. This card is printed in triplicate and is perforated for easier removal from the manual.
D Print side 1 of GFJ-055C on this page.
D Print side 2 of GFJ-055C on this page.
Appendix Using Floating-Point Numbers E There are a few considerations you need to understand when using floating-point numbers. The first section discusses these general considerations. Refer to page E-5 and following for instructions on entering and displaying floating-point numbers. Note Floating-point capabilities are only supported on the 350 and 360 series CPUs, Release 9 or later, or on all releases of CPU352.
E Outside the range listed above, only six significant digits are displayed and the display has the form: +1.
E Internal Format of Floating-Point Numbers Floating-point numbers are stored in single precision IEEE-standard format. This format requires 32 bits, which translates to two (adjacent) 16-bit PLC registers. The encoding of the bits is diagrammed below. Bits 17-32 Bits 1-16 32 17 16 1 23-bit mantissa 8-bit exponent 1-bit sign (Bit 32) Register use by a single floating-point number is diagrammed below.
E Values of Floating-Point Numbers Use the following table to calculate the value of a floating-point number from the binary number stored in two registers. Exponent (e) Mantissa (f) Value of Floating Point Number 255 Non-zero 255 0 0 < e < 255 Any value –1s * 2e–127 * 1.f 0 Non-zero –1s * 2–126 * 0.f 0 0 Not a valid number (NaN). –1s * ∞ 0 f = the mantissa. The mantissa is a binary fraction. e = the exponent.
E Entering and Displaying Floating-Point Numbers In the mantissa, up to six or seven significant digits of precision may be entered and stored; however, the programming software will display only the first six of these digits. The mantissa may be preceded by a positive or negative sign. If no sign is entered, the floating-point number is assumed to be positive.
E Errors in Floating-Point Numbers and Operations On a 352 CPU, overflow occurs when a number greater than 3.402823E+38 or less than -3.402823E+38 is generated by a REAL function. On all other 90-30 models that support floating point operations, the range is greater than 216 or less than –216. When your number exceeds the range, the ok output of the function is set OFF; and the result is set to positive infinity (for a number greater than 3.
E of this feature of propagating NaNs through functions, you can identify the function where the NaN originated. Note For NaN, the ok output is OFF (not energized). The following table explains when power is or is not passed when dealing with numbers viewed as or equal to infinity. As shown previously, outputs that exceed the positive or negative limits are viewed as POS_INF or NEG_INF respectively.
Index 3 350 and 360 series CPUs: changing mode with key switch, 2-14 350 and 360 series CPUs: key switch, 2-14 A ACOS, 4-35 ADD, 4-27 ADD_IOM, 2-25 ADD_SIO, 2-25 Addition function, 4-27 Addition of I/O module, 3-18 Alarm, 3-2 Alarm error codes, B-5 Alarm processor, 3-2 ALT keys, D-1 AND, 4-49 ANY_FLT, 2-26 APL_FLT, 2-25 Application fault, 3-12 Application program logic scan, 2-8 ARRAY_MOVE, 4-87 ASIN, 4-35 ATAN, 4-35 B BAD_PWD, 2-26 BAD_RAM, 2-26 Base 10 logarithm function, 4-37 Battery signal, low, 3-11
Index Continuation contact, 4-8 normally closed contact, 4-4 normally open contact, 4-4 Continuation coil, 4-8 Continuation contact, 4-8 Control functions, 4-107 CALL, 4-108 COMMENT, 4-131 DOIO, 4-109 enhanced DOIO for model 331 and higher CPUs, 4-113 END, 4-123 ENDMCR, 4-127 JUMP, 4-128 LABEL, 4-130 MCR, 4-124 PID, 4-171 Sequential Event Recorder, 4-114 SER, 4-114 SVCREQ, 4-132 Control functions Instruction timing, CPU, A-1 Conversion functions, 4-94 BCD-4, 4-95 DINT, 4-99 INT, 4-97 REAL, 4-101 TRUN, 4
Index EXP, 4-37 Exponential functions, 4-37 power of e, 4-37 power of X, 4-37 EXPT, 4-37 External I/O failures, 3-2 F Fatal faults, 3-4 communications failure during store, 3-16 corrupted user program on power-up, 3-13 option module software failure, 3-11 PLC CPU system software failure, 3-14 program block checksum failure, 3-11 system configuration mismatch, 3-10 Fault action, 3-4 diagnostic faults, 3-4 fatal faults, 3-4 I/O fault action, B-11 informational faults, 3-4 PLC fault action, B-5 fault acti
Index Function block structure, 2-26 format of program function blocks, 2-27 format of relays, 2-26 function block parameters, 2-28 power flow, 2-29 G GE, 4-41 Global data, 2-42 Global data references, 2-21 Greater than function, 4-41 Greater than or equal function, 4-41 GT, 4-41 H Horizontal link, 4-7 Housekeeping, 2-6 HRD_CPU, 2-25 HRD_FLT, 2-26 HRD_SIO, 2-25 I I/O data formats, 2-41 I/O fault table, 3-3, 3-5, B-8 explanations, 3-17 fault action, B-11 fault actions for specific faults, B-11 fault addr
Index Links, horizontal and vertical, 4-7 LN, 4-37 Locking/unlocking subroutines, 2-37 LOG, 4-37 Logarithmic functions, 4-37 base 10 logarithm, 4-37 natural logarithm, 4-37 Logic program checksum calculation, 2-9 Logic solution, 2-8 Logical AND function, 4-49 Logical NOT function, 4-53 Logical OR function, 4-49 Logical XOR function, 4-51 LOS_IOM, 2-25 LOS_SIO, 2-25 Loss of I/O module, 3-17 Loss of, or missing, option module, 3-8 Low battery signal, 3-11 LOW_BAT, 2-25 LT, 4-41 M Maintenance, 3-1 Masked co
Index slot, B-3 spare, B-3 task, B-3 PLC sweep, 2-2 application program logic scan, 2-8 configured constant sweep time mode, 2-13 constant sweep time mode, 2-13, 2-35 housekeeping, 2-6 input scan, 2-7 logic program checksum calculation, 2-9 logic solution, 2-8 output scan, 2-9 PCM communications with the PLC, 2-12 programmer communications window, 2-9 scan time contributions for 350 and 360 Series of, 2-5 standard program sweep mode, 2-2 standard program sweep variations, 2-13 STOP mode, 2-13 sweep time ca
Index SET coil, 4-6 RESET coil, 4-6 Reset of, addition of, or extra, option module, 3-9 Retentive coil, 4-5 Retentive RESET coil, 4-7 Retentive SET coil, 4-7 Retentiveness of data, 2-21 ROL, 4-58 ROR, 4-58 Rotate left function, 4-58 Rotate right function, 4-58 S Scan Time Contributions for 350 and 360 Series of CPUs, 2-5 Scan, input, 2-7 Scan, output, 2-9 Search array move function, 4-87 Search equal function, 4-91 Search greater than function, 4-91 Search greater than or equal function, 4-91 Search less
Index read folder name (#10), 4-151 read I/O override status, 4-161 read last–logged fault table entry, 4-156 read master checksum, 4-162 read PLC ID (#11), 4-152 read PLC run state (#12), 4-153 read sweep time (#9), 4-150 read window values (#2), 4-137 reset watchdog timer (#8), 4-149 shut down (stop) PLC, 4-154 Sweep time calculation, 2-6 Sweep, PLC, 2-2 application program logic scan, 2-8 constant sweep time mode, 2-13, 2-35 housekeeping, 2-6 input scan, 2-7 logic program checksum calculation, 2-9 logi
Index User references, 2-20 analog inputs, 2-20 analog outputs, 2-20 discrete inputs, 2-20 discrete internal, 2-20 discrete outputs, 2-20 discrete references, 2-20 discrete temporary, 2-21 global data, 2-21 register references, 2-20 system references, 3-5 system registers, 2-20 system status, 2-21, 2-24 V Vertical link, 4-7 VIEWLOCK, 2-37 W Watchdog timer, 2-35 Window, 2-9 programmer communications window, 2-9 system communications window, 2-10 WORD, 2-23, 4-103 X XOR, 4-51 GFK-0467K Index Index-9