1762 pm001d en P
1762 pm001d en P
Programming Manual
Because of the variety of uses for the products described in this publication, those responsible for the application and use of these products must satisfy themselves that all necessary steps have been taken to assure that each application and use meets all performance and safety requirements, including any applicable laws, regulations, codes and standards. In no event will Allen-Bradley be responsible or liable for indirect or consequential damage resulting from the use or application of these products. Any illustrations, charts, sample programs, and layout examples shown in this publication are intended solely for purposes of example. Since there are many variables and requirements associated with any particular installation, Allen-Bradley does not assume responsibility or liability (to include intellectual property liability) for actual use based upon the examples shown in this publication. Allen-Bradley publication SGI-1.1, Safety Guidelines for the Application, Installation and Maintenance of Solid-State Control (available from your local Allen-Bradley office), describes some important differences between solid-state equipment and electromechanical devices that should be taken into consideration when applying products such as those described in this publication. Reproduction of the contents of this copyrighted publication, in whole or part, without written permission of Rockwell Automation, is prohibited. Throughout this publication, notes may be used to make you aware of safety considerations. The following annotations and their accompanying statements help you to identify a potential hazard, avoid a potential hazard, and recognize the consequences of a potential hazard: WARNING Identifies information about practices or circumstances that can cause an explosion in a hazardous environment, which may lead to personal injury or death, property damage, or economic loss.
!
ATTENTION
!
IMPORTANT
Identifies information about practices or circumstances that can lead to personal injury or death, property damage, or economic loss.
Identifies information that is critical for successful application and understanding of the product.
Summary of Changes
Introduction
This release of this document contains new and updated information. To find new and updated information, look for change bars, as shown next to this paragraph.
Updated Information
Summary of Changes
Notes:
Preface
This manual guides the development of projects for Logix5000 controllers. It provides step-by-step procedures on how to perform the following tasks, which are common to all Logix5000 controllers: Manage Project Files Organize Your Logic Organize Tags Program Routines Test a Project Handle Faults
The term Logix5000 controller refers to any controller that is based on the Logix operating system, such as: CompactLogix controllers ControlLogix controllers FlexLogix controllers SoftLogix controllers This manual works together with user manuals for your specific type of controller. The user manuals cover tasks such as: Place and configure I/O Communicate with devices over various networks Maintain the battery
This manual is intended for those individuals who program applications that use Logix5000 controllers, such as: software engineers control engineers application engineers instrumentation technicians
Preface
Use this manual when you perform these actions: develop the basic code for your application modify an existing application perform isolated tests of your application As you integrate your application with the I/0 devices, controllers, and networks in your system: Refer to the user manual for your specific type of controller. Use this manual as a reference, when needed.
This manual is divided into the basic tasks that you perform while programming a Logix5000 controller. Each chapter covers a task. The tasks are organized in the sequence that you will typically perform them. As you use this manual, you will see some terms that are formatted differently from the rest of the text:
Identifies:
For example:
Means: Right-click on the item that is named User-Defined. If you want additional information, refer to name in the Glossary. If you are viewing the PDF file of the manual, click name to jump to the glossary entry.
Italic
bold
the actual name of an item that you Right-click User-Defined see on your screen or in an example an entry in the Glossary Type a name
courier
Right-click name_of_program
You must identify the specific program in your application. Typically, it is a name or variable that you have defined.
Table of Contents
Chapter 1 Manage Project Files
Create a Project File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-1 Save Your Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2
Table of Contents
ii
Table of Contents
iii
Table of Contents
iv
Clear a Major Fault During Prescan . . . . . . . . Identify When the Controller is in Prescan Get the Fault Type and Code . . . . . . . . . . Check for a Specific Fault. . . . . . . . . . . . . Clear the Fault . . . . . . . . . . . . . . . . . . . . . Test a Fault Routine . . . . . . . . . . . . . . . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
Chapter 16 Create a User-Defined Major Fault When to Use this Procedure . . . . . . . . . . . . . . . . . . . . . . . 16-1
Create a User-Defined Major Fault . . . . . . . . . . . . . . . . . . . 16-1
Table of Contents
Assign Global Access to RSLogix 5000 Software. . . . . . Assign Project Actions for New RSLogix 5000 Projects . Secure an RSLogix 5000 Project . . . . . . . . . . . . . . . . . Assign Access to an RSLogix 5000 Project . . . . . . . . . . Refresh RSLogix 5000 Software, If Needed . . . . . . . . .
Glossary
Table of Contents
vi
Chapter
Before you program a Logix5000 controller, you must create a project file: 1. Start the RSLogix 5000 software. 2. From the File menu, select New.
3. 4. 5.
6. 7. 8.
42194
3. Select the type of controller. 4. Type a name for the controller. 5. Type a description of the operations that the controller performs (optional). 6. Select the type of chassis (number of slots) that contains the controller (not applicable to some controllers). 7. Select or type the slot number where the controller is installed (not applicable to some controllers). 8. To store the file in a different folder (other than the default Create In path), click Browse and select a folder.
1-2
9. Click OK.
When you create a project, the name of the project file is the same as the name of the controller.
controller organizer
42371
As you create logic and make configuration changes, save the project.
To: save your changes make a copy of the open project but keep the existing name of the controller make a copy of the project and assign a different name to the controller Do this: From the File menu, select Save. A. From the File menu, select Save As. B. Type a name for the project file. Use underscores [ _ ] in place of spaces. C. Click Save. A. From the File menu, select Save As. B. Type a name for the project file. Use underscores [ _ ] in place of spaces. C. Click Save. D. In the controller organizer, right-click Controller name_of_controller folder and select Properties. E. Type a new name for the controller. F. Click OK.
1-3
Notes:
Names download to the controller, while documentation (descriptions, rung comments) does not download to the controller. To change the name, chassis size, or slot number of the controller: a. In the controller organizer, right-click the Controller name_of_controller folder and select Properties. b. Change the required information. c. Click OK.
1-4
Notes:
Chapter
Organize Tasks
After you create a project file, organize your project into tasks.
To organize your project into tasks, do the following steps: Identify the Available Programming Languages Organize Your Logic Verify the Controller
Use the following table to identify which programming language you can use for your controller:
For this platform of controllers: CompactLogix ControlLogix FlexLogix SoftLogix You can use this language: ladder function block
Notes:
For controllers with multiple languages, you can mix languages in a project. To use function blocks, you must have the following catalog number of RSLogix 5000 software: 9324-RLD700 To see which components are installed with RSLogix 5000 software: 1. Open RSLogix 5000 software. 2. From the Help menu, choose About RSLogix 5000.
2-2
Organize Tasks
To execute your logic, you use a task (s). There are two types of tasks:
This type of task: continuous task periodic task Will: continuously execute your logic (You can only have one continuous task.) interrupt the continuous task execute logic one time return control to the continuous task (You can have more than one periodic task.)
The Tasks folder contains the tasks for the controller (i.e., your logic).
MainTask is the default continuous task. It runs all the time and repeatedly executes MainProgram.
Whenever MainProgram executes, any logic in MainRoutine will execute. You can use MainRoutine to call other routines (subroutines) within MainProgram.
42195
Organize Tasks
2-3
3. Create and assign a main routine (the routine to execute first in the program).
4. Place the remaining functions in MainTask, MainProgram. (See below.) multiple functions and use logic to decide when each function will execute 1. Create a routine (subroutine) for each function:
2. Use a JSR instruction to call each subroutine. all functions all of the time 1. In MainRoutine, enter your logic. 2. Use rung comments to designate the different functions.
2-4
Organize Tasks
The following example depicts the execution of a project with more than one task. Task execution order for a project with two periodic tasks and one continuous task
EXAMPLE
Task 1
Task 2
Notes:
All periodic tasks interrupt the continuous task. The highest priority task interrupts all lower priority tasks. A higher priority task can interrupt a lower priority task multiple times. When the continuous task completes a full scan, it restarts immediately. Tasks at the same priority execute on a time-slice basis at 1 ms intervals. To change the properties of a task, program, or routine (name, type, priority, etc.), right-click the task, program, or routine and select Properties.
Organize Tasks
2-5
As you program your project, periodically verify your work: 1. In the top-most toolbar of the RSLogix 5000 window, click 2. If any errors are listed at the bottom of the window: a. To go to the first error or warning, press the F4 key. b. Correct the error according to the description in the Results window. c. Go to step 1. 3. To close the Results window, press the Alt + 1 keys.
2-6
Organize Tasks
Notes:
Chapter
Organize Tags
Logix5000 controllers store data in tags (in contrast to fixed data files that are numerically addressed). With tags, you can organize your data to mirror your machinery document (through tag names) your application as you develop it When you create a tag, you assign the following properties:
Table 3.1 Tag Properties Property: scope name data type Description: defines which routines can access the data identifies the data (Tags with different scopes can have the same name.) defines the organization of the data, such a bit, integer, or floating-point number
The following table outlines the most common data types and when to use each.
Table 3.2 Data Types For: analog device in floating-point mode analog device in integer mode (for very fast sample rates) ASCII characters bit counter digital I/O point floating-point number integer (whole number) sequencer timer Select: REAL INT string BOOL COUNTER BOOL REAL DINT CONTROL TIMER
3-2
Organize Tags
The following examples show the different levels at which you can organize your data: Single element tags, on page 3-3 Single dimension array, on page 3-4 Two dimension array, on page 3-5 User-defined data type that stores a recipe, on page 3-6 User-defined data type that stores the data that is required to run a machine, on page 3-7
Organize Tags
3-3
EXAMPLE
42364
3-4
Organize Tags
EXAMPLE
Single dimension array In this example, a single timer instruction times the duration of several steps. Each step requires a different preset value. Because all the values are the same data type (DINTs) an array is used.
To collapse an array and hide its elements, click the sign. elements of timer_presets
This array contains six elements of the DINT data type. six DINTs
42367
Organize Tags
3-5
EXAMPLE
Two dimension array A drill machine can drill one to five holes in a book. The machine requires a value for the position of each hole from the leading edge of the book. To organize the values into configurations, a two dimension array is used. The first subscript indicates the hole to which the value corresponds and the second subscript indications how many holes will be drilled (one to five).
subscript of second dimension 0 0 1 subscript of 2 first dimension 3 4 5 1.5 2.5 8.0 1.25 5.5 9.75 1.25 3.5 7.5 9.75 1.25 3.5 5.5 7.5 9.75 1 2 3 4 5
Description
Position of first hole from leading edge of book Position of second hole from leading edge of book Position of third hole from leading edge of book Position of fourth hole from leading edge of book Position of fifth hole from leading edge of book
In the Tags window, the elements are in the order depicted below.
This array contains a two-dimensional grid of elements, six elements by six elements.
42367
The right-most dimension increments to its maximum value then starts over.
When the right-most dimension starts over, the dimension to the left increments by one.
3-6
Organize Tags
EXAMPLE
User-defined data type that stores a recipe In a system of several tanks, each tank can run a variety of recipes. Because the recipe requires a mix of data types (REAL, DINT, BOOL, etc.) a user-defined data type is used.
Name (of data type): TANK Member Name temp deadband step step_time preset mix Data Type REAL REAL DINT TIMER DINT[6] BOOL
An array that is based on this data type would look like this:
array of recipes
first recipe
42368
Organize Tags
3-7
EXAMPLE
User-defined data type that stores the data that is required to run a machine Because several drill stations require the following mix of data, a user-defined data type is created.
Name (of data type): DRILL_STATION Member Name part_advance hole_sequence type hole_position depth total_depth Data Type BOOL CONTROL DINT REAL REAL REAL
An array that is based on this data type would look like this:
array of drills
first drill
42583
3-8
Organize Tags
42195
2. 3.
42196
4.
5.
6.
7.
2. Type a name for the data type. 3. Type a description (optional). 4. Type the name of the first member.
Organize Tags
3-9
5. Specify the data type for the member. See Table 3.2 on page 3-1. For an array, use the following format:
data_type[x]
where:
6. To display the value (s) of the member in a different style (radix), select the style. 7. Type a description for the member (optional). 8. Click Apply. 9. More members?
If: Yes No Then: Repeat steps 4. to 8. Click OK.
Notes:
If you include members that represent I/O devices, you must use ladder logic to copy the data between the members in the structure and the corresponding I/O tags. Refer to "Buffer I/O" on page 8-1. When you use the BOOL, SINT, or INT data types, place members that use the same data type in sequence:
more efficient BOOL BOOL BOOL DINT DINT less efficient BOOL DINT BOOL DINT BOOL
3-10
Organize Tags
Create a Tag
To create a tag (including an array): 1. From the Logic menu, select Edit Tags.
2.
42350
3.
4.
5.
name_of_controller(controller)
where:
data_type is the type of data that the tag or array stores. See Table 3.2 on page 3-1. x is the number of elements in the first dimension. y is the number of elements in the second dimension. z is the number of elements in the third dimension.
5. Type a description (optional).
Publication 1756-PM001D-EN-P - November 2001
Organize Tags
3-11
You can also use spreadsheet software such as Microsoft Excel to create and edit tags. This lets you take advantage of the editing features in the spreadsheet software. To create tags using Excel: 1. Open the RSLogix 5000 project. 2. Create several tags. (This helps to format the Excel spreadsheet.) 3. From the Tools menu, select Export Tags.
4.
5.
42361
4. Note the name of the export file (project_name-Tags). 5. Select the scope of tags to export. If you select Program Tags, select the program tags to export. 6. Click Export.
3-12
Organize Tags
DESCRIPTION DESCRIPTION
8.
9.
10.
11.
10. Enter the name of the tag. 11. Enter the data type of the tag. 12. Repeat steps 8. to 11. for each additional tag. 13. Save and close the file. (Keep it as a .CSV format.) 14. In the RSLogix 5000 software, from the Tools menu, select Import Tags. 15. Select the file that contains the tags and click Import. The tags import into the project. The lower section of the RSLogix 5000 window displays the results.
Organize Tags
3-13
Notes:
receive data from another controller over the backplane or consumed tag ControlNet network at a specified interval
If you plan to use produced or consumed tags, you must follow additional guidelines as you organize your tags. Refer to "Communicate with Another Controller" on page 10-1. The following integer data types are also available: SINT (8-bit integer) INT (16-bit integer) Typically, instructions convert SINT or INT values to an optimal data type (usually a DINT or REAL value) during execution. Because this requires additional time and memory, minimize the use of the SINT and INT data types.
3-14
Organize Tags
Notes:
Chapter
Program Routines
After you organize your project into an initial set of routines and tags, use this procedure to develop the logic that each routine will execute.
To program a routine, do the following steps: Open the Routine Enter Ladder Instructions Enter Function Block Instructions Assign Operands Verify the Routine
To open a routine, double-click the routine. If a routine is grayed-out, you cannot open the routine.
To open a folder and display its contents (expand), do one of the following: Double-click the folder. Select the folder and press the key. Click the + sign.
42581
4-2
Program Routines
IMPORTANT
If the source of a routine is unavailable, do not export the project. An export file (.L5K) contains only routines where the source code is available. If you export a project where the source code is not available for all routines, you will not be able to restore the entire project.
Program Routines
4-3
In an open ladder routine: 1. If the routine already contains logic, click where you want to enter your logic. (A new routine contains a rung that is ready for instructions.)
cursor (blue)
When you add an instruction or branch, it appears to the right of the cursor.
branch
4-4
Program Routines
Purpose: Performs an operation on an input value (s) and produces an output value (s) Pins on the left of the block are input pins. Pins on the right of the block are output pins. Supplies a value from an input device or a tag in another routine or controller Supplies a value to an output device or a tag in another routine or controller Connects function blocks that are either far apart or on different sheets Each OCON requires a unique name. For each OCON, you must have at least one corresponding ICON (i.e., an ICON with the same name as the OCON). Multiple ICONs can reference the same OCON. This lets you disperse data to several points in your routine.
input reference (IREF) output reference (OREF) output wire connector (OCON) input wire connector (ICON)
To enter function block instructions, open a function block routine and complete the following steps:
1.
2.
3.
42587
Program Routines
4-5
Step: 1. Enter the blocks that perform the required functions of the routine.
Detailed actions: A. B. C. D. Press the Insert key. Type the mnemonic for the required block. Choose OK. Drag the block to a place on the diagram that makes the diagram easy to read. The location of a block does not affect the order in which the blocks execute.
A B
42584
B. Edit the properties for the block: To: show a pin for an operand enter an immediate value Do this: Select the check box next to the operand (A). A. Clear (uncheck) the check box next to the operand (B). B. In the Value column, type the value for the operand (C). A. Click the Tag tab (D). B. Type a new name.
change the name of the tag for the instruction C. Choose OK. 3. Wire output pins to input pins.
Click an output pin and then click the required input pin. A green dot indicates a valid pin.
4-6
Program Routines
4.
5.
6.
42586
Step: 4. To supply a value from an input device or a tag, enter an input reference (IREF).
Detailed actions: A. Press the Insert key. B. Choose OK. (IREF is the default selection.) C. Drag the IREF to the desired location, typically to the left of the block that uses the value. D. Click the pin of the IREF and then click the input pin that uses the value. A. B. C. D. Press the Insert key. Type OREF. Choose OK. Drag the OREF to the desired location, typically to the right of the block that produces the output value. E. Click the output pin that supplies the value and then click the pin of the OREF. Press the Insert key. Type OCON. Choose OK. Drag the OCON to the desired location, typically to the right of the block that produces the value. Click the output pin that produces the value and then click the pin of the OCON. Display the sheet that contains the block to which you want to connect. Press the Insert key. Type ICON. Choose OK. Drag the ICON to the desired location, typically to the left of the block that uses the value. Click the pin of the ICON and then click the input pin that uses the value.
6. To connect blocks that are far apart or on different sheets, enter an output wire connector (OCON) and an input wire connector (ICON).
A. B. C. D. E. F. G. H. I. J. K.
Program Routines
4-7
Assign Operands
Each instruction requires one or more of the following: tag name value name of a routine, label, wire connector, etc. The following table outlines the format for a tag name:
For a: tag bit number of an larger data type member of a structure element of a one dimension array element of a two dimension array element of a three dimension array element of an array within a structure member of an element of an array Specify:
where:
x is the location of the element in the first dimension. y is the location of the element in the second dimension. z is the location of the element in the third dimension.
For a structure within a structure, add an additional.member_name .
4-8
Program Routines
EXAMPLE
Tags names
To access:
machine_on tag
bit number 1 of the one_shots tag
one_shots.1
DN member (bit) of the running_seconds timer mix member of the north_tank tag
element 2 in the recipe array and element 1,1 in the tanks array
running_seconds.DN
north_tank.mix
COP Copy File Source recipe[2] Dest tanks[1,1] Length 1 CLR CLR Clear Dest north_tank.preset[2] 0
drill[1].part_advance
42357
To assign an immediate value, tag, wire connector, label, or similar item to an instruction:
Program Routines
4-9
1. Type or select the value or name of the item (e.g., tag name, wire connector name, label name):
If you want to: specify an immediate value type the name of a tag, wire connector, label, or similar item For a: ladder instruction Do this: A. Click the ? symbol. B. Type the value or type the name of the tag, label, or similar item C. Press the Enter key. A. Click the ? symbol. B. Click the ? symbol again. C. Type the value or type the name of the tag or connector. D. Press the Enter key. A. Open the text entry box: In a: ladder instruction function block instruction C. Click the w D. Select a name: To select a: Do this: Do this: Double-click the ? symbol. A. Click the ? symbol. B. Click the ? symbol again.
wire connector, label, Select the name. or similar type of name tag bit number Double-click the tag name. A. Click the tag name. B. To the right of the tag name, click w C. Click the required bit.
D. Press the Enter key or click a different spot on the diagram. drag a tag from the Tags window ladder instruction A. Locate the tag in the Tags window. B. Click the tag two or three times until it highlights. C. Drag the tag to its location on the instruction. not available
4-10
Program Routines
where: data_type is the type of data that the tag or array stores. See Table 3.2 on page 3-1. x is the number of elements in the first dimension. y is the number of elements in the second dimension. z is the number of elements in the third dimension. D. From the Scope list, select the scope of the tag: If you will use the tag: in more than one program within the project as a producer or consumer in a message in only one program within the project E. Choose OK. program that will use the tag Then select:
name_of_controller(controller)
As you program your routine (s), periodically verify your work: 1. In the top-most toolbar of the RSLogix 5000 window, click 2. If any errors are listed at the bottom of the window: a. To go to the first error or warning, press the F4 key. b. Correct the error according to the description in the Results window. c. Go to step 1. 3. To close the Results window, press the Alt + 1 keys.
Chapter
The controller supports status keywords you can use in your logic to monitor specific events: The status keywords are not case sensitive. Because the status flags can change so quickly, RSLogix 5000 software does not display the status of the flags. (I.e., Even when a status flag is set, an instruction that references that flag is not highlighted.) You cannot define a tag alias to a keyword. You can use these key words:
To determine if: the value you are storing cannot fit into the destination because it is either: greater than the maximum value for the destination less than the minimum value for the destination Important: Each time S:V goes from cleared to set, it generates a minor fault (type 4, code 4) the instructions destination value is 0 the instructions destination value is negative an arithmetic operation causes a carry or borrow that tries to use bits that are outside of the data type For example: adding 3 + 9 causes a carry of 1 subtracting 25 - 18 causes a borrow of 10 this is the first, normal scan of the routines in the current program at least one minor fault has been generated: The controller sets this bit when a minor fault occurs due to program execution. The controller does not set this bit for minor faults that are not related to program execution, such as battery low. S:FS S:MINOR S:Z S:N S:C Use: S: V
5-2
The controller stores system data in objects. There is no status file, as in the PLC-5 controller. Use the GSV/SSV instructions get and set controller system data that is stored in objects: The GSV instruction retrieves the specified information and places it in the destination. The SSV instruction sets the specified attribute with data from the source.
ATTENTION
Use the SSV instruction carefully. Making changes to objects can cause unexpected controller operation or injury to personnel.
To get or set a system value: 1. Open the RSLogix 5000 project. 2. From the Help menu, select Contents. 3. Click the Index tab. 4. Type gsv/ssv objects and click Display.
5-3
6. In the list of attributes for the object, identify the attribute that you want to access. 7. Create a tag for the value of the attribute:
If the data type of the attribute is: one element (e.g., DINT) more than one element (e.g., DINT[7] ) Then: Create a tag for the attribute. A. Create a user-defined data type that matches the organization of data that is used by the attribute. B. Create a tag for the attribute and use the data type from Step A..
5-4
Source (SSV)
The following examples gets the current date and time. Get a system value
EXAMPLE
At the first scan, gets the DateTime attribute of the WALLCLOCKTIME object and stores it in the wall_clock tag, which is based on a user-defined data type.
42370
For more information, see the Logix5000 Controllers General Instruction Set Reference Manual, publication 1756-RM003.
Chapter
Assign Aliases
Alias Tags
An alias tag lets you create one tag that represents another tag. Both tags share the same value (s). When the value (s) of one of the tags changes, the other tag reflects the change as well. Use aliases in the following situations: program logic in advance of wiring diagrams assign a descriptive name to an I/O device provide a more simple name for a complex tag use a descriptive name for an element of an array
drill_1_depth_limit is an alias for Local:2:I.Data.3 (a digital input point). When the input turns on, the alias tag also turns on.
drill_1_on is an alias for Local:0:O.Data.2 (a digital output point). When the alias tag turns on, the output tag also turns on.
6-2
Assign Aliases
A common use of alias tags is to program logic before wiring diagrams are available: 1. For each I/O device, create a tag with a name that describes the device, such as conveyor for the conveyor motor. 2. Program your logic using the descriptive tag names. (You can even test your logic without connecting to the I/O.) 3. Later, when wiring diagrams are available, add the I/O modules to the I/O configuration of the controller. 4. Finally, convert the descriptive tags to aliases for their respective I/O points or channels. The following logic was initially programmed using descriptive tag names, such as stop and conveyor_on. Later, the tags were converted to aliases for the corresponding I/O devices.
stop is an alias for Local:2:I.Data.1 (the stop button on the operator panel)
stop <Local:2:I.Data.1>
conveyor_on is an alias for Local:0:O.Data.0 (the starter contactor for the conveyor motor)
42351
To show (in your logic) the tag to which an alias points: 1. From the Tools menu, select Options. 2. Click the Ladder Display tab. 3. Select the Show Tag Alias Information check box. 4. Click OK.
Assign Aliases
6-3
Assign an Alias
To assign a tag as an alias tag for another tag: 1. From the Logic menu, select Edit Tags.
2.
42360
3.
2. Select the scope of the tag. 3. To the right of the tag name, click the Alias For cell. The cell displays a w 4. Click the w 5. Select the tag that the alias will represent:
To: select a tag select a bit number Do this: Double-click the tag name. A. Click the tag name. B. To the right of the tag name, click w C. Click the required bit.
6-4
Assign Aliases
Notes:
Chapter
If you want an instruction to access different elements in an array, use a tag in the subscript of the array (an indirect address). By changing the value of the tag, you change the element of the array that your logic references.
When index equals 1, array[index] points here. array[0] array[1] array[2] array[3] When index equals 2, array[index] points here. 4500 6000 3000 2500
The following table outlines some common uses for an indirect address:
To: select a recipe from an array of recipes load a specific machine setup from an array of possible setups load parameters or states from an array, one element at a time log error codes perform several actions on an array element and then index to the next element Use a tag in the subscript and: Enter the number of the recipe in the tag. Enter the desired setup in the tag. A. Perform the required action on the first element. B. Use an ADD instruction to increment the tag value and point to the next element in the array.
7-2
The following example loads a series of preset values into a timer, one value (array element) at a time. Step through an array
EXAMPLE
The timer_presets array stores a series of preset values for the timer in the next rung. The north_tank.step tag points to which element of the array to use. For example, when north_tank.step equals 0, the instruction loads timer_presets[0] into the timer (60,000 ms).
MOV Move Source timer_presets[north_tank.step] 60000 Dest north_tank.step_time.PRE 60000 north_tank.step_time.DN / TON Timer On Delay Timer north_tank.step_time Preset 60000 Accum 0
EN DN
When north_tank.step_time is done, the rung increments north_tank.step to the next number and that element of the timer_presets array loads into the timer.
north_tank.step_time.DN Add Source A ADD 1
When north_tank.step exceeds the size of the array, the rung resets the tag to start at the first element in the array. (The array contains elements 0 to 3.)
EQU Equal Source A north_tank.step 0 Source B 4 MOV Move Source 0
Dest north_tank.step 0
42358
7-3
Expressions
You can also use an expression to specify the subscript of an array. An expression uses operators, such as + or -, to calculate a value. The controller computes the result of the expression and uses it as the array subscript. You can use these operators to specify the subscript of an array:
Operator: + * / ABS AND FRD Description: add subtract/negate multiply divide Absolute value AND BCD to integer Operator: MOD NOT OR SQR TOD TRN XOR Description: Modulo complement OR square root integer to BCD Truncate exclusive OR
7-4
Notes:
Chapter
Buffer I/O
To buffer I/O is a technique in which logic does not directly reference or manipulate the tags of real I/O devices. Instead, the logic uses a copy of the I/O data. Buffer I/O in the following situations: To prevent an input or output value from changing during the execution of a program. (I/O updates asynchronous to the execution of logic.) To copy an input or output tag to a member of a structure or element of an array.
Buffer I/O
To buffer I/O, perform these actions: 1. On the rung before the logic for the function (s), copy or move the data from the required input tags to their corresponding buffer tags. 2. In the logic of the function (s), reference the buffer tags. 3. On the rung after the function (s), copy the data from the buffer tags to the corresponding output tags.
8-2
Buffer I/O
The following example copies inputs and outputs to the tags of a structure for a drill machine. Buffer I/O
EXAMPLE
The main routine of the program executes the following subroutines in this sequence.
The map_inputs routine copies the values of input devices to their corresponding tags that are used in the drill routine.
_1791_8AC:I.Data[0].0 drill[1].depth_limit
_1791_8AC:I.Data[0].4
drill[1].home_limit
The drill routine executes the logic for the drill machine.
drill[1].part_advance / drill[1].forward one_shots.0 ONS drill[1].depth_limit / drill[1].forward
drill[1].depth_limit drill[1].retract
drill[1].home_limit /
drill[1].retract
The map_outputs routine copies the values of output tags in the drill routine to their corresponding output devices.
drill[1].forward _1791_8AC:O.Data[0].0
drill[1].retract
_1791_8AC:O.Data[0].1
42369
Buffer I/O
8-3
The following example uses the CPS instruction to copy an array of data that represent the input devices of a DeviceNet network. Buffer I/O
EXAMPLE
Local:0:I.Data stores the input data for the DeviceNet network that is connected to the 1756-DNB module in slot 0. To synchronize the inputs with the application, the CPS instruction copies the input data to input_buffer. While the CPS instruction copies the data, no I/O updates can change the data. As the application executes, it uses for its inputs the input data in input_buffer.
CPS Synchronous Copy File Source Local:0:I.Data[0] Dest input_buffer[0] Length 20
42578
8-4
Buffer I/O
Notes:
Chapter
Test a Project
Test a Project
To test a project, complete these actions: Configure a Communication Driver Download a Project to the Controller Select a Mode for the Controller Correct Major Faults Save Your Online Changes
In addition, you may perform these actions: Use program control instructions to isolate logic execution to specific routines or rungs. See Logix5000 Controllers General Instructions Reference Manual, publication 1756-RM003. Force input or output values. Refer to "Force Values" on page 14-1.
The RSLogix 5000 software requires a communication driver to communicate with a controller. You configure communication drivers using RSLinx software: 1. Start RSLinx software. 2. From the Communications menu, select Configure Drivers. 3. From the Available Driver Types drop-down list, select a driver:
Select this driver: Desktop computer RS-232 DF1 Devices 1784-KT/KTX(D)/PKTX(D) 1784-KTC(X) Ethernet devices DeviceNet Drivers (1784-PCD/PCIDS, 1770-KFD, SDNPT drivers) Laptop computer RS-232 DF1 Devices 1784-PCMK 1784-PCC Ethernet devices DeviceNet Drivers (1784-PCD/PCIDS, 1770-KFD, SDNPT drivers)
9-2
Test a Project
5. If you want to assign a descriptive name to the driver, change the default name. 6. Choose OK. 7. Configure the driver:
For this driver: serial Do this: A. From the Comm Port drop-down list, select the serial port that the driver will use. B. From the Device drop-down list, select Logix 5550-Serial Port. C. Click Auto-Configure. A. In the Station Name box, type a name that will identify the computer in the RSWho window. B. Select the interrupt value, memory address, and I/O base address. C. In the Net Address box, type the ControlNet node number that you want to assign to the computer. A. From the Value drop-down list, select the type of interface card that the driver will use. B. In the Property list, select the next item. C. In the Value box, type or select the appropriate value. D. Repeat steps B. and C. for the remaining properties. For each Ethernet device on this network with which you want to communicate (e.g., each 1756-ENET module or PLC-5E controller), add a map entry: A. In the Host Name column, type the IP address or host name of the Ethernet device. B. Do you want to communicate with another Ethernet device on this network? If: Yes No Then: 1. Choose Add New. 2. Go to Step A. Go to the next step.
ControlNet
DH+
Ethernet
Test a Project
9-3
Use this procedure to download a project to the controller so you can execute its logic. When you download a project, you lose the project and data that is currently in the controller, if any. If the revision of the controller does not match the revision of the project, you are prompted to update the firmware of the controller. RSLogix 5000 software lets you update the firmware of the controller as part of the download sequence. When you download a project or update firmware, all active servo axes are turned off. Before you download a project or update firmware, make sure that this will not cause any unexpected movement of an axis.
ATTENTION
!
IMPORTANT
To update the firmware of a controller, first install a firmware upgrade kit. An upgrade kit ships on a supplemental CD along with RSLogix 5000 software. To download an upgrade kit, go to www.ab.com. Choose Product Support. Choose Firmware Updates.
1. Open the RSLogix 5000 project that you want to download. 2. From the Communications menu, choose Who Active. 3. Expand the network until you see the controller.
To expand a network one level, do one of the following: Double-click the network. Select the network and press the key. Click the + sign.
Workstation
communication module
backplane
controller
9-4
Test a Project
7. Choose Download. The project downloads to the controller and RSLogix 5000 software goes online. 8. Skip the rest of this procedure. 9. Choose Update Firmware.
10.
11.
43056
10. Select the required revision for the controller. 11. Choose Update. A dialog box asks you to confirm the update. 12. To update the controller, choose Yes. The following events occur: The firmware of the controller is updated. The project downloads to the controller. RSLogix 5000 software goes online.
Test a Project
9-5
42627
A
42525
Then select on of these modes: RUN PROG Run REM Program Test
keyswitch selection A
turn outputs to the state commanded by the logic of the project turn outputs to their configured state for Program mode execute (scan) tasks change the mode of the controller through software download a project schedule a ControlNet network while online, edit the project send messages send and receive data in response to a message from another controller produce and consume tags
9-6
Test a Project
If the controller enters the faulted mode, a major fault occurred and the controller stopped executing the logic.
The controller is faulted. A major fault occurred and the controller is no longer executing its logic.
43057
1.
2. Use the information in the Recent faults list to correct the cause of the fault. Refer to "Major Fault Codes" on page A-1. 3. Click the Clear Majors button.
TIP
You can also clear a major fault by using the keyswitch on the controller. Turn the keyswitch to Prog, then to Run, and then back to Prog.
If you make changes to the project while online, save the project so that the offline project file matches the online project file:
If you want to: save online changes and data values save online changes but not online data values Do this: From the File menu, select Save. A. From the Communications menu, select Go Offline. B. From the File menu, select Save.
Chapter
10
Use this procedure to transfer data between controllers (send or receive data). You can transfer data using either of these methods: Produce and Consume a Tag Send a Message
needs regular delivery at a rate that you specify (i.e., deterministic) is sent when a specific condition occurs in your application is gathered from multiple controllers (and consumed tags are not an option or not desired)
A produced tag sends its data to one or more consumed tags (consumers) without using ladder logic.
10-2
You can use produced and consumed tags with the following controller and network combinations.
This controller: SLC 500 PLC-5 ControlLogix FlexLogix SoftLogix Can produce and consume tags over this network: Backplane ControlNet Ethernet
Produced and consumed tags work as follows: A connection transfers the data between controllers: Multiple controllers can consume (receive) the data. The data updates at the requested packet interval (RPI), as configured by the consuming tags. Each produced or consumed tag uses the following number of connections:
Each: produced tag consumed tag Uses this many connections:
number_of_consumers + 1
1
EXAMPLE
Connections used by produced or consumed tags Producing a tag for 5 controllers (consumers) uses 6 connections (5 consumers + 1 = 6). Producing 4 tags for 1 controller uses 8 connections: Each tag uses 2 connections (1 consumer + 1 = 2). 2 connections per tag x 4 tags = 8 connections Consuming 4 tags from a controller uses 4 connections (1 connection per tag x 4 tags = 4 connections).
10-3
10-4
6. Limit the size of the tag to less than or equal to 500 bytes. If you must transfer more than 500 bytes, create logic to transfer the data in packets. Refer to "Produce a Large Array" on page 11-1. 7. If you produce the tag over a ControlNet network, the tag may need to be less than 500 bytes. Refer to "Adjust for Bandwidth Limitations" on page 10-10. 8. If you are producing several tags for the same controller: Group the data into one or more user-defined data types. (This uses less connections than producing each tag separately.) Group the data according to similar update rates. (To conserve network bandwidth, use a greater RPI for less critical data.) For example, you could create one tag for data that is critical and another tag for data that is not as critical.
Produce a Tag
1. Open the RSLogix 5000 project that contains the tag that you want to produce. 2. From the Logic menu, select Edit Tags. 3. From Scope, select name_of_controller(controller). (Only tags that are controller scope can produce data.) 4. Select the tag that will produce the data and press the ALT + Enter keys.
5.
6.
42352
10-5
5. Select the Produced option button. 6. Type or select the number of controllers that will consume (receive) the tag. 7. Click OK. 8. Configure a tag in another controller (s) to consume this produced tag. Refer to "Consume a Produced Tag" on page 10-5.
6. 7. 8. 9.
42353
10.
10-6
7. Select the controller that contains the produced tag. 8. Type the name of the produced tag. 9. Select the same data type as the produced tag. 10. Type or select the time between updates of the tag: Use the highest value permissible for your application. If the controller consumes the tag over a ControlNet network, use a binary multiple of the ControlNet network update time (NUT). For example, if the NUT is 5 ms, type a rate of 5, 10, 20, 40 ms, etc. 11. Click OK. 12. If you share the tag over a ControlNet network, use RSNetWorx for ControlNet software to schedule the network.
IMPORTANT
If a consumed-tag connection fails, all of the other tags being consumed from that remote controller stop receiving new data.
10-7
3. Open RSNetWorx for ControlNet software. 4. In the ControlNet configuration for the target PLC-5C controller: a. Insert a Receive Scheduled Message. b. In the Message size, enter two times the number of REALs in the produced tag. For example, if the produced tag contains 10 REALs, enter 20 for the Message size. TIP When a PLC-5C controller consumes a tag that is produced by a Logix5000 controller, it stores the data in consecutive 16-bit integers. The PLC-5C stores floating-point data, which requires 32-bits regardless of the type of controller, as follows: The first integer contains the upper (left-most) bits of the value. The second integer contains the lower (right-most) bits of the value. This pattern continues for each floating-point value.
10-8
5. In the PLC-5C controller, re-construct the floating point data, as depicted in the following example: EXAMPLE Re-constructing a floating point value
The two MOV instructions reverse the order of the integers as the integers move to a new location. Because the destination of the COP instruction is a floating-point address, it takes two consecutive integers, for a total of 32 bits, and converts them to a single floating-point value.
42354
10-9
Data Type
10-10
The Rack Optimization format uses an additional 8 bytes for each slot in its chassis. Analog modules or modules that are sending or getting diagnostic, fuse, timestamp, or schedule data require direct connections and cannot take advantage of the rack optimized form. Selecting None frees up the 8 bytes per slot for other uses, such as produced or consumed tags. Separate the tag into two or more smaller tags: Group the data according to similar update rates. For example, you could create one tag for data that is critical and another tag for data that is not as critical. Assign a different RPI to each tag. Create logic to transfer the data in smaller sections (packets). Refer to "Produce a Large Array" on page 11-1.
10-11
Send a Message
To organize your data for a message, follow these guidelines: 1. For each message, create a tag to control the message: Create the tag at the controller scope. Use the MESSAGE data type. The following example shows the use of the MESSAGE data type:
EXAMPLE
count_send
count_msg.en /
count_msg ...
EN DN ER
42188
2. For the tags that the messages will use (source or destination tags), create the tags at the controller scope. 3. In the Logix5000 controller, use the DINT data type for integers whenever possible: Logix5000 controllers execute more efficiently and use less memory when working with 32-bit integers (DINTs).
10-12
4. If your message is to or from a PLC-5 or SLC 500 controller and it transfers integers (not REALs), use a buffer of INTs: a. Create a buffer for the data (controller scope) using the INT[x] data type. where:
x is the number of integers in the message. (For only one integer, omit [x].)
b. Use the buffer in the message. c. Use an FAL instruction to move the data between the buffer and your application. EXAMPLE Write integer values to a PLC-5 controller
Continuously moves the values in dint_array to int_buffer. This converts the values to 16-bit integers (INTs). Then the message instruction sends int_buffer to a PLC-5 controller.
message.EN / fal_control RES FAL File Arith/Logical Control fal_control Length ? Position 0 Mode all Dest int_buffer[fal_control.pos] ?? Expression dint_array[fal_control.pos] EN DN ER MSG Type - Unconfigured Message Control EN DN ER
message ...
42192
message ...
EN DN ER
message.DN
fal_control RES
FAL File Arith/Logical Control fal_control Length ? Position 0 Mode all Dest dint_array[fal_control.pos] ?? Expression int_buffer[fal_control.pos]
EN DN ER
42192
10-13
Use the following procedure to program a single message instruction to communicate with multiple controllers. To reconfigure a MSG instruction during runtime, write new values to the members of the MESSAGE data type. IMPORTANT In the MESSAGE data type, the RemoteElement member stores the tag name or address of the data in the controller that receives the message.
If the message: reads data writes data Then the RemoteElement is the: Source Element Destination Element
Tag Name
+ message.Channel. + message.Rack.
A B
A. If you use an asterisk [*] to designate the element number of the array, the value in B provides the element number. B. The Index box is only available when you use an asterisk [*] in the Source Element or Destination Element. The instruction subustitutes the value of Index for the asterisk [*].
10-14
To send a message to multiple controllers: TIP Set Up the I/O Configuration Define Your Source and Destination Elements Create the MESSAGE_CONFIGURATION Data Type Create the Configuration Array Get the Size of the Local Array Load the Message Properties for a Controller Configure the Message Step to the Next Controller Restart the Sequence
To copy the above components from a sample project, open the \RSLogix 5000\Projects\Samples folder.
MSG_to_Multiple_Controllers.ACD
43055
peer_controller
I/O Configuration
10-15
2. Create the local_array tag, which stores the data in this controller.
Tag Name local_array Type
data_type [length ] where: data_type is the data type of the data that the message sends or receives, such as DINT, REAL, or STRING. length is the number of elements in the local array.
10-16
To store the configuration variables for the message to each controller, create the following user-defined data type.
Data Type: MESSAGE_CONFIGURATION
Name Description Members Name Data Type STRING STRING Style Description MESSAGE_CONFIGURATION Configuration properties for a message to another controller
Data Types
User-Defined
+ Path + RemoteElement
10-17
Message Properties
Steps:
1. To store the configuration properties for the message, create the following array:
Tag Name message_config Type MESSAGE_CONFIGURATION[number ] Scope any
where:
10-18
2. Into the message_config array, enter the path to the first controller that receives the message.
Tag Name Value {} {}
Right-click and choose Go to Message Path Editor.
or
Browse to the remote controller.
3. Into the message_config array, enter the tag name or address of the data in the first controller to receive the message.
Tag Name Value {} {}
{}
Type the tag name or address of the data in the other controller.
10-19
4. Enter the path and remote element for each additional controller:
Tag Name Value {} {}
{}
1. 2. 3.
43051
1. The SIZE instruction counts the number of elements in local_array. 2. The SIZE instruction counts the number of elements in Dimension 0 of the array. In this case, that is the only dimension. 3. Local_array_length stores the size (number of elements) of local_array. This value tells a subsequent rung when the message has been sent to all the controllers and to start with the first controller again.
Tag Name local_array_length Type DINT
10-20
4. 5.
6.
43051
1. This XIO instruction conditions the rung to continuously send the message.
Tag Name message Type MESSAGE Scope controller
2. The COP instruction loads the path for the message. The value of index determines which element the instruction loads from message_config. See Figure 10.1 on page 10-17.
Tag Name index Type DINT Scope any
3. The instruction loads 1 element from message_config. 4. The COP instruction loads the tag name or address of the data in the controller that receives the message. The value of index determines which element the instruction loads from message_config. See Figure 10.1 on page 10-17. 5. The instruction loads 1 element from message_config. 6. MSG instruction
10-21
IMPORTANT
43054
If you want to: read (receive) data from the other controllers
For this item: Message Type Source Element Number Of Elements Destination Tag Index
Type or select: the read-type that corresponds to the other controllers tag or address that contains the data in the first controller 1 local_array[*] 0 the write-type that corresponds to other controllers local_array[*] 0 1 tag or address that contains the data in the first controller path to the first controller Clear the Cache Connection check box. Since this procedure continuously changes the path of the message, it is more efficient to clear this check box.
Communication
10-22
43051
1. After the MSG instruction sends the message 2. This ADD instruction increments index. This lets the logic load the configuration properties for the next controller into the MSG instruction. 3. This ADD instruction increments the LocalIndex member of the MSG instruction. This lets the logic load the value from the next controller into the next element of local_array..
43051
1. When index equal local_array_length, the controller has sent the message to all the other controllers. 2. This CLR instruction sets index equal to 0. This lets the logic load the configuration properties for the first controller into the MSG instruction and start the sequence of messages again. 3. This CLR instruction sets the LocalIndex member of the MSG instruction equal to 0. This lets the logic load the value from the first controller into the first element of local_array..
Chapter
11
The Logix5000 controller can send as many as 500 bytes of data over a single scheduled connection. This corresponds to 125 DINT or REAL elements of an array. To transfer an array of more than 125 DINTs or REALs, use a produced/consumed tag of 125 elements to create a packet of data. You can then use the packet to send the array piecemeal to another controller. When you send a large array of data in smaller packets, you must ensure that the transmission of a packet is complete before the data is moved into the destination array, for these reasons. Produced data over the ControlLogix backplane is sent in 50 byte segments. Data transmission occurs asynchronous to program scan. The logic that this section includes uses an acknowledge word to make sure that each packet contains new data before the data moves to the destination array. The logic also uses an offset value to indicate the starting element of the packet within the array. Because of the offset and acknowledge elements, each packet carries 123 elements of data from the array, as depicted below:
Producer Consumer
array
offset acknowledge
11-2
In addition, the array must contain an extra 122 elements. In other words, it must be 122 elements greater than the greatest number of elements that you want to transfer: These elements serve as a buffer. Since each packet contains the same number of elements, the buffer prevents the controller from copying beyond the boundaries of the array. Without the buffer, this would occur if the last packet contained fewer than 123 elements of actual data.
1. Open the RSLogix 5000 project that will produce the array. 2. In the Controller Tags folder, create the following tags:
P Tag Name Type DINT[2] DINT[125]
array_ack
where:
array_packet
array is the name for the data that you are sending.
3. Convert array_ack to a consumed tag:
For: Controller Remote Tag Name Specify: name of the controller that is receiving the packet
array_ack
Both controllers use the same name for this shared data.
11-3
4. In either the Controller Tags folder or the tags folder of the program that will contain the logic for the transfer, create the following tags:
Tag Name array Type DINT[x] where x equals the number of elements to transfer plus 122 elements DINT DINT DINT DINT TIMER
where:
array is the name for the data that you are sending.
5. In the array_size tag, enter the number of elements of real data. (The value of x from step 4. minus the 122 elements of buffer.) 6. Create or open a routine for the logic that will create packets of data. 7. Enter the following logic: Times how long it takes to send the entire array
TON Timer On Delay Timer array_transfer_timer Preset 10000000 Accum 0 EN DN
When the offset value in array_ack[0] is not equal to the current offset value but array_ack[1] equals -999, the consumer has begun to receive a new packet, so the rung moves -999 into the last element of the packet. The consumer waits until it receives the value -999 before it copies the packet to the array. This guarantees that the consumer has new data.
NEQ Not Equal Source A array_ack[0] 0 Source B array_packet[123] 0 EQU Equal Source A array_ack[1] 0 Source B -999 MOV Move Source -999
Dest array_packet[124] 0
11-4
When the offset value in array_ack[0] is equal to the current offset value, the consumer has copied the packet to the array; so the rung checks for more data to transfer. If the offset value plus 123 is less than the size of the array, there is more data to transfer; so the rung increases the offset by 123. Otherwise, there is no more data to transfer; so the rung resets the offset value, logs the transfer time, and resets the timer. In either case, the rung uses the new offset value to create a new packet of data, appends the new offset value to the packet, and clears the acknowledge element of the packet (packet[124]).
EQU Equal Source A array_ack[0] 0 Source B array_packet[123] 0 CMP Compare Expression (array_ack[0] + 123) < array_size ADD Add Source A array_packet[123] 0 Source B 123 Dest CMP Compare Expression (array_ack[0] + 123) >= array_size array_offset 0 CLR Clear Dest array_offset 0 MOV Move Source array_transfer_timer.ACC 0 Dest array_transfer_time 0 array_transfer_timer RES COP Copy File Source array[array_offset] Dest array_packet[0] Length 123 MOV Move Source array_offset 0 Dest array_packet[123] 0 CLR Clear Dest array_packet[124] 0
If the current transfer time is greater than the maximum transfer time, updates the maximum transfer time. This maintains a record of the longest time to transfer data.
GRT Greater Than (A>B) Source A array_transfer_time 0 Source B array_transfer_time_max 0 MOV Move Source array_transfer_time 0 Dest array_transfer_time_max 0
42355
11-5
8. Open the RSLogix 5000 project that will consume the array. 9. In the Controller Tags folder, create the following tags:
P Tag Name Type DINT[2] DINT[125]
array_ack array_packet
where: array is the name for the data that you are sending. Use the same name as in the producing controller (step 2.). 10. Convert array_packet to a consumed tag:
For: Controller Remote Tag Name Specify: name of the controller that is sending the packet
array_packet
Both controllers use the same name for this shared data.
Refer to "Consume a Produced Tag" on page 10-5. 11. In either the Controller Tags folder or the tags folder of the program that will contain the logic for the transfer, create the following tags:
Tag Name array Type DINT[x] where x equals the number of elements to transfer plus 122 elements DINT
array_offset
where: array is the name for the data that you are sending. 12. Create or open a routine for the logic that will move the data from the packets to the destination array.
11-6
13. Enter the following logic: When the offset value in array_packet[123] is different than the offset value in array_ack[0], the controller has begun to receive a new packet of data; so the rung checks for the value of -999 in the last element of the packet. If the last element of the packet equals -999, the controller has received an entire packet of new data and begins the copy operation: The offset value moves from the packet to array_offset. The COP instructions copies the data from the packet to the destination array, starting at the offset value. The offset value moves to array_ack[0], which signals that the copy is complete. Array_ack[1] resets to zero and waits to signal the arrival of a new packet. If the last element of the packet is not equal -999, the transfer of the packet to the controller may not be complete; so -999 moves to array_ack[1]. This signals the producer to return the value of -999 in the last element of the packet to verify the transmission of the packet.
NEQ Not Equal Source A array_packet[123] 0 Source B array_ack[0] 0 EQU Equal Source A array_packet[124] 0 Source B -999 MOV Move Source array_packet[123] 0 Dest array_offset 0 COP Copy File Source array_packet[0] Dest array[array_offset] Length 123 MOV Move Source array_packet[123] 0 Dest array_ack[0] 0 CLR Clear Dest array_ack[1] 0 NEQ Not Equal Source A array_packet[124] 0 Source B -999 MOV Move Source -999
Dest array_ack[1] 0
42356
11-7
Transferring a large array as smaller packets improves system performance over other methods of transferring the data: Fewer connections are used than if you broke the data into multiple arrays and sent each as a produced tag. For example, an array with 5000 elements would take 40 connections (5000/125=40) using individual arrays. Faster transmission times are achieved than if you used a message instruction to send the entire array. Messages are unscheduled and are executed only during the system overhead portion of the Logix5550 execution. Therefore, messages can take a fairly long time to complete the data transfer. You can improve the transfer time by increasing system overhead time slice, but this diminishes the performance of the continuous task.
11-8
Notes:
Chapter
12
Use this procedure to exchange ASCII data with a device through the serial port of the controller. For example, you can use the serial port to: read ASCII characters from a weigh scale module or bar code reader send and receive messages from an ASCII triggered device, such as a MessageView terminal.
connection from the serial port of the controller to the ASCII device
42237
Before you use this procedure: Configure the ASCII Device for Your Application To complete this procedure, do the following tasks: Connect the ASCII Device Configure the Serial Port Configure the User Protocol Create String Data Types Read Characters from the Device
Publication 1756-PM001D-EN-P - November 2001
12-2
1. For the serial port of the ASCII device, determine which pins send signals and which pins receive signals. 2. Connect sending pins to corresponding receiving pins and attach jumpers:
If the communications: Then wire the connectors as follows: handshake
ASCII Device
1 CD 2 RDX 3 TXD 4 DTR COMMON 6 DSR 7 RTS 8 CTS 9
Controller
1 CD 2 RDX 3 TXD 4 DTR COMMON 6 DSR 7 RTS 8 CTS 9
42231
do not handshake
ASCII Device
1 CD 2 RDX 3 TXD 4 DTR COMMON 6 DSR 7 RTS 8 CTS 9
Controller
1 CD 2 RDX 3 TXD 4 DTR COMMON 6 DSR 7 RTS 8 CTS 9
42232
3. Attach the cable shield to both connectors. 4. Connect the cable to the controller and the ASCII device.
12-3
1. Determine the following communication settings for the ASCII device: a. b. c. d. baud rate data bits parity stop bits
42627
3. On the Online toolbar, click the controller button. 4. Click the Serial Port tab.
5.
6.
42251
5. Select User. 6. Select the settings for the ASCII device, from step 1.
12-4
7.
8. 9.
42251
8. Type the amount of delay (20 ms units) between the time that the RTS signal turns on (high) and the time that data is sent. For example, a value of 4 produces an 80 ms delay. 9. Type the amount of delay (20 ms units) between the time that the last character is sent and the time that the RTS signal turns off (low). 10. Click Apply.
12-5
2. 3.
42252
2. Select or type a number that is greater than or equal to the greatest number of characters in a transmission. (Twice the number of characters is a good guideline.) 3. If you are using ABL or ARL instructions, type the characters that mark the end of the data. For the ASCII code of a character, refer to the back cover of this manual.
If the device sends: one termination character Then: A. In the Termination Character 1 text box, type the hexadecimal ASCII code for the first character. B. In the Termination Character 2 text box, type $FF. In the Termination Character 1 and 2 text boxes, type the hexadecimal ASCII code for each character. Notes: For printable characters, such as 1 or A, type the character.
12-6
4. 5. 6.
7.
42252
4. If you are using the AWA instruction, type the character(s) to append to the data. For the ASCII code of a character, refer to the back cover of this manual.
To append: one character Then: A. In the Append Character 1 text box, type the hexadecimal ASCII code for the first character. B. In the Append Character 2 text box, type $FF. In the Append Character 1 and 2 text boxes, type the hexadecimal ASCII code for each character. Notes: For printable characters, such as 1 or A, type the character.
two characters
5. If the ASCII device is configured for XON/XOFF flow control, select the XON/XOFF check box. 6. If the ASCII device is a CRT or is pre-configured for half duplex transmission, select the Echo Mode check box.
12-7
CRT
printer
Printer
Ignore
8. Click OK.
12-8
You store ASCII characters in tags that use a string data type.
42811
42812
You can use the default STRING data type. It stores up to 82 characters.
or
You can create a new string data type to store the number of characters that you define.
IMPORTANT
Use caution when you create a new string data type. If you later decide to change the size of the string data type, you may lose data in any tags that currently use that data type.
If you: make a string data type smaller make a string data type larger Then: The data is truncated. The LEN is unchanged. The data and LEN is reset to zero.
If: no yes
2. In the controller organizer, right-click Strings and choose New String Type 3. Type a name for the data type. 4. Type the maximum number characters that this string data type will store.
42233
5. Choose OK.
12-9
As a general rule, before you read the buffer use an ACB or ABL instruction to verify that the buffer contains the required characters: An ARD or ARL instruction continues to read the buffer until the instruction reads the required characters. While an ARD or ARL instruction is reading the buffer, no other ASCII Serial Port instructions, except the ACL, can execute. Verifying that the buffer contains the required characters prevents the ARD or ARL from holding up the execution of other ASCII Serial Port instructions while the input device sends its data. For additional information on ASCII Serial Port instructions, refer to Logix5000 Controllers General Instruction Set Reference Manual, publication 1756-RM003.
IMPORTANT
If you are not familiar with how to enter ladder logic in an RSLogix 5000 project, first review Program Routines on page 4-1.
42235a
3. Enter 0. (The serial port is channel 0.) 4. Enter a tag name for the ACB instruction and define the data type as SERIAL_PORT_CONTROL. 5. Enter the EN bit of the ACB tag. (The tag from step 4.)
12-10
7.
8.
11.
12.
42235a
7. Enter the POS member of the ACB tag. (The tag from step 4.) 8. Enter the number of characters in the data. 9. Enter 0. 10. Enter a tag name to store the ASCII characters. Define the data type as a string. 11. Enter a tag name for the ARD instruction and define the data type as SERIAL_PORT_CONTROL. 12. Enter the number of characters in the data.
12-11
EXAMPLE
A bar code reader sends bar codes to the serial port (channel 0) of the controller. Each bar code contains 24 characters. To determine when the controller receives a bar code, the ACB instruction continuously counts the characters in the buffer.
ACB ASCII Chars in Buffer Channel 0 SerialPort Control bar_code_count Character Count 0
bar_code_count.EN /
EN DN ER
When the buffer contains at least 24 characters, the controller has received a bar code. The ARD instruction moves the bar code to the bag_bar_code tag.
GEQ Grtr Than or Eql (A>=B) Source A bar_code_count.pos 0 Source B 24 ARD ASCII Read Channel Destination SerialPort Control String Length Characters Read EN 0 bag_bar_code '' bar_code_read 24 0 DN ER
42227
12-12
42235
15. Enter 0. 16. Enter a tag name for the ABL instruction and define the data type as SERIAL_PORT_CONTROL. 17. Enter the EN bit of the ABL tag. (The tag from step 16.) 18. Enter the following rung:
21. 19. 20.
22.
23.
42235
19. Enter the FD bit of the ABL tag. (The tag from step 16.) 20. Enter 0. 21. Enter a tag name to store the ASCII characters. Define the data type as a string. 22. Enter a tag name for the ARL instruction and define the data type as SERIAL_PORT_CONTROL. 23. Enter 0. This lets the instruction set the SerialPort Control Length equal to the size of the Destination.
12-13
EXAMPLE
Continuously tests the buffer for a message from the MessageView terminal. Since each message ends in a carriage return ($0D), the carriage return is configured as the termination character in the Controller Properties dialog box, User Protocol tab. When the ABL finds a carriage return, its sets the FD bit.
MV_line.EN /
ABL ASCII Test For Buffer Line Channel 0 SerialPort Control MV_line Character Count 0
EN DN ER
When the ABL instruction finds the carriage return (MV_line.FD is set), the controller removes the characters from the buffer, up to and including the carriage return, and places them in the MV_msg tag.
MV_line.FD ARL ASCII Read Line Channel Destination SerialPort Control String Length Characters Read
42226
12-14
And you: want to automatically append one or two characters to the end of the data
always send the same number of characters send different numbers of characters
6.
7.
42236a
3. Enter the input condition (s) that determines when the characters are to be sent: You can use any type of input instruction. The instruction must change from false to true each time the characters are to be sent. 4. Enter 0. 5. Enter the tag name that stores the ASCII characters. Define the data type as a string. 6. Enter a tag name for the AWA instruction and define the data type as SERIAL_PORT_CONTROL. 7. Enter the number of characters to send. Omit the characters that are appended by the instruction.
12-15
EXAMPLE
When the temperature exceeds the high limit (temp_high is on), the AWA instruction sends five characters from the string[1] tag to a MessageView terminal. The $14 counts as one character. It is the hex code for the Ctrl-T character. The instruction also sends (appends) the characters defined in the user protocol. In this example, the AWA instruction sends a carriage return ($0D), which marks the end of the message.
temp_high
AWA ASCII Write Append Channel Source SerialPort Control String Length Characters Sent
42229
12-16
13.
14.
42236b
10. Enter the input condition (s) that determines when the characters are to be sent: You can use any type of input instruction. The instruction must change from false to true each time the characters are to be sent. 11. Enter 0. 12. Enter the tag name that stores the ASCII characters. Define the data type as a string. 13. Enter a tag name for the AWT instruction and define the data type as SERIAL_PORT_CONTROL. 14. Enter the number of characters to send.
EXAMPLE
When the temperature reaches the low limit (temp_low is on), the AWT instruction sends nine characters from the string[2] tag to a MessageView terminal. (The $14 counts as one character. It is the hex code for the Ctrl-T character.)
AWT ASCII Write Channel Source SerialPort Control String Length Characters Sent EN 0 string[2] '$142224\01$r' temp_low_write 9 9 DN ER
temp_low
42229
12-17
21.
22.
20.
42236c
17. Enter the input condition (s) that determines when the characters are to be sent: You can use any type of input instruction. The instruction must change from false to true each time the characters are to be sent. 18. Enter 0. 19. Enter the tag name that stores the ASCII characters. Define the data type as a string. 20. Enter a tag name for the AWA instruction and define the data type as SERIAL_PORT_CONTROL. 21. Enter the LEN member of the Source tag. (The tag from step 19.) 22. Enter the LEN member of the AWA instruction. (The tag from step 20.)
12-18
EXAMPLE
When alarm is on, the AWA instruction sends the characters in alarm_msg and appends a termination character. Because the number of characters in alarm_msg varies, the rung first moves the length of alarm_msg (alarm_msg.LEN) to the length of the AWA instruction (alarm_write.LEN). In alarm_msg, the $14 counts as one character. It is the hex code for the Ctrl-T character.
alarm
AWA ASCII Write Append Channel Source SerialPort Control String Length Characters Sent
42229
12-19
29.
30.
28.
42236d
25. Enter the input condition (s) that determines when the characters are to be sent: You can use any type of input instruction. The instruction must change from false to true each time the characters are to be sent. 26. Enter 0. 27. Enter the tag name that stores the ASCII characters. Define the data type as a string. 28. Enter a tag name for the AWT instruction and define the data type as SERIAL_PORT_CONTROL. 29. Enter the LEN member of the Source tag. (The tag from step 27.) 30. Enter the LEN member of the AWT instruction. (The tag from step 28.)
12-20
EXAMPLE
When MV_update is on, the AWT instruction sends the characters in MV_msg. Because the number of characters in MV_msg varies, the rung first moves the length of MV_msg (MV_msg.LEN) to the length of the AWT instruction (MV_write.LEN). In MV_msg, the $16 counts as one character. It is the hex code for the Ctrl-V character.
MV_update
AWT ASCII Write Channel Source EN DN ER 0 MV_msg '$161365\8\1$r' SerialPort Control MV_write String Length 10 Characters Sent 10
42229
12-21
IMPORTANT
This String Browser window shows the characters up to the value of the LEN member of the string tag. The string tag may contain additional data, which the String Browser window does not show.
1.
42616
2.
dollar sign ($24) single quote ($27) line feed ($0A) new line ($0D$0A) form feed ($0C) carriage return ($0D) tab ($09)
42615
The number of characters that you see in the window. This is the same as the LEN member of the string tag.
The maximum number of characters that the string tag can hold.
12-22
Notes:
Chapter
13
Use this procedure to: interpret a bar code and take action based on the bar code use a weight from a weigh scale when the weight is sent as ASCII characters decode a message from an ASCII triggered device, such as an operator terminal build a string for an ASCII triggered device using variables from your application
Depending on your application, you may not need to do all the tasks in this procedure. Use the following table to determine where to start:
If you want to: isolate specific information from a bar code search an array for a specific string of characters compare two strings of characters use a weight from a weigh scale decode a message from an operator terminal create a string to send to an operator terminal Then go to: Extract a Part of a Bar Code Look Up a Bar Code Check the Bar Code Characters Convert a Value Decode an ASCII Message Build a String On page: 13-2 13-4 13-10 13-12 13-14 13-18
For additional information on ASCII-related instructions, refer to Logix5000 Controllers General Instruction Set Reference Manual, publication 1756-RM003.
13-2
Use the following steps to extract a part of a bar code so you can take action based on its value. For example, a bar code may contain information about a bag on a conveyor at an airport. To check the flight number and destination of the bag, you extract characters 10 - 18.
origin O 7 P 8 9 5 0
flight # 5 8 A
destination M S 0 2 2
date 2 0 1
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
M S
9 characters
Steps:
1. Enter the following rung:
3. 2. 4.
42808
5.
6.
2. Enter the EM bit of the ARD instruction that reads the bar code. 3. Enter the string tag that contains the bar code. 4. Enter the number of characters in the part of the bar code that you want to check. 5. Enter the position of the first character in the part of the bar code that you want to check. 6. Enter a tag name to store the part of the bar code that you want to check. Define the data type as a string.
13-3
EXAMPLE
In the baggage handling conveyor of an airport, each bag gets a bar code. Characters 10 - 18 of the bar code are the flight number and destination airport of the bag. After the bar code is read (bag_read.EM is on) the MID instruction copies the flight number and destination airport to the bag_flt_and_dest tag.
42808
13-4
Use the following steps to return specific information about an item based on its bar code. For example, in a sorting operation, an array of a user-defined data type creates a table that shows the lane number for each type of product. To determine which lane to route a product, the controller searches the table for the product ID (characters of the bar code that identify the product).
Tag Name Value
sort_table
product_id GHI
To look up a bar code: TIP Create the PRODUCT_INFO Data Type Search for the Characters Identify the Lane Number Reject Bad Characters Enter the Product IDs and Lane Numbers
To copy the above components from a sample project, open the \RSLogix 5000\Projects\Samples folder.
13-5
Create the following user-defined data type. + Controller Your_Project + Tasks + Motion Groups
Trends
Data Types
User-Defined
+ Product_ID
Right-click and choose New Data Type. Lane
13-6
1. 2. 3.
43038
1. The SIZE instruction counts the number of elements in the sort_table array. This array contains the product ID for each item and the corresponding lane number for the item.
Tag Name sort_table Type PRODUCT_INFO[number_of_items ] where: number_of_items is the number of items hat you must sort.
2. The SIZE instruction counts the number of elements in Dimension 0 of the array. In this case, that is the only dimension. 3. The SIZE instruction sets the Length of the subsequent FSC instruction equal to the size of the sort_table array. This ensures that the FSC instruction searches the exact size of the array.
Tag Name sort_table_search Type CONTROL
13-7
4. 5. 6.
43038
4. The sort_table_search tag controls the FSC instruction, which looks through the sort_table array for the bar code characters. 5. Although the previous instruction sets the Length of this instruction, the software requires an initial value to verify the project. 6. The product_id tag contains the bar code characters that identify the item. The FSC instruction searches each Product_ID member in the sort_table array until the instruction finds a match to the product_id tag.
Tag Name product_id Type STRING
13-8
43038
1. When the FSC instruction finds the product ID within the sort_table array, the instruction sets the FD bit. 2. When the FSC finds a match. the POS member indicates the element number within the sort_table array of the match. The corresponding LANE member indicates the lane number of the match. 3. Based on the POS value, the MOV instruction moves the corresponding lane number into the lane tag. The controller uses the value of this tag to route the item.
Tag Name lane Type DINT
4. After the MOV instruction sets the value of the lane tag, the RES instruction resets the FSC instruction so it can search for the next product ID.
13-9
43038
1. If the FSC instruction does not find the product ID within the sort_table array, the instruction sets the DN bit. 2. When no match is found, the MOV instruction moves 999 into the lane tag. This tells the controller to reject or reroute the item. 3. After the MOV instruction sets the value of the lane tag, the RES instruction resets the FSC instruction so it can search for the next product ID.
13-10
In this task, you use a compare instruction (EQU, GEQ, GRT, LEQ, LES, NEQ) to check for specific characters. The hexadecimal values of the characters determine if one string is less than or greater than another string. When the two strings are sorted as in a telephone directory, the order of the strings determines which one is greater.
ASCII Characters 1ab
l e s s e r g r e a t e r
Hex Codes $31$61$62 $31$62 $41 $41$42 $42 $61 $61$62 a>B AB < B
1b A AB B a ab
Steps:
1. Enter a rung and a compare instruction:
To see if the string is: equal to specific characters not equal to specific characters greater than specific characters equal to or greater than specific characters less than specific characters equal to or less than specific characters Enter this instruction: EQU NEQ GRT GEQ LES LEQ
13-11
2.
3.
6.
4.
42808
2. Enter the tag that stores the part of the bar code that you want to check. (The Destination from Extract a Part of a Bar Code, step 6.) 3. Enter a tag name to store the characters that you want to test against. Define the data type as a string. 4. Double-click value area of Source B. 5. Type the ASCII characters to test against and choose OK.
42615
EXAMPLE
When bag_flt_and_dest is equal to gate[1], xfer{1] turns on. This routes the bag to the required gate.
42808
13-12
Convert a Value
Use the following steps to convert the ASCII representation of a value to an DINT or REAL value that you can use in your application. The STOD and STOR instructions skip any initial control or non-numeric characters (except the minus sign in front of a number). If the string contains multiple groups of numbers that are separated by delimiters (e.g., / ), the STOD and STOR instructions convert only the first group of numbers.
Steps:
1. Which type of number is the value?
If: floating-point integer Then: Go to step 2. Go to step 7.
42810
3. Enter the EM bit of the ARD or ARL instruction that read the value. 4. Enter the string tag that contains the value. 5. Enter a tag name to store the value for use in your application. Define the data type as REAL.
EXAMPLE
After reading the weight from the scale (weight_read.EM is on) the STOR instruction converts the numeric characters in weight_ascii to a REAL value and stores the result in weight.
42810
13-13
42810
8. Enter the EM bit of the ARD or ARL instruction that read the value. 9. Enter the string tag that contains the value. 10. Enter a tag name to store the value for use in your application. Define the data type as DINT.
EXAMPLE
When MV_read.EM is on, the STOD instruction converts the first set of numeric characters in MV_msg to an integer value. The instruction skips the initial control character ($06) and stops at the delimiter ( \ ).
42620
11. Does this string have another value that you want to use?
If: yes no Then: Go to Decode an ASCII Message on page 13-14. Stop. You are done with this procedure.
13-14
Use the following steps to extract and convert a value from an ASCII message that contains multiple values. For example, a message may look like this:
first value second value third value
control character
delimiter
delimiter
termination character
42810
42810
13-15
4. 3.
5. 6.
42810
8.
9.
3. Enter the EM bit of the ARL instruction that read the value. 4. Enter the string tag that contains the value. 5. Enter a tag name to store the delimiter that marks the beginning of the value. Define the data type as a string. 6. Double-click the value area of Search.
42615
7. Type the delimiter and choose OK. 8. Enter the position in the string to start the search. Initially, you can use 0 to find the first delimiter. To decode additional data, increase this value to search for the next delimiter. 9. Enter a tag name to store the location of the delimiter. Define the data type as a DINT.
13-16
10.
11.
42810
12.
13.
10. Enter the string tag that contains the value. 11. Enter the maximum number of characters that this value can contain. 12. Enter the tag that stores the position of the delimiter. (The tag from step 9.) 13. Enter a tag name to store this value. Define the data type as a string. 14. Which type of conversion instruction did you use?
If: STOR STOD Then: Go to step 15. Go to step 18.
13-17
15.
16.
42809
15. Enter the tag that stores the value. (The tag from step 13.) 16. Enter a tag name to store the value for use in your application. Define the data type as REAL. 17. Go to step 20.
18. 19.
42809
18. Enter the tag that stores the value. (The tag from step 13.) 19. Enter a tag name to store the value for use in your application. Define the data type as DINT. 20. Does the string have another value that you want to use?
If: yes Then: A. Add 1 to the Result of the Find instruction. (The tag from step 9.) B. Repeat steps 2 - 19. Stop. You are done with this procedure.
no
13-18
Build a String
Use the following steps to build a string from variables in your application. You can then send the string to an ASCII triggered device, such as a MessageView terminal. In this procedure, you build a string that contains two variables. For example, an operator terminal may require a string that looks like this:
[Ctrl-F] message # \ address [CR]
control character
delimiter
termination character
If you need to include more variables, use additional INSERT or CONCAT instructions. If you need to send a floating-point value, use a RTOS instruction in place of the DTOS instruction. The final string will not include the termination character. When you send the string, use an AWA instruction to automatically append the termination character.
Steps:
1. Enter the following rung:
2. 3. 4.
42813
2. Enter the input condition (s) that determines when to build the string. 3. Enter the DINT tag that contains the first value for the string. 4. Enter a tag name to stores the ASCII representation of the value. Define the data type as a string.
13-19
5.
6.
8.
42813
9.
10.
5. Enter a tag name to store the control and delimiter characters for the string. Define the data type as a string. 6. Double-click the value area of the Source A.
42615
7. Type the control character and delimiter and choose OK. For a control character, type the hex code of the character. For a list of hex codes, see the back cover of this manual. 8. Enter the tag that stores the ASCII representation of the first value. (The tag from step 4.) 9. Enter 2. This puts the value after the first character (control character) in Source A. 10. Enter a tag name to store the partially completed string. Define the data type as a string.
13-20
11.
12.
13.
14.
42813
15.
11. Enter the DINT tag that contains the second value for the string. 12. Enter a tag name to store the ASCII representation of the value. Define the data type as a string. 13. Enter the tag that stores the partially completed string. (The tag from step 10.) 14. Enter the tag that stores the ASCII representation of the second value. (The tag from step 12.) 15. Enter a tag name to store the completed string. Define the data type as a string.
13-21
EXAMPLE
To trigger a message in a MessageView terminal, the controller sends the terminal a message in the following format: [Ctrl-T] message # \ address [CR] When send_msg is on, the rung does the following: The first DTOS instruction converts the message number to ASCII characters. The INSERT instruction inserts the message number (in ASCII) after the control character [Ctrl-T]. (The hex code for Ctrl-T is $14.) The second DTOS instruction converts the node number of the terminal to ASCII characters. The CONCAT instruction puts the node number (in ASCII) after the backslash [ \ ] and stores the final string in msg. To send the message, an AWA instruction sends the msg tag and appends the carriage return [CR].
42813
13-22
Notes:
Chapter
14
Force Values
When you force a value: You can force all I/O data, except for configuration data. If the tag is an array or structure, such as an I/O tag, force a BOOL, SINT, INT, DINT, or REAL element or member. If the data value is a SINT, INT, or DINT, you can force the entire value or you can force individual bits within the value. Individual bits can have a force status of: no force force on force off You can also force an alias to an I/O structure member, produced tag, or consumed tag. An alias tag shares the same data value as its base tag, so forcing an alias tag also forces the associated base tag. Removing a force from an alias tag removes the force from the associated base tag.
ATTENTION
!
1
If forces are enabled and anything is forced, keep personnel away from the machine area. Forcing can cause unexpected machine motion that could injure personnel.
14-2
Force Values
IMPORTANT
Forcing increases logic execution time. The more values you force, the longer it takes to execute the logic.
IMPORTANT
Forces are held by the controller and not by the programming workstation. Forces remain even if the programming workstation is disconnected.
Enter a Force
Use the Monitor Tags tab of the Tags window or use the Ladder window to enter forces.
Force Values
14-3
If you want to: force a whole SINT, INT, DINT, or REAL value
Do this: To force a whole value, type a force value in the Force Mask column, using a decimal, octal, hexadecimal, or float/exponential format. For a REAL value, you must use a float/exponential format. To remove a force for a whole value, type a space. To force an individual bit in a SINT, INT, or DINT value, expand the value and edit the Force Mask column. The force value is displayed in binary style, where: 0 indicates force off 1 indicates force on . indicates no force You can also use the bit pallet to select a bit to force. To force a BOOL, enter the force value, where: 0 indicates force off 1 indicates force on To remove a force, type a space.
force a BOOL
14-4
Force Values
Right-click on the BOOL tag or bit value. Select Force On, Force Off, or Remove Force.
For forced values in the more complex instructions, you can only remove forces. You must use the data monitor to set force values for these values.
Force Values
14-5
Enable Forces
For a force (s) to take affect, you enable forces. You can only enable and disable forces at the controller level. You cannot enable or disable forces for a specific module, tag collection, or tag element. Enabling forces causes input, output, produced, or consumed values to change. Keep personnel away from the machine area. Forcing can cause unexpected machine motion that could injure personnel.
ATTENTION
IMPORTANT
If you download a project that has forces enabled, the programming software prompts you to enable or disable forces after the download completes.
When forces are enabled, a > appears next to the forced value in the ladder editor.
When forces are enabled, the ladder editor indicates which forces are on.
14-6
Force Values
Disable Forces
You can disable forces without removing forces from individual values or from the controller. By disabling forces, the project can execute as programmed. Forces are still entered, but they are not executed.
Remove Forces
You can remove forces from individual values or from the entire controller. You can remove individual forces from the data monitor.
If you want to remove a force from a: whole SINT, INT, DINT, or REAL value bits within a value BOOL value
Do this: Right-click on the value in the data monitor and select Remove Force. Expand the value and edit the Force Mask column. Change the bit value to . to indicate no force. Type a space.
If the force is on a BOOL tag or bit value, you can also remove forces from the ladder editor. Right-click on the value and select Remove Force. If you remove each force individually, forces can still be enabled. If you have removed forces, but forces are still enabled and you set a force value, it takes affect immediately. Keep personnel away from the machine area. Forcing can cause unexpected machine motion that could injure personnel.
ATTENTION
Removing a force on an alias tag also removes the force on the base tag.
Force Values
14-7
At the controller level, you can remove all forces. Removing all forces disables forces and clears all force mask values.
Monitor Forces
You can monitor force status in the following ways: RSLogix5000 software application logic FORCE LED. (Logix5550 controllers do not have an LED to indicate force status.)
If the FORCE LED is: off flashing solid Then: No tags contain force values. Forces are inactive (disabled). At least one tag contains a force value. Force values are inactive (disabled). Forces are active (enabled). Force values may or may not exist.
The following example shows how to check whether forces are present and enabled and set your own LED indicator.
14-8
Force Values
Notes:
Chapter
15
If a fault condition occurs that is severe enough for the controller to shut down, the controller generates a major fault and stops the execution of logic. Depending on your application, you may not want all major faults to shut down your entire system. In those situations, you can use a fault routine to clear a specific fault and let at least some of your system continue to operate. EXAMPLE Use a fault routine In a system that uses recipe numbers as indirect addresses, a miss-typed number could produce a major fault, such as type 4, code 20. To keep the entire system from shutting down, a fault routine clears any type 4, code 20, major faults.
To develop a fault routine: Create the FAULTRECORD Data Type Create a Fault Routine Clear a Major Fault Clear a Major Fault During Prescan Test a Fault Routine
15-2
Create the following user-defined data type. It stores information about the fault.
Data Type: FAULTRECORD
Name Description Members Name Time_Low Time_High Type Code Data Type DINT DINT INT INT DINT[8] Style Decimal Decimal Decimal Decimal Hex Description lower 32 bits of the fault timestamp value upper 32 bits of the fault timestamp value fault type (program, I/O, etc) unique code for the fault fault specific information FAULTRECORD Stores the MajorFaultRecord attribute or MinorFaultRecord attribute of the PROGRAM object.
Data Types
User-Defined
Info
15-3
A fault routine lets you use ladder logic to clear specific faults and let the controller resume execution. Where you place the routine depends on the type of fault that you want to clear:
Do this: Create a fault routine for the program: A. In the controller organizer, right-click name_of_program and select New Routine. B. In the name box, type a name for the fault routine (name_of_fault_routine ). C. From the Type drop-down list, select Ladder. D. Click OK. E. Right-click name_of_program and select Properties. F. Click the Configuration tab. G. From the Fault drop-down list, select name_of_fault_routine. H. Click OK. Create a program and main routine for the Controller Fault Handler: A. In the controller organizer, right-click Controller Fault Handler and select New Program. B. Type: name_of_program description (optional) C. Click OK. D. Click the + sign next to Controller Fault Handler. E. Right-click name_of_program and select New Routine. F. Type: name_of_routine description (optional) G. From the Type drop-down list, select the programming language for the routine. H. Click OK. I. Right-click name_of_program and select Properties. J. Click the Configuration tab. K. From the Main drop-down list, select name_of_routine L. Click OK.
15-4
To clear a major fault that occurs during the execution of your project, enter the following logic in the appropriate fault routine. (See Create a Fault Routine on page 15-3.) Get the Fault Type and Code Check for a Specific Fault Clear the Fault
1. 2.
42372
1. The GSV instruction accesses the MAJORFAULTRECORD attribute of this program. This attribute stores information about the fault. 2. The GSV instruction stores the fault information in the major_fault_record tag. When you enter a tag that is based on a structure, enter the first member of the tag.
Tag Name major_fault_record Type FAULTRECORD
15-5
42372
3.
4.
1. This EQU instruction checks for a specific type of fault, such as program, I/O. In Source B, enter the value for the type of fault that you want to clear. 2. This EQU instruction checks for a specific fault code. In Source B, enter the value for the code that you want to clear. 3. This CLR instruction sets to zero the value of the fault type in the major_fault_record tag. 4. This CLR instruction sets to zero the value of the fault code in the major_fault_record tag.
1. 2.
42372
1. The SSV instruction writes new values to the MAJORFAULTRECORD attribute of this program. 2. The SSV instruction writes the values contained in the major_fault_record tag. Since the Type and Code member are set to zero, the fault clears and the controller resumes execution.
15-6
If the controller faults immediately after you switch it to the Run mode, then examine the prescan operation for the fault. For example, prescan examines indirect addresses (a tag that serves as a pointer to an element within an array). If an indirect address is initialized at run time, it may be too large for the array during prescan. If the controller finds an indirect address that is out of range during prescan, a major fault occurs. To let the controller complete the prescan, use the fault routine of the program to trap and clear the fault. To clear a major fault that occurs during prescan: Identify When the Controller is in Prescan Get the Fault Type and Code Check for a Specific Fault Clear the Fault
43063
1. Enter this rung as the first rung in the main routine of the program. 2. The fault routine of this program uses the status of this bit to determine if the fault occurred during prescan or normal scan of the logic: During prescan, this bit is off. (During prescan, the controller resets all bits that are referenced by OTE instructions.) Once the controller begins to execute the logic, this bit will always be on.
Tag Name CPU_scanning Type BOOL
15-7
1. 2.
43064
1. The GSV instruction accesses the MAJORFAULTRECORD attribute of this program. This attribute stores information about the fault. 2. The GSV instruction stores the fault information in the major_fault_record tag. When you enter a tag that is based on a structure, enter the first member of the tag.
Tag Name major_fault_record Type FAULTRECORD
15-8
43064
4.
5.
1. During prescan the bits of all OTE instructions are off and this instruction is true. Once the controller begins to execute the logic, this instruction is always false. 2. This EQU instruction checks for a fault of type 4, which means that an instruction in this program caused the fault. 3. This EQU instruction checks for a fault of code 20, which means that either an array subscript is too large, or a POS or LEN value of a CONTROL structure is invalid. 4. This CLR instruction sets to zero the value of the fault type in the major_fault_record tag. 5. This CLR instruction sets to zero the value of the fault code in the major_fault_record tag.
15-9
2. 3.
43064
1. During prescan the bits of all OTE instructions are off and this instruction is true. Once the controller begins to execute the logic, this instruction is always false. 2. The SSV instruction writes new values to the MAJORFAULTRECORD attribute of this program. 3. The SSV instruction writes the values contained in the major_fault_record tag. Since the Type and Code member are set to zero, the fault clears and the controller resumes execution.
15-10
You can use a JSR instruction to test the fault routine of a program without creating an error (i.e., simulate a fault): 1. Create a BOOL tag that you will use to initiate the fault. 2. In the main routine or a subroutine of the program, enter the following rung:
is the: tag that you will use to initiate the fault (Step 1.) fault routine of the program
EXAMPLE
When test_fault_routine is on, a major fault occurs and the controller executes Fault_Routine.
Chapter
16
If you want to suspend (shut down) the controller based on conditions in your application, create a user-defined major fault. With a user-defined major fault: You define a value for the fault code. The controller handles the fault the same as other major faults: The controller changes to the faulted mode (major fault) and stops executing the logic. Outputs are set to their configured state or value for faulted mode.
EXAMPLE
User-defined major fault When input_value is greater than 80, produce a major fault and generate a fault code of 999.
16-2
where:
name_of_fault_routine x
EXAMPLE
When input_value is greater than or equal to 80, execution jumps to name_of_fault_routine. A major fault occurs and the controller enters the faulted mode. Outputs go to the faulted state. The Controller Properties dialog box, Major Faults tab, displays the code 999.
GEQ Grtr Than or Eql (A>=B) Source A input_value 0 Source B 80 JSR Jump to Subroutine Routine name name_of_fault_routine Input par 999
42373
Chapter
17
If a fault condition occurs that is not severe enough for the controller to shut down, the controller generates a minor fault. The controller continues to execute. You do not need to clear a minor fault. To optimize execution time and ensure program accuracy, you should monitor and correct minor faults.
1. Enter a GSV instructions that gets the FAULTLOG object, MinorFaultBits attribute. 2. Monitor bit 6. 1. Enter a GSV instructions that gets the FAULTLOG object, MinorFaultBits attribute. 2. Monitor bit 7. 1. Enter a GSV instructions that gets the FAULTLOG object, MinorFaultBits attribute. 2. Monitor bit 9. 1. Enter a GSV instructions that gets the FAULTLOG object, MinorFaultBits attribute. 2. Monitor bit 10. 1. Create a user-defined data type that stores the fault information. Name the data type FaultRecord and assign the following members: Name: TimeLow TimeHigh Type Code Info Data Type: DINT DINT INT INT DINT[8] Style: Decimal Decimal Decimal Decimal Hex
2. Create a tag that will store the values of the MinorFaultRecord attribute. Select the data type from step 1. 3. Monitor S:MINOR. 4. If S:MINOR is on, use a GSV instruction to get the values of the MinorFaultRecord attribute. 5. If you want to detect a minor fault that is caused by another instruction, reset S:MINOR. (S:MINOR remains set until the end of the scan.)
17-2
EXAMPLE
Minor_fault_check times for 1 minute (60000 ms) and then automatically restarts itself.
Every minute, minor_fault_check.DN turns on for one scan. When this occurs, the GSV instruction gets the value of the FAULTLOG object, MinorFaultBits attribute, and stores it in the minor_fault_bits tag. Because the GSV instruction only executes once every minute, the scan time of most scans is reduced.
42373
17-3
The following example checks for a minor fault that is caused by a specific instruction. Check for a minor fault that is caused by an instruction
EXAMPLE
Multiplies value_a by 1000000 and checks for a minor fault, such as a math overflow: To make sure that a previous instruction did not produce the fault, the rung first clears S:MINOR. The rung then executes the multiply instruction. If the instruction produces a minor fault, the controller sets S:MINOR. If S:MINOR is set, the GSV instruction gets information about the fault and resets S:MINOR.
42373
17-4
Notes:
Chapter
18
The power-up handler is an optional task that executes when the controller powers up in the Run mode.
42195
Use the power-up handler when you want to accomplish either of the following after power is lost and then restored: Prevent the controller from returning to Run mode. The power-up handler will produce a major fault, type 1, code 1, and the controller will enter the Faulted mode. Take specific actions and then resume normal execution of the logic.
The steps to develop a power-up routine are similar to the steps to develop a fault routine: 1. Create a user-defined data type that will store the fault information. Name the data type FaultRecord and assign the following members:
Name: TimeLow TimeHigh Type Code Info Data Type: DINT DINT INT INT DINT[8] Style: Decimal Decimal Decimal Decimal Hex
2. Create a tag that will store the fault information. Select the FaultRecord data type.
18-2
2. Create and assign a main routine (the routine to execute first in the program).
When power is restored, take specific actions and then resume normal operation
18-3
4. Enter the following logic to clear the fault: Gets fault information and stores it in the major_fault tag (user-define structure)
GSV Get system value CIP Object class PROGRAM CIP Object name THIS Attribute name MAJORFAULTRECORD Dest major_fault.TimeLow 0
Sets the fault type and code in the major_fault tag to zero and sets MAJORFAULTRECORD to the new values, which clears the fault.
MOV Move Source 0 Move Source MOV 0 SSV Set system value CIP Object class PROGRAM CIP Object name THIS Attribute name MAJORFAULTRECORD Source major_fault.TimeLow 0
42375
Dest major_fault.Type 0
Dest major_fault.Code 0
where:
18-4
Notes:
Chapter
19
Currently, only 1756-L55M23 and -L55M24 controllers have nonvolatile memory for project storage. In the future, we will add the feature to additional controllers within the Logix5000 family of controllers. IMPORTANT Nonvolatile memory stores the contents of the user memory at the time that you store the project. Changes that you make after you store the project are not reflected in nonvolatile memory. If you want to store changes such as online edits, tag values, or a ControlNet network schedule, store the project again after you make the changes. Use this procedure to store or load a project using the nonvolatile memory of a controller. If the controller loses power and does not have enough battery capacity, it loses the project in user memory. Nonvolatile memory lets you keep a copy of your project on the controller. The controller does not need power to keep this copy. You can load the copy from nonvolatile memory to the user memory of the controller: on every power-up whenever there is no project in the controller and it powers-up anytime through RSLogix 5000 software
19-2
remove a project from the nonvolatile memory of the Go to Clear Nonvolatile Memory controller on page 19-10.
19-3
Store a Project
In this task, you store a project in the nonvolatile memory of the controller. This overwrites a project that is currently in the nonvolatile memory. During a store, all active servo axes are turned off. Before you store a project, make sure that this will not cause any unexpected movement of an axis.
ATTENTION
!
Steps:
Before you store the project: make all the required edits to the logic download the project to the controller
1. Go online with the controller. 2. Put the controller in Program mode (Rem Program or Program).
3.
42627
3. On the Online toolbar, click the controller properties button. 4. Click the Nonvolatile Memory tab.
5.
42865
5. Choose Load/Store.
19-4
Project that is currently in the nonvolatile memory of the controller (if any project is there).
6. 7. 8.
42866
9.
6. When (under what conditions) do you want to load the project back into the user memory (RAM) of the controller?
If you want to load it: whenever you turn on or cycle the chassis power Then select: Notes: During a power cycle, you will lose any online changes, tag values, and network schedule that you have not stored in the nonvolatile memory. With this option, the project also loads when you update the firmware of the controller. After the load, the controller automatically goes to the mode that you select from the Load Mode drop-down list (step 7). You can always use RSLogix 5000 software to load the project. whenever there is no project in the controller and you turn on or cycle the chassis power
On Power Up
On Corrupt Memory
With this option, the project also loads when you update the firmware of the controller. After the load, the controller automatically goes to the mode that you select from the Load Mode drop-down list (step 7). You can always use RSLogix 5000 software to load the project.
User Initiated
19-5
User Initiated
8. Type a note that describes the project that you are storing, if desired. 9. Choose < Store. A dialog box asks you to confirm the store. 10. To store the project, choose Yes. During the store, the following events occur: On the front of the controller, the OK LED displays the following sequence: flashing green red green RSLogix 5000 software goes offline. A dialog box tells you that the store is in progress. 11. Choose OK. When the store is finished, you remain offline. If you want to be online, you must manually go online.
19-6
Load a Project
In this task, you use RSLogix 5000 software to load the project from nonvolatile memory. During a load, all active servo axes are turned off. Before you load a project, make sure that this will not cause any unexpected movement of an axis.
ATTENTION
!
Steps:
1. Go online with the controller. 2. Did the following dialog box open?
42873
If: No Yes
4.
42627
4. On the Online toolbar, click the controller properties button. 5. Click the Nonvolatile Memory tab.
19-7
6.
42865
6. Choose Load/Store.
Project that is currently in the nonvolatile memory of the controller (if any project is there). Project that is currently in the user memory (RAM) of the controller.
42866
7.
7. Choose Load >. A dialog box asks you to confirm the load. 8. To load the project from the nonvolatile memory, choose Yes.
19-8
During the load, the following events occur: On the front of the controller, the OK LED displays the following sequence: red green RSLogix 5000 software goes offline. When the load is finished, you remain offline. If you want to be online, you must manually go online.
19-9
When the controller loads a project from nonvolatile memory, it provides the following information: logs a minor fault (type 7, code 49) sets the FAULTLOG object, MinorFaultBits attribute, bit 7 If you want your project to flag that it loaded from nonvolatile memory, use the following ladder logic:
On the first scan of the project (S:FS is on), the GSV instruction gets the FAULTLOG object, MinorFaultBits attribute, and stores the value in minor_fault_bits. If bit 7 is on, the controller loaded the project from its nonvolatile memory.
42867
Where:
Is: Tag that stores the FAULTLOG object, MinorFaultBits attribute. Data type is DINT. Tag that indicates that the controller loaded the project from its nonvolatile memory.
minor_fault_bits NVM_load
19-10
Typically, you do not have to clear the nonvolatile memory of the controller. When you store a project, you overwrite the complete contents of the nonvolatile memory. When you update the firmware of the controller you erase the contents of the nonvolatile memory (revision 10.x or later). If you want to remove a project from the nonvolatile memory without updating the firmware of the controller, complete the following steps: 1. Go online with the controller.
2.
42627
2. On the Online toolbar, click the controller properties button. 3. Click the Nonvolatile Memory tab.
4.
42865
5. Choose Load/Store. 6. In the Load Image drop-down list, select User Initiated.
19-11
7. Choose <- Store. A dialog box asks you to confirm the store. 8. To store the project, choose Yes. A dialog box tells you that the store is in progress. 9. Choose OK. 10. Wait until the OK LED on the front of the controller is steady green. This indicates that the store is finished. 11. Disconnect the battery from the controller. 12. Cycle the power to the chassis. 13. Re-connect the battery to the controller. 14. Go online with the controller. The Connected To Go Online dialog box opens. 15. Click the Nonvolatile Memory tab.
16.
42865
19-12
42874
17.
17. Choose < Store. A dialog box asks you to confirm the store. 18. To store the project, choose Yes. During the store, the following events occur: On the front of the controller, the OK LED displays the following sequence: flashing green red green RSLogix 5000 software goes offline. A dialog box tells you that the store is in progress. 19. Choose OK. When the store is finished, you remain offline. If you want to be online, you must manually go online.
Chapter
20
Secure a Project
Use this procedure to control who has access to your project. To secure a project, these options are available:
If you want to: Prevent others from seeing the logic within one or more routines of a project Assign varying levels of access to a project, such as let: engineers have full access maintenance personal make limited changes operators only view logic and data Then: Use Routine Source Protection Use RSI Security Server to Protect a Project See page: 20-1 20-9
To limit who has access to a routine, use the RSLogix 5000 Source Protection tool to assign a source key to the routine. Once you assign a source key, a computer requires the source key to perform the following actions: open (display) the routine edit the routine change the properties of the routine search the routine go to cross references within the routine print the routine export the routine
Regardless of whether or not the source key is available, you can always download the project and execute all the routines.
20-2
Secure a Project
If a routine is grayed-out, a source key protects the routine. If you double-click the routine, the status line displays "Source not available." To open the routine, your computer requires the source key for the routine.
42581
IMPORTANT
If the source of a routine is unavailable, do not export the project. An export file (.L5K) contains only routines where the source code is available. If you export a project where the source code is not available for all routines, you will not be able to restore the entire project.
To assign and manage source keys: Install the RSLogix 5000 Source Protection Software Create a File for the Source Keys Protect a Routine with a Source Key Remove Access to a Protected Routine Gain Access to a Protected Routine
Secure a Project
20-3
language is the language of your software. For example, for software that is in English, open the ENU folder.
3. Which revision of RSLogix 5000 software are you using?
If: 9.00 or earlier Then: Copy the SP.exe file to this folder:
Program Files
Rockwell Software
RSLogix 5000
+
10.00 or later
Bin
Program Files
Rockwell Software
RSLogix 5000
language
version
+
Where:
language
Bin
Is the: language of your software. For example, for software that is in English, open the ENU folder. version of your software, such as v10
version
20-4
Secure a Project
2.
43060
2. Does the status line show the location of the sk.dat file?
If: Yes No Then: Your computer already has the source key file. Go to Protect a Routine with a Source Key on page 20-5. Go to step 3.
3. From the Edit menu, choose Specify Source Key File Location.
4. 6.
43061
4. Click 5. Select a folder in which to store the file and choose OK. 6. Choose OK. A dialog box asks if you want to create the source key file (sk.dat). 7. Choose Yes.
Secure a Project
20-5
43062
The status line shows the location of the source key file (sk.dat).
4.
43058
4. Select the routine or routines that you want to protect. 5. From the Edit menu, choose Protect Routines With Source Key.
20-6
Secure a Project
7. 6.
43059
6. Type a name that you want to use as the source key. Source keys follow the same rules for names as other RSLogix 5000 components, such as routines, tags, and modules. 7. Choose OK. 8. From the File menu, choose Save. 9. When you have assigned the required source keys to the project, close the RSLogix 5000 Source Protection software.
1. Open the RSLogix 5000 Source Protection software (SP.exe). 2. If the RSLogix 5000 Source Protection software was already open, close any open project in the tool. 3. From the Edit menu, choose Remove Source Key File Location. A dialog box asks if you want to delete the source key file (sk.dat). 4. Choose Yes.
Secure a Project
20-7
2.
43060
3. From the Edit menu, choose Specify Source Key File Location.
4. 6.
43061
4. Click 5. Select a folder in which to store the file and choose OK. 6. Choose OK. A dialog box asks if you want to create the source key file (sk.dat). 7. Choose Yes.
20-8
Secure a Project
8. From the Edit menu, choose View Source Key File. If you are prompted to select a program with which to open the file, select a word processing program, such as Notepad. The sk.dat file opens. 9. Type the name of the source key. To enter multiple keys, type each key on a separate line.
sk.dat - Notepad key1 key2 key3
Secure a Project
20-9
RSI Security Server software lets you control the access that individuals have to RSLogix 5000 projects. With this software, you customize access to projects based on the: user that is currently logged into the workstation RSLogix 5000 project that the user is accessing workstation from which the user is accessing the RSLogix 5000 project Before you use Security Server software for RSLogix 5000 projects, set up the software: Install RSI Security Server Software Set Up DCOM Enable Security Server for RSLogix 5000 Software Import the RSLogix5000Security.bak File Define the Global Actions for Your Users Define the Project Actions for Your Users Add Users Add User Groups Assign Global Access to RSLogix 5000 Software Assign Project Actions for New RSLogix 5000 Projects
Once Security Server software is set up for RSLogix 5000 projects, complete the following actions to protect a project: Secure an RSLogix 5000 Project Assign Access to an RSLogix 5000 Project Refresh RSLogix 5000 Software, If Needed
See Getting Results with Rockwell Softwares Security Server (Standalone Edition), which ships with the RSI Security Server software.
20-10
Secure a Project
Set Up DCOM
See Getting Results with Rockwell Softwares Security Server (Standalone Edition), which ships with the RSI Security Server software.
Program Files
Keys.ini SetSecKeys.exe
Rockwell Software
RSLogix 5000
language
version
Security
Where:
language version
Is the: language of your software. For example, for software that is in English, open the ENU folder. version of your software, such as v10
The Locate Project File dialog box opens. By default, the Keys.ini file should already be selected. 2. Choose Open.
Secure a Project
20-11
Program Files
Rockwell Software
RSLogix 5000
language
version
+
Where:
language
Security
Is the: language of your software. For example, for software that is in English, open the ENU folder. version of your software, such as v10
version
2.01
Program Files
Rockwell Software
Security Server
System
20-12
Secure a Project
Table 20.1 Global Actions To let a user: secure any unsecured controller create a new RSLogix 5000 project open an .L5K file in RSLogix 5000 software, which creates a project translate a PLC or SLC project to an .L5K file use RSLogix 5000 software to start ControlFLASH software and update the firmware of a controller Update Firmware Then grant access to the following actions: Secure Controller New Project
Use the following worksheet to record the global actions that you will permit each group of users to perform.
Table 20.2 Global actions for each group of users This group of users: Requires this access: Secure Controller New Project Update Firmware
Secure a Project
20-13
43075
43078
20-14
Secure a Project
The following actions apply to a secured RSLogix 5000 project or group of projects.
Table 20.3 Project Actions To let a user: open a project offline copy components from a project export the tags of a project And: go online and monitor a project And: Grant this action: View Project Go Online perform all actions available through RSLogix 5000 software except unsecure a secured controller unsecure a secured controller save a project save a project as a different .ACD file open an older revision of a project compact a project export a project download or upload a project change the mode of the controller change the path to the controller print a report clear faults change the wall clock time create, delete, edit, and run a trend change the configuration of an I/O module change the configuration of a MSG instruction enter, enable, disable, and remove forces change tag values update firmware Maintain Project
Full Access
Secure a Project
20-15
Use the worksheet on page 20-15 to record the project actions that you will permit each user or group of users to perform.
Table 20.4 Project actions for projects that are in the New RSLogix 5000 Resources group and for individual projects For this project or group of projects: New RSLogix 5000 Resources New RSLogix 5000 Resources New RSLogix 5000 Resources New RSLogix 5000 Resources This user or group of users: Requires this access: View Project Go Online Maintain Project Full Access Unsecure Controller Update Firmware
20-16
Secure a Project
Add Users
43084
2. Type the information for the user and then choose OK.
43074
Secure a Project
20-17
3. Follow the steps for this task. Assign the actions that you recorded on Table 20.2 on page 20-12.
43076
20-18
Secure a Project
1. In the Configuration explorer, select the New RSLogix 5000 Resources group.
43075
3. Follow the steps for this task. Assign the actions that you recorded on Table 20.4 on page 20-15.
43076
Secure a Project
20-19
4. Select RSI Security Server. 5. Choose OK and then Yes. In the Security Server software, the project appears as a member of the New RSLogix 5000 Resources group. If Security Server software is already open, then from its View menu, choose Refresh.
20-20
Secure a Project
1. In the Configuration explorer, select the New RSLogix 5000 Resources group.
43075
3.
43079
3. In the Member items list, select the project and click the << button. 4. Choose Apply.
7. Follow the steps for this task. Assign the actions that you recorded on Table 20.4 on page 20-15.
43076
Secure a Project
20-21
20-22
Secure a Project
Notes:
Appendix
Fault Codes
Use this appendix to interpret: Major Fault Codes Minor Fault Codes
Use the following table to determine the cause and corrective action for a major fault. The type and code correspond to the type and code displayed in these locations: Controller Properties dialog box, Major Faults tab PROGRAM object, MAJORFAULTRECORD attribute
Table A.1 Major Fault Types and Codes Type: 1 3 Code: 1 16 Cause: The controller powered on in Run mode. A required I/O module connection failed. Recovery Method: Execute the power-loss handler. Check that the I/O module is in the chassis. Check electronic keying requirements. View the controller properties Major Fault tab and the module properties Connection tab for more information about the fault. Not recoverable - replace the chassis. Wait for the controller I/O light to turn green before changing to Run mode. Remove the unknown instruction. This probably happened due to a program conversion process. Adjust the value to be within the valid range. Dont exceed the array size or go beyond dimensions defined. Adjust the value so it is > 0. Pass the appropriate number of parameters. If too many parameters are passed, the extra ones are ignored without any error. Fix the program to not load a negative value into timer preset or accumulated value. Correct the JMP target or add the missing label. Modify value to be within limits. Reduce the subroutine nesting levels or the number of parameters passed.
3 3 4 4 4 4
20 23 16 20 21 31
Possible problem with the ControlBus chassis. At least one required connection was not established before going to Run mode. Unknown instruction encountered. Array subscript too big, control structure .POS or .LEN is invalid. Control structure .LEN or .POS < 0. The parameters of the JSR instruction do not match those of the associated SBR or RET instruction. A timer instruction has a negative preset or accumulated value. JMP to a label that did not exist or was deleted. The data tested was not inside the required limits. Stack overflow.
4 4 4 4
34 42 83 84
A-2
Fault Codes
Table A.1 Major Fault Types and Codes (Continued) Type: 6 Code: 1 Cause: Recovery Method:
Task watchdog expired. Increase the task watchdog, shorten the execution time, make the User task has not completed in specified period priority of this task higher, simplify higher priority tasks, or move of time. A program error caused an infinite loop, some code to another controller. or the program is too complex to execute as quickly as specified, or a higher priority task is keeping this task from finishing. Store to nonvolatile memory failed. 1. Try again to store the project to nonvolatile memory. 2. If the project fails to store to nonvolatile memory, replace the memory board. Update the controller firmware to the same revision level as the project that is in nonvolatile memory.
40
42
Load from nonvolatile memory failed because the firmware revision of the project in nonvolatile memory does not match the firmware revision of the controller.
8 11 11 11 11 11 11 11
1 1 2 3 4 5 6 7
Attempted to place controller in Run mode with Wait for the download to complete and clear fault. keyswitch during download. Actual position has exceeded positive overtravel limit. Actual position has exceeded negative overtravel limit. Actual position has exceeded position error tolerance. Move axis in negative direction until position is within overtravel limit and then execute Motion Axis Fault Reset. Move axis in positive direction until position is within overtravel limit and then execute Motion Axis Fault Reset. Move the position within tolerance and then execute Motion Axis Fault Reset.
Encoder channel A, B, or Z connection is broken. Reconnect the encoder channel then execute Motion Axis Fault Reset. Encoder noise event detected or the encoder signals are not in quadrature. Drive Fault input was activated. Synchronous connection incurred a failure. Fix encoder cabling then execute Motion Axis Fault Reset. Clear Drive Fault then execute Motion Axis Fault Reset. First execute Motion Axis Fault Reset. If that doesnt work, pull servo module out and plug back in. If all else fails replace servo module. Replace the module. First execute Motion Axis Fault Reset. If that doesnt work, pull servo module out and plug back in. If all else fails replace servo module. The groups course update rate is too high to maintain correct operation. Clear the group fault tag, raise the groups update rate, and then clear the major fault.
11 11
8 9
Servo module has detected a serious hardware fault. Asynchronous Connection has incurred a failure. The motion task has experienced an overlap.
11
32
Fault Codes
A-3
Use the following table to determine the cause and corrective action for a minor fault. The type and code correspond to the type and code displayed in these locations: Controller Properties dialog box, Minor Faults tab PROGRAM object, MINORFAULTRECORD attribute
Table A.2 Minor Fault Types and Codes Type: 4 4 4 4 4 Code: 4 7 35 36 51 Cause: An arithmetic overflow occurred in an instruction. The GSV/SSV destination tag was too small to hold all of the data. PID delta time 0. PID setpoint out of range The LEN value of the string tag is greater than the DATA size of the string tag. Recovery Method: Fix program by examining arithmetic operations (order) or adjusting values. Fix the destination so it has enough space. Adjust the PID delta time so that it is > 0. Adjust the setpoint so that it is within range. 1. Check that no instruction is writing to the LEN member of the string tag. 2. In the LEN value, enter the number of characters that the string contains. Create a new string data type that is large enough for the output string. Use the new string data type as the data type for the destination. Either: Reduce the size of the ASCII value. Use a larger data type for the destination. 1. Check that the Start value is between 1 and the DATA size of the Source. 2. Check that the Start value plus the Quantity value is less than or equal to the DATA size of the Source.
52
53
The output number is beyond the limits of the destination data type. The Start or Quantity value is invalid.
56
57
The AHL instruction failed to execute because the serial Either: port is set to no handshaking. Change the Control Line setting of the serial port. Delete the AHL instruction. Periodic task overlap. Periodic task has not completed before it is time to execute again. Project loaded from nonvolatile memory. Unknown error while servicing the serial port. Contact GTS personnel. The CTS line is not correct for the current configuration. Disconnect and reconnect the serial port cable to the controller. Make sure the cable is wired correctly Simplify program(s), or lengthen period, or raise relative priority, etc.
7 9 9
49 0 1
A-4
Fault Codes
Table A.2 Minor Fault Types and Codes (Continued) Type: 9 Code: 2 Cause: Poll list error. A problem was detected with the DF1 masters poll list, such as specifying more stations than the size of the file, specifying more then 255 stations, trying to index past the end of the list, or polling the broadcast address (STN #255). Recovery Method: Check for the following errors in the poll list: total number of stations is greater than the space in the poll list tag total number of stations is greater than 255 current station pointer is greater than the end of the poll list tag a station number greater than 254 was encountered
DF1 slave poll timeout. Determine and correct delay for polling. The poll watchdog has timed out for slave. The master has not polled this controller in the specified amount of time. Modem contact was lost. DCD and/or DSR control lines are not being received in proper sequence and/or state. Battery not detected or needs to be replaced. Correct modem connection to the controller.
10
10
Appendix
IEC61131-3 Compliance
Introduction
The International Electrotechnical Commission (IEC) has developed a series of specifications for programmable controllers. These specifications are intended to promote international unification of equipment and programming languages for use in the controls industry. These standards provide the foundation for Logix5000 controllers and RSLogix 5000 programming software. The IEC programmable controller specification is broken down into five separate parts each focusing on a different aspect of the control system: Part Part Part Part Part 1: 2: 3: 4: 5: General Information Equipment and Requirements Test Programming Languages User Guidelines Messaging Service Specification
The controls industry as a whole has focused on part 3 (IEC61131-3), Programming Languages, because it provides the cornerstone for implementing the other standards and provides the most significant end user benefit by reducing training cost. Because of this, only IEC61131-3 is addressed here.
B-2
IEC61131-3 Compliance
The IEC61131-3 programming language specification addresses numerous aspects of programmable controller including the operating system execution, data definitions, programming languages, and instruction set. Components of the IEC61131-3 specification are categorized as required by the specification, optional or extensions. By so doing, the IEC61131-3 specification provides a minimum set of functionality that can be extended to meet end user application needs. The downside of this approach is that each programmable control system vendor may implement different components of the specification or provide different extensions.
Operating System
The preemptive, multitasking operating system (OS) of Logix5000 controllers complies with the IEC61131-3 definition. In IEC61131-3, the programmable controllers OS can contain zero or more tasks, that can execute one or more programs each containing one or more functions or routines. According to IEC61131-3, the number of each of these components is implementation dependent. Logix5000 controllers provide multiple tasks, each containing multiple programs and an unlimited number of functions or routines. IEC61131-3 provides an option for creating different task execution classifications. Tasks may be configured as continuous, periodic, or event based. A continuous task does not need to be scheduled in that it will utilize any left over processing time when other tasks are dormant. Periodic tasks are scheduled to operate based on a reoccurring time period. The IEC61131-3 specification does not specify a time base for periodic task configuration. An IEC61131-3 event based task is triggered upon detection of the rising edge of a configured input. Logix5000 controllers support both continuous and periodic tasks. Additionally, the period for a periodic task is configurable starting as low as 1 millisecond (ms).
Data Definitions
The IEC61131-3 specification provides access to memory through the creation of named variables. IEC61131-3 names for variables consist of a minimum of six characters (RSLogix5000 programming software supports a minimum of 1 character) starting with an underscore "_" or an alpha character (A-Z), followed by one or more characters consisting of an underscore "_", alpha character (A-Z) or a number (0-9). Optionally, lower case alpha characters (a-z) can be supported as long as they are case insensitive (A = a, B = b, C = c ). Logix5000 controllers provide full compliance with this definition, support the lower case option, and extend the name to support up to 40 character names.
IEC61131-3 Compliance
B-3
Data variables in IEC61131-3 may be defined such that they are accessible to all programs within a resource or controller, or limited access is provided only to the functions or routines within a single program. To pass data between multiple resources or controllers, access paths may be configured to define the location of the data within a system. Logix5000 controllers provide compliance by providing program scoped, controller scoped data and permits the configuration of access paths using produced/consumed data. The memory interpretation of a variable within IEC61131-3 is defined through the use of either an elementary data type or an optional derived data type that is created from a group of multiple data types. Logix5000 controllers support the use of the BOOL (1 bit), SINT (8 bit integer), INT (16 bit integer), DINT (32 bit integer) and REAL (IEEE floating point number) elementary data types. Additionally, the optional derived data types are supported through the creation of user defined structures and arrays.
Programming Languages
The IEC61131-3 specification defines five (5) different programming languages and a set of common elements. All languages are defined as optional but at least one must be supported in order to claim compliance with the specification. The IEC61131-3 programming language components are defined as follows: Common Language Elements Common Graphical Elements Instruction List (IL) Language Elements Structured Text Language (ST) Elements Ladder Diagram (LD) Language Elements Sequential Function Chart (SFC) Language Elements Function Block Diagram (FBD) Language Elements
Logix5000 controllers and RSLogix5000 provide support for the common language elements and the Ladder Diagram and Function Block Diagram language options. Additionally, the environment utilizes an ASCII import/export format based on the Structured Text language. The instruction set and program file exchange features are discussed in detail in the sections that follow.
B-4
IEC61131-3 Compliance
Instruction Set
The instruction set specified by IEC61131-3 is entirely optional. The specification lists a limited set of instructions that if implemented must conform to the stated execution and visual representation. IEC61131-3 however, does not limit the instructions set to those listed within the specification. Each PLC vendor is free to implement additional functionality in the form of instructions over and above those listed by the specification. Examples of such extended instructions are those needed to perform diagnostics, PID loop control, motion control and data file manipulation. Because extended instructions are not defined by the IEC61131-3 specification, there is no guarantee that the implementation between different PLC vendors will be compatible. Thus utilization of these instructions may preclude the movement of logic between vendors. Logix5000 controllers and RSLogix5000 provide a suite of instructions that execute as defined by the IEC61131-3 specification. The physical representation of these instructions maintain their look and feel with existing systems so as to reduce the training cost associated with working with the environment. In addition to the IEC61131-3 compliant instructions, a full range of instructions from existing products have been brought forward into the environment so that no functionality is lost.
One of the goals of end-users creating programs in an IEC61131-3 compliant environment is the movement or portability of programs between controllers developed by different vendors. This area is a weakness of IEC61131-3 because no file exchange format is defined by the specification. This means that if any program created in one vendors environment will require manipulation to move it to another vendors system. In order to minimize the effort involved in performing cross-vendor portability, the RSLogix 5000 programming software for the controllers includes a full ASCII export and import utility. Additionally, the file format that is utilized by this tool is based on a hybrid of the IEC61131-3 Structured Text language definition. Controller operating system and data definitions follow the appropriate IEC61131-3 formats. Extensions were implemented in order to convert Ladder Diagram logic into ASCII text since this is not defined by IEC61131-3. For more information on the ASCII export and import utility of RSLogix 5000 programming software, see the Logix5000 Controllers Import/Export Reference Manual, publication 1756-RM084.
IEC61131-3 Compliance
B-5
Logix5000 controllers and RSLogix5000 comply with the requirements of IEC61131-3 for the following language features:
Feature Description: Lower case letters Number sign (#) Dollar sign ($) Subscript delimiters ([ ]) Identifiers using upper case and numbers Identifiers using upper case, numbers, and embedded underlines Identifiers using upper and lower case, numbers and embedded underlines Integer literal Real literal Real literal with exponents Base 2 literal Base 8 literal Base 16 literal Boolean zero and one Empty String String of length one containing a character A String of length one containing a space String of length one containing a single quote character '$ String dollar sign '$$' String single quote '$'' String Line Feed '$L' or '$l' String New-line '$N' or '$n' String From Feed (page) '$P' or '$p' String Carriage return '$R' or '$r' String Tab '$T' or '$t' BOOL Data Type SINT Data Type INT Data Type DINT Data Type REAL Data Type Time Extensions and Implementation Notes: none Used for immediate value data type designation Used for description and string control character Array subscripts Task, program, routine, structure and tag names Task, program, routine, structure and tag names Task, program, routine, structure and tag names 12, 0, -12 12.5, -12.5 -1.34E-12, 1.234E6 2#0101_0101 8#377 16#FFE0 0, 1 Descriptions Descriptions Descriptions Descriptions Descriptions Descriptions Descriptions Descriptions Descriptions Descriptions Descriptions Tag variable definition Tag variable definition Tag variable definition Tag variable definition Tag variable definition Tag variable definition, TIMER Structure
B-6
IEC61131-3 Compliance
Table Number:(1) 10 11 12 12 12 13 13 13 13 14 14 14 14 20 20 20 20 21 22
Feature Number: 16 1 1 4 5 1 4 5 9 1 4 5 6 1 2 3 4 1 1
Feature Description: STRING data type Data type Hierarchy Direct Derivation from elementary types Array data types Structured Data types BOOL, SINT, INT, DINT initial value of 0 REAL, LREAL initial value of 0.0 Time initial value of T#0s Empty String Initialization of directly derived types Initialization of array data types Initialization of structured type elements Initialization of derived structured data types Use of EN and ENO Usage without EN and ENO Usage with EN and without ENO Usage without EN and with ENO Overloaded functions ADD(INT, DINT) or ADD(DINT, REAL) _TO_ conversion function
Extensions and Implementation Notes: none none User Defined data type structures Tag variable definition User defined data type structures Tag variable definition Tag variable definition Tag variable definition, reset (RES) instruction Descriptions Import/export Import/export Import/export Import/export Function present in ladder but not labeled. Available in FBD. Available in FBD Available in FBD Available in FBD All overloaded types that are supported are documented with each instruction RAD, DEG instructions Radians to/from Decimal. Others not needed because of instruction overloading TRN instruction FRD instruction TOD instruction ABS instruction SQR instruction LN instruction LOG instruction SIN instruction COS instruction TAN instruction ASN instruction ACS instruction ATN instruction ADD instruction
22 22 22 23 23 23 23 23 23 23 23 23 23 24
2 3 4 1 2 3 4 6 7 8 9 10 11 12
Truncate conversion function BCD to INT Convert INT to BCD Convert Absolute value Square root Natural log Log base 10 Sine in radians Cosine in radians Tangent in radians Principal arc sine Principal arc cosine Principal arc tangent Arithmetic add
IEC61131-3 Compliance
B-7
Table Number:(1) 24 24 24 24 24 24 25 25 25 25 26 26 26 26 27 27 27 27 27 28 28 28 28 28 28 29 29 29 29 29 29 32
Feature Number: 13 14 15 16 17 18 1 2 3 4 5 6 7 8 1 2a 2b 3 4 5 6 7 8 9 10 1 4 5 6 7 9 1
Feature Description: Arithmetic multiplication Arithmetic subtraction Arithmetic divide Modulo Exponentiation Value move Bit shift left Bit shift right Bit rotate left Bit rotate right AND OR XOR NOT Select Maximum select Minimum select High/Low limit Multiplexer Comparison greater-than Comparison greater-than or equal Comparison equal Comparison less-than Comparison less-than or equal Comparison not equal String length Middle string String concatenation String insert String delete Find string Input read
Extensions and Implementation Notes: MUL instruction SUB instruction DIV instruction MOD instruction XPY instruction MOV instruction in ladder Functionality contained in BSL instruction in Ladder for shift of 1 Functionality contained in BSR instruction in Ladder for shift of 1 Functionality contained in BSL instruction in Ladder for shift of 1 Functionality contained in BSR instruction in Ladder for shift of 1 BAND instruction in FBD BOR instruction in FBD BXOR instruction in FBD BNOT instruction in FBD SEL instruction in FBD Functionality contained in ESEL instruction in FBD Functionality contained in ESEL instruction in FBD HLL instruction in FBD MUX instruction in FBD GRT instruction GRE instruction EQU instruction LES instruction LEQ instruction NEQ instruction Contained as parameter of STRING data type MID instruction in ladder CONCAT instruction in ladder INSERT instruction in ladder DELETE instruction in ladder FIND instruction in ladder FBD editor
B-8
IEC61131-3 Compliance
Table Number:(1) 32 32 32 34 34 35 35 36
Feature Number: 2 3 4 1 2 1 2 1b
Feature Description: Input write Output read Output write Bistable set dominant Bistable reset dominant Rising edge detector Falling edge detector Up-counter
Extensions and Implementation Notes: FBD editor FBD editor FBD editor SETD instruction in FBD RESD instruction in FBD OSR instruction in ladder and OSRI instruction in FBD OSF instruction in ladder and OSFI instruction in FBD Functionality contained in CTU and RES instructions in ladder and in CTUD instruction in FBD Functionality contained in TON instruction in ladder and TONR instruction in FBD Functionality contained in TOF instruction in ladder and TOFR instruction in FBD Functionality contained in TON instruction in ladder and TONR instruction in FBD Functionality contained in TOF instruction in ladder and TOFR instruction in FBD Ladder editor, FBD editor Ladder editor, FBD editor Ladder editor, FBD editor Ladder editor, FBD editor Ladder editor, FBD editor FBD editor FBD editor JMP instruction in ladder LBL instruction in ladder JMP instruction in ladder RET instruction in ladder RET instruction in ladder Ladder editor Ladder editor Ladder editor Ladder editor XIC instruction in ladder XIO instruction in ladder ONS instruction in ladder
37 37 38 38 57 57 57 57 57 57 57 58 58 58 58 58 59 59 60 60 61 61 61
On-delay timer Off-delay timer On-delay timing Off-delay timing Horizontal line Vertical line Horizontal / Vertical connection Connection and non-connection corners Blocks with connections Line crossings without connection Connectors Unconditional jump Jump target Conditional jump Conditional return Unconditional return Left hand power rail Right hand power rail Horizontal link Vertical link Normally open contact --| |-Normally close contact --| / |-Positive transition sensing contact -| P |-
IEC61131-3 Compliance
B-9
Table Number:(1) 62 62 62 62 62
(1)Table
Feature Number: 1 3 4 8 9
Feature Description: Coil --( )-Set (latch) coil Reset (unlatch) coil Positive transition sensing coil Negative transition sensing coil
Extensions and Implementation Notes: OTE instruction in ladder Functionality contained in OTL instruction in ladder Functionality contained in OTU instruction in ladder OSR instruction in ladder OSF instruction in ladder
associated with languages other than ladder diagram and function block diagram have been skipped.
B-10
IEC61131-3 Compliance
Notes:
Glossary
alias tag A tag that references another tag. An alias tag can refer to another alias tag or a base tag. An alias tag can also refer to a component of another tag by referencing a member of a structure, an array element, or a bit within a tag or member. See base tag. ASCII A 7-bit code (with an optional parity bit) that is used to represent alphanumerical characters, punctuation marks, and control-code characters. For a list of ASCII codes, see the back cover of this manual. asynchronous Actions that occur independent of each other and lack a regular pattern. In Logix5000 controllers, I/O values update asynchronous to the execution of logic.: Programs within a task access input and output data directly from controller-scoped memory. Logic within any task can modify controller-scoped data. Data and I/O values are asynchronous and can change during the course of a tasks execution. An input value referenced at the beginning of a tasks execution can be different when referenced later. Take care to ensure that data memory contains the appropriate values throughout a tasks execution. You can duplicate or buffer data at the beginning of the scan to provide reference values for your logic.
ATTENTION
Glossary
array An array lets you group data (of the same data type) under a common name. An array is similar to a file. A subscript (s) identifies each individual element within the array. A subscript starts at 0 and extends to the number of elements minus 1 (zero based).
To expand an array and display its elements, click the + sign.
To collapse an array and hide its elements, click the sign. elements of timer_presets
This array contains six elements of the DINT data type. six DINTs
42367
An array tag occupies a contiguous block of memory in the controller, each element in sequence. You can use array and sequencer instructions to manipulate or index through the elements of an array An array can have as many as three dimensions. This gives you the flexibility to identify an element using one, two, or three subscripts (coordinates).
Glossary
In an array with two or three dimensions, the right-most dimension increments first in memory.
This array contains a two-dimensional grid of elements, six elements by six elements.
42367
When the right-most dimension starts over, the dimension to the left increments by one.
The right-most dimension increments to its maximum value then starts over.
Glossary
The total number of elements in an array is the product of each dimensions size, as depicted in the following examples:
This array: one dimension Stores data like: For example: Tag name: Type DINT[7] Dimension 0 7 Dimension 1 -Dimension 2 --
one_d_array
total number of elements = 7 valid subscript range DINT[x] where x=06 two dimension Tag name: Type DINT[4,5] Dimension 0 4 Dimension 1 5 Dimension 2 --
two_d_array
total number of elements = 4 5 = 20 valid subscript range DINT[x,y] where x=03; y=04 three dimension Tag name: Type Dimension 0 Dimension 1 3 Dimension 2 4
three_d_array
DINT[2,3,4] 2
total number of elements = 2 3 4 = 24 valid subscript range DINT[x,y,z] where x=01; y=02, z=03
You can modify array dimensions when programming offline without loss of tag data. You cannot modify array dimensions when programming online. application The combination of routines, programs, tasks, and I/O configuration used to define the operation of a single controller. See project.
base tag A tag that actually defines the memory where a data element is stored. See alias tag.
Glossary
bidirectional connection A connection in which data flows in both directions: from the originator to the receiver and from the receiver to the originator. See connection, unidirectional connection. binary Integer values displayed and entered in base 2 (each digit represents a single bit). Prefixed with 2#. Padded out to the length of the boolean or integer (1, 8, 16, or 32 bits). When displayed, every group of four digits is separated by an underscore for legibility. See decimal, hexadecimal, octal. bit Binary digit. The smallest unit of memory. Represented by the digits 0 (cleared) and 1 (set). BOOL An data type that stores the state of a single bit, where: 0 equals off 1 equals on branch There is no limit to the number of parallel branch levels that you can enter. The following figure shows a parallel branch with five levels. The main rung is the first branch level, followed by four additional branches.
input instruction
output instruction
Glossary
You can nest branches to as many as 6 levels. The following figure shows a nested branch. The bottom output instruction is on a nested branch that is three levels deep.
input instruction output instruction
cache To leave the connection open after a MSG instruction completes. This is useful if you repeatedly execute the MSG instruction because initiating the connection each time increases scan time. The following table shows which messages use a connection and whether or not you can cache the connection:
This type of message: CIP data table read or write PLC2, PLC3, PLC5, or SLC (all types) Using this communication method: CIP CIP CIP with Source ID DH+ CIP generic block-transfer read or write
1 2
Uses a connection:
1
2
N/A N/A
Only a few target modules require a connection. Consider caching only if the target module requires a connection.
Glossary
Use the following steps to choose a cache option for a message that you can cache. 1. Does your logic change the path of a message? (I.e., Does one MSG instruction communicate with more than one device?)
If: Yes No Then: A. Clear the Cache Connection check box. B. Skip step 2. Go to step 2.
2. How many controllers does this controller send messages to that you can cache?
If: 16 or less controllers more than 16 controllers Then: Leave the Cache Connection check box selected (checked). A. Select16 controllers that require the most frequent messages. B. Is this message to one of those controllers? If: Yes No Then Leave the Cache Connection check box checked. Clear the Cache Connection check box.
See connection, uncached connection. change of state (COS) Any change in the status of a point or group of points on an I/O module. CIP See Control and Information Protocol. communication format Defines how an I/O module communicates with the controller. Choosing a communication format defines: what configuration tabs are available through the programming software the tag structure and configuration method
Glossary
compatible module An electronic keying protection mode that requires that the vendor, catalog number, and major revision attributes of the physical module and the module configured in the software match in order to establish a connection to the module. See disable keying, exact match. connection The communication mechanism from the controller to another module in the control system. The number of connections that a single controller can have is limited. Communications with I/O modules, consumed tags, produced tags, and MSG instructions use connections to transfer data. consumed tag A tag that receives the data that is broadcast by a produced tag over a ControlNet network or ControlLogix backplane. A consumed tag must be: controller scope same data type (including any array dimensions) as the remote tag (produced tag) See produced tag. continuous task The task that runs continuously. The continuous task runs in the background. Any CPU time not allocated to other operations (such as motion, communications, and periodic tasks) is used to execute the programs within the continuous task. The continuous task restarts itself after the last of its programs finishes. A project does not require a continuous task. If used, there can be only one continuous task. All periodic tasks interrupt the continuous task. When you create a project, the default MainTask is the continuous task. You can leave this task as it is, or you can change its properties (name, type, etc.). See periodic task.
Glossary
Control and Information Protocol Messaging protocol used by Allen-Bradleys Logix5000 line of control equipment. Native communications protocol used on the ControlNet network. controller fault handler The controller fault handler is an optional task that executes when the: major fault is not an instruction-execution fault program fault routine: could not clear the major fault faulted does not exist You can create only one program for the controller fault handler. After you create that program, you must configure one routine as the main routine. The controller fault program does not execute a fault routine. If you specify a fault routine for the controller fault program, the controller never executes that routine. You can create additional routines and call them from the main routine. controller scope Data accessible anywhere in the controller. The controller contains a collection of tags that can be referenced by the routines and alias tags in any program, as well as other aliases in the controller scope. See program scope. Coordinated System Time (CST) A 64-bit value that represents the number of microseconds since the CST master controller started counting. The CST value is stored as a DINT[2] array, where: first element stores the lower 32 bits second element stores the upper 32 bits You can use the CST timestamp to compare the relative time between data samples.
Glossary
10
COUNTER Structure data type that contains status and control information for counter instructions
data type A definition of the memory size and layout that will be allocated when you create a tag of that data type. decimal Integer values displayed and entered in base 10. No prefix. Not padded to the length of the integer. See binary, hexadecimal, octal. description Optional text that you can use to further document your application. You can use any printable character, including carriage return, tab, and space. Descriptions do not download to the controller. They remain in the offline project file. Descriptions have these length limitations: For tags, you can use up to 120 characters. For other objects (tasks, programs, modules, etc.), you can use up to 128 characters. dimension Specification of the size of an array. Arrays can have as many as three dimensions. See array. DINT A data type that stores a 32-bit (4-byte) signed integer value (-2,147,483,648 to +2,147,483,647). In Logix5000 controllers, use DINTs for integers: Logix5000 controllers execute more efficiently and use less memory when working with 32-bit integers (DINTs) instead of 16-bit integers (INTs) or 8-bit integers (SINTs). Typically, instructions convert SINT or INT values to an optimal data type (usually a DINT or REAL value) during execution. Because this requires additional time and memory, minimize the use of the SINT and INT data types.
Glossary
11
direct An I/O connection where the controller establishes an individual connections with an I/O module. See rack optimized. disable keying An electronic keying protection mode that requires no attributes of the physical module and the module configured in the software to match and still establishes a connection to the module. See compatible module, exact match. download The process of transferring the contents of a project on the workstation into the controller. See upload.
elapsed time The total time required for the execution of all operations configured within a single task. If the controller is configured to run multiple tasks, elapsed time includes any time used/shared by other tasks performing other operations. While online, you can use the Task Properties dialog box to view the maximum scan time and the last scan time in ms for the current task. These values are elapsed time, which includes any time spent waiting for higher-priority tasks. See execution time. electronic keying A feature of the 1756 I/O line where modules can be requested to perform an electronic check to insure that the physical module is consistent with what was configured by the software. Enables the user via the software to prevent incorrect modules or incorrect revisions of modules from being inadvertently used. See compatible module, disable keying, exact match.
Glossary
12
element An addressable unit of data that is a sub-unit of a larger unit of data. A single unit of an array. You specify an element in an array by its subscript(s):
For this array: one dimension two dimension three dimension Specify:
See array. exact match An electronic keying protection mode that requires that all attributes (vendor, catalog number, major revision, and minor revision) of the physical module and the module configured in the software match in order to establish a connection to the module. execution time The total time required for the execution of a single program. Execution time includes only the time used by that single program, and excludes any time shared/used by programs in other tasks performing other operations. When online, use the Program Properties dialog box to view the maximum scan time and the last scan time (in s) for the current program. These values are execution times for the program and do not include any time spent waiting for other programs or higher-priority tasks. See elapsed time. exponential Real values displayed and entered in scientific or exponential format. The number is always displayed with one digit to the left of the decimal point, followed by the decimal portion, and then by an exponent. See style.
Glossary
13
faulted mode The controller generated a major fault, could not clear the fault, and has shut down. See major fault. float Real values displayed and entered in floating point format. The number of digits to the left of the decimal point varies according to the magnitude of the number. See style.
hexadecimal Integer values displayed and entered in base 16 (each digit represents four bits). Prefixed with 16#. Padded out to length of the boolean or integer (1, 8, 16, or 32 bits). When displayed, every group of four digits is separated by an underscore for legibility. See binary, decimal, octal.
immediate value An actual 32-bit signed real or integer value. Not a tag that stores a value. index A reference used to specify an element within an array. instruction The controller evaluates ladder instructions based on the rung condition preceding the instruction (rung-condition-in).
input instruction
output instruction
rung-condition-in
rung-condition-out
Glossary
14
Only input instructions affect the rung-condition-in of subsequent instructions on the rung: If the rung-condition-in to an input instruction is true, the controller evaluates the instruction and sets the rung-condition-out to match the results of the evaluation. If the instruction evaluates to true, the rung-condition-out is true. If the instruction evaluates to false, the rung-condition-out is false. An output instruction does not change the rung-condition-out. If the rung-condition-in to an output instruction is true, the rung-condition-out is set to true. If the rung-condition-in to an output instruction is false, the rung-condition-out is set to false. In Logix5000 controllers, you can enter multiple output instructions per rung of logic. You can enter the output instructions: in sequence on the rung (serial) between input instructions, as long as the last instruction on the rung is an output instruction The following example uses more than one output on a rung. Place multiple outputs on a rung
EXAMPLE
When running_seconds.DN turns on, running_hours counts up by one and running_seconds resets.
running_seconds.DN Count Up Counter Preset Accum CTU running_hours 500 0 CU DN running_seconds RES
When machine_on turns on, turns on drill_1_on. When both machine_on and drill[1].part_advance are on, turns on conveyor_on.
machine_on drill_1_on drill[1].part_advance conveyor_on
42362
Glossary
15
INT A data type that stores a 16-bit (2-byte) integer value (-32,768 to +32,767). Minimize your use of this data type: Typically, instructions convert SINT or INT values to an optimal data type (usually a DINT or REAL value) during execution. Because this requires additional time and memory, minimize the use of the SINT and INT data types. interface module (IFM) A pre-wired I/O field wiring arm.
listen-only connection An I/O connection where another controller owns/provides the configuration data for the I/O module. A controller using a listen-only connection does not write configuration data and can only maintain a connection to the I/O module when the owner controller is actively controlling the I/O module. See owner controller. load To copy a project from nonvolatile memory to the user memory (RAM) of the controller. This overwrites any project that is currently in the controller. See nonvolatile memory, store.
main routine The first routine to execute when a program executes. Use the main routine to call (execute) other routines (subroutines).
Glossary
16
major fault A fault condition that is severe enough for the controller to shut down, unless the condition is cleared. When a major fault occurs, the controller: 1. Sets a major fault bit 2. Runs user-supplied fault logic, if it exists 3. If the user-supplied fault logic cannot clear the fault, the controller goes to faulted mode 4. Sets outputs according to their output state during program mode 5. OK LED flashes red The controller supports two levels for handling major faults: program fault routine: Each program can have its own fault routine. The controller executes the programs fault routine when an instruction fault occurs. If the programs fault routine does not clear the fault or a program fault routine does not exist, the controller proceeds to execute the controller fault handler (if defined). controller fault handler: If the controller fault handler does not exist or cannot clear the major fault, the controller enters faulted mode and shuts down. At this point, the FAULTLOG is updated. (See the next page.) All non-instruction faults (I/O, task watchdog, etc.) execute the controller fault handler directly. (No program fault routine is called.) The fault that was not cleared, and up to two additional faults that have not been cleared, are logged in the controller fault log.
Glossary
17
yes
no
no continue logic execution controller logs major fault to controller fault handler PROGRAM MajorFaultRecord
no
no continue logic execution enter faulted mode record FAULTLOG shut down
Glossary
18
See faulted state, minor fault. major revision The 1756 line of modules have major and minor revision indicators. The major revision is updated any time there is a functional change to the module. See electronic keying, minor revision. master (CST) Within a single chassis, one and only one, controller must be designated as the Coordinated System Time (CST) master. All other modules in the chassis synchronize their CST values to the CST master. member An element of a structure that has its own data type and name. Members can be structures as well, creating nested structure data types. Each member within a structure can be a different data type. To reference a member in a structure, use this format: tag_name.member_name For example:
This address: References the: PRE value of the timer_1 structure.
If the structure is embedded in another structure, use the tag name of the structure at the highest level followed by a substructure tag name and member name: tag_name.substructure_name.member_name For example:
This address: References the:
Glossary
19
If the structure defines an array, use the array tag, followed by the position in the array and any substructure and member names. array_tag[position].member or
array_tag[position].substructure_name.member _name
For example:
This address: References the:
conveyor[10].source conveyor[10].info.height
source member of the 11th element in the conveyor array (array elements are zero based). height member of the info structure in the 11th element of the conveyor array (array elements are zero based).
See structure. memory Electronic storage media built into a controller, used to hold programs and data. minor fault A fault condition that is not severe enough for the controller to shut down:
If this occurs: problem with an instruction The controller: 1. sets S:MINOR 2. logs information about the fault to the PROGRAM object, MinorFaultRecord attribute 3. sets bit 4 of the FAULTLOG object, MinorFaultBits attribute sets bit 6 of the FAULTLOG object, MinorFaultBits attribute sets bit 9 of the FAULTLOG object, MinorFaultBits attribute sets bit 10 of the FAULTLOG object, MinorFaultBits attribute
periodic task overlap problem with the serial port low battery
Glossary
20
To clear minor faults: 1. In the controller organizer, right-click the Controller name_of_controller folder and select Properties. 2. Click the Minor Faults tab. 3. Use the information in the Recent Faults list to correct the cause of the fault. Refer to "Minor Fault Codes" on page A-3. 4. Click the Clear Minors button. See major fault. minor revision The 1756 line of modules have major and minor revision indicators. The minor revision is updated any time there is a change to a module that does not affect its function or interface. See electronic keying, major revision. multicast A mechanism where a module can send data on a network that is simultaneously received by more that one listener. Describes the feature of the ControlLogix I/O line which supports multiple controllers receiving input data from the same I/O module at the same time. multiple owners A configuration setup where more than one controller has exactly the same configuration information to simultaneously own the same input module.
Glossary
21
name Names identify controllers, tasks, programs, tags, modules, etc. Names follow IEC-1131-3 identifier rules and: must begin with an alphabetic character (A-Z or a-z) or an underscore (_) can contain only alphabetic characters, numeric characters, and underscores can have as many as 40 characters must not have consecutive or trailing underscore characters (_) are not case sensitive download to the controller network update time (NUT) The repetitive time interval in which data can be sent on a ControlNet network. The network update time ranges from 2ms-100ms. nonvolatile memory Memory of the controller that retains its contents while the controller is without power or a battery. See load, store.
object A structure of data that stores status information. When you enter a GSV/SSV instruction, you specify the object and its attribute that you want to access. In some cases, there are more than one instance of the same type of object, so you might also have to specify the object name. For example, there can be several tasks in your application. Each task has its own TASK object that you access by the task name. octal Integer values displayed and entered in base 8 (each digit represents three bits). Prefixed with 8#. Padded out to the length of the boolean or integer (1, 8, 16, or 32 bits). When displayed, every group of three digits is separated by an underscore for legibility. See binary, decimal, hexadecimal. offline Viewing and editing a project that is on the hard disk of a workstation. See online.
Glossary
22
online Viewing and editing the project in a controller. See offline. optimal data type A data type that a Logix5000 instruction actually uses (typically the DINT and REAL data types). In the instruction set reference manuals, a bold data type indicates an optimal data type. Instructions execute faster and require less memory if all the operands of the instruction use: the same data type an optimal data type If you mix data types and use tags that are not the optimal data type, the controller converts the data according to these rules Are any of the operands a REAL value?
If: Yes No Then input operands (e.g., source, tag in an expression, limit) convert to: REALs DINTs
After instruction execution, the result (a DINT or REAL value) converts to the destination data type, if necessary. Because the conversion of data takes additional time and memory, you can increase the efficiency of your programs by: using the same data type throughout the instruction minimizing the use of the SINT or INT data types In other words, use all DINT tags or all REAL tags, along with immediate values, in your instructions.
Glossary
23
The following table summarizes how the controller converts data between data types:
Conversion: larger integer to smaller integer Result: The controller truncates the upper portion of the larger integer and generates an overflow. For example: Decimal DINT INT SINT SINT or INT to REAL DINT to REAL 65,665 129 -127 Binary 0000_0000_0000_0001_0000_0000_1000_0001 0000_0000_1000_0001 1000_0001
No data precision is lost Data precision could be lost. Both data types store data in 32 bits, but the REAL type uses some of its 32 bits to store the exponent value. If precision is lost, the controller takes it from the least-significant portion of the DINT. The controller rounds the fractional part and truncates the upper portion of the non-fractional part. If data is lost, the controller sets the overflow status flag. Numbers round as follows: Numbers other than x.5 round to the nearest number. X.5 rounds to the nearest even number. For example: REAL (source) -2.5 -1.6 -1.5 -1.4 1.4 1.5 1.6 2.5 DINT (result) -2 -2 -2 -1 1 2 2 2
REAL to integer
owner controller The controller that creates the primary configuration and communication connection to a module. The owner controller writes configuration data and can establish a connection to the module. See listen-only connection.
Glossary
24
path The path describes the route that a message takes to get to the destination. If the I/O configuration of the controller contains the destination device, use the Browse button to select the device. This automatically defines the path.
peer_controller
I/O Configuration
peer_controller
Glossary
25
If the I/O configuration does not contain the destination device, then type the path to the destination using the following format:
port,address,port,address
Where: For this: backplane from any 1756 controller or module DF1 port from a Logix5000 controller ControlNet port from a 1756-CNB module Ethernet port from a 1756-ENBx or -ENET module DH+ port over channel A from a 1756-DHRIO module DH+ port over channel B from a 1756-DHRIO module 3 slot number station address (0-254) node number (1-99 decimal) 8# followed by the node number (1-77 octal) For example, to specify the octal node address of 37, type 8#37. You can specify a module on an EtherNet/IP network using any of these formats: IP address IP address:Port DNS name DNS name:Port (e.g., 130.130.130.5) (e.g., 130.130.130.5:24) (e.g., tanks) (e.g., tanks:24) ControlLogix backplane DF1 network ControlNet network DH+ network Is: 1 2
port
address
EtherNet/IP network
See connection. periodic task A task that is triggered by the operating system at a repetitive period of time. Use a periodic task for functions that require accurate or deterministic execution. Whenever the time expires, the task is triggered and its programs are executed. Data and outputs established by the programs in the task retain their values until the next execution of the task or they are manipulated by another task.
Glossary
26
You can configure the time period from 1 ms to 2000 s. The default is 10 ms. Ensure that the time period is longer than the sum of the execution times of all the programs assigned to the task. If the controller detects that a periodic task trigger occurs for a task that is already operating, a minor fault occurs.
ATTENTION
Periodic tasks always interrupt the continuous task. Depending on the priority level, a periodic task may interrupt other periodic tasks in the controller. See continuous task. periodic task overlap A condition that occurs when a task is executing and the same task is triggered again. The execution time of the task is greater than the periodic rate configured for the task. See periodic task. predefined structure A structure data type that stores related information for a specific instruction, such as the TIMER structure for timer instructions. Predefined structures are always available, regardless of the system hardware configuration. See product defined structure. prescan Prescan is an intermediate scan during the transition to Run mode. The controller performs prescan when you change from Program mode to Run mode. The prescan examines all programs and instructions and initializes data based on the results. Some instructions execute differently during prescan than they do during the normal scan.
Glossary
27
priority Specifies which task to execute first if two tasks are triggered at the same time. The task with the higher priority executes first. Priorities range from 1-15, with 1 being the highest priority. A higher priority task will interrupt any lower priority task. If two tasks with the same priority are triggered at the same time, the controller switches between the tasks every millisecond.
postscan A function of the controller where the logic within a program is examined before disabling the program in order reset instructions and data. power-up handler An optional task that executes when the controller powers up in the Run mode. To use the Power-Up Handler, you must create a power-up program and associated main routine.
42195
Glossary
28
Did the controller power up in Run mode? Yes Does the Power-Up Handler contain a program? Yes Major fault, type 1, code 1, occurs.
No
No
Yes
produced tag A tag that a controller is making available for use by other controllers. Produced tags are always at controller scope. See consumed tag. product defined structure A structure data type that is automatically defined by the software and controller. By configuring an I/O module you add the product defined structure for that module.
Glossary
29
program A set of related routines and tags. Each program contains program tags, a main executable routine, other routines, and an optional fault routine. To execute the routines in a program, you assign (schedule) the program to a task: When a task is triggered, the scheduled programs within the task execute to completion from first to last. When a task executes a program, the main routine of the program executes first. The main routine can, in turn, execute subroutines using the JSR instruction. The Unscheduled Programs folder contains programs that arent assigned to a task. If the logic in the program produces a major fault, execution jumps to a configured fault routine for the program. The routines within a program can access the following tags: program tags of the program controller tags Routines cannot access the program tags of other programs. See routine, task. program scope Data accessible only within the current program. Each program contains a collection of tags that can only be referenced by the routines and alias tags in that program. See controller scope. project file The file on your workstation (or server) that stores the logic, configuration, data, and documentation for a controller. The project file has an .ACD extension. When you create a project file, the file name is the name of the controller. The controller name is independent of the project file name. If you save a current project file as another name, the controller name is unchanged. If the name of the controller is different than the name of the project file, the title bar of the RSLogix 5000 software displays both names. See application.
Publication 1756-PM001D-EN-P - November 2001
Glossary
30
rack optimized An I/O connection where the 1756-CNB module collects digital I/O words into a rack image (similar to 1771-ASB). A rack optimized connection conserves ControlNet connections and bandwidth, however, limited status and diagnostic information is available when using this connection type. See direct. rate For a periodic task, the rate at which the controller executes the task, from 1 ms to 2,000,000 ms (2000 seconds). The default is 10 ms. REAL A data type that stores a 32-bit (4-byte) IEEE floating-point value, with the following range: -3.402823E38 to -1.1754944E-38 (negative values) 0 1.1754944E-38 to 3.402823E38 (positive values) The REAL data type also stores infinity and NAN, but the software display differs based on the display format.
Display Format: Real Equivalent: +infinite - infinite +NAN -NAN +infinite - infinite +NAN -NAN 1.$ -1.$ 1.#QNAN -1.#QNAN 1.#INF000e+000 -1.#INF000e+000 1.#QNAN00e+000 -1.#QNAN00e+000
Exponential
removal and insertion under power (RIUP) A ControlLogix feature that allows a user to install or remove a module while chassis power is applied.
Glossary
31
requested packet interval (RPI) When communicating over a the network, this is the maximum amount of time between subsequent production of input data. Typically, this interval is configured in microseconds. The actual production of data is constrained to the largest multiple of the network update time that is smaller than the selected RPI. Use a power of two times the ControlNet network update time (NUT). For example, if the NUT is 5 ms, type a rate of 5, 10, 20, 40 ms, etc. See network update time (NUT). routine A set of logic instructions in a single programming language, such as a ladder diagram. Routines provide the executable code for the project in a controller (similar to a program file in a PLC or SLC controller). Each program has a main routine: When the controller triggers the associated task and executes the associated program, the main routine is the first routine to execute. To call another routine within the program, enter a JSR instruction in the main routine. You can also specify an optional program fault routine. If any of the routines in the associated program produce a major fault, the controller executes program fault routine See program, task.
Glossary
32
scope Defines where you can access a particular set of tags. When you create a tag, you assign (scope) it as either a controller tag or a program tag for a specific program, as depicted below.
tags that all routines and external devices (e.g., other controllers) can access
42195
You can have multiple tags with the same name: Each tag must have a different scope. For example, one of the tags can be a controller tag and the other tags can be program tags for different programs. Or, each tag can be a program tag for a different program. Within a program, you cannot reference a controller tag if a tag of the same name exists as a program tag for that program. See controller scope, program scope. SINT A data type that stores an 8-bit (1-byte) signed integer value (-128 to +127). Minimize your use of this data type: Typically, instructions convert SINT or INT values to an optimal data type (usually a DINT or REAL value) during execution. Because this requires additional time and memory, minimize the use of the SINT and INT data types.
Glossary
33
source key A mechanism that limits who can view a routine. You assign a source key to one or more routines. Source keys follow the same rules for names as other RSLogix 5000 components, such as routines, tags, and modules. To assign a source key to a routine (protect the routine), use the RSLogix 5000 Source Protection software. A source key file (sk.dat) stores the source keys. The source key file is separate from the RSLogix 5000 project files (.acd). To view a routine that is protected by a source key, you must have the source key. Without the source key, you cannot open a routine. The status line of RSLogix 5000 software displays Source not available. Regardless of whether or not the source key is available, you can always download the project and execute all the routines. See name. store To copy a project to the nonvolatile memory of the controller. This overwrites any project that is currently in the nonvolatile memory. See load, nonvolatile memory.
Glossary
34
42811
42812
You can use the default STRING data type. It stores up to 82 characters.
or
You can create a new string data type to store the number of characters that you define.
New string data types are useful in the following situations: If you have a large number of strings with a fixed size that is less than 82 characters, you can conserve memory by creating a new string data type. If you must handle strings that have more than 82 characters, you can create a new string data type to fit the required number of characters.
Glossary
35
IMPORTANT
Use caution when you create a new string data type. If you later decide to change the size of the string data type, you may lose data in any tags that currently use that data type.
If you: make a string data type smaller make a string data type larger Then: The data is truncated. The LEN is unchanged. The data and LEN is reset to zero.
The following example shows the STRING data type and a new string data type.
42234
This tag uses a new string data type. The user named the string data type STRING_24. The new string data type stores only 24 characters.
Glossary
36
structure Some data types are a structure. A structure stores a group of data, each of which can be a different data type. Within a structure, each individual data type is called a member. Like tags, members have a name and data type. You create your own structures, called a user-defined data type, using any combination of individual tags and most other structures. To copy data to a structure, use the COP instruction. See the Logix5000 Controllers General Instruction Set Reference Manual, publication 1756-RM003. The COUNTER and TIMER data types are examples of commonly used structures.
COUNTER structure To collapse a structure and hide its members, click the sign. TIMER structure
members of running_seconds
42365
See member, user-defined data type. style The format that numeric values are displayed in. See ASCII, binary, decimal, exponential, float, hexadecimal, octal.
Glossary
37
system overhead time slice Specifies the percentage of controller time (excluding the time for periodic tasks) that is devoted to communication and background functions (system overhead): The controller performs system overhead functions for up to 1 ms at a time. If the controller completes the overhead functions in less than 1 ms, it resumes the continuous task. Communication and background functions include the following: communicate with programming and HMI devices (such as RSLogix 5000 software) respond to messages send messages, including block-transfers re-establish and monitor I/O connections (such as RIUP conditions); this does not include normal I/O communications that occur during program execution bridge communications from the serial port of the controller to other ControlLogix devices via the ControlLogix backplane If communications are not completing fast enough, increase the system overhead timeslice. The following table shows the ratio between the continuos task and the system overhead functions:
At this time slice: 10% 20% 33% 50% The continuous tasks runs for: 9 ms 4 ms 2 ms 1 ms And then overhead occurs for up to: 1 ms 1 ms 1 ms 1 ms
Glossary
38
At the default time slice of 10 %, system overhead interrupts the continuous task every 9 ms (of continuous task time).
Legend: Task executes. Task is interrupted (suspended).
1 ms
20
25
The interruption of a periodic task increases the elapsed time (clock time) between the execution of system overhead.
1 ms periodic task 1 ms system overhead 9 ms of continuous task time continuous task 5 elapsed time (ms) 10 15 20 25 9 ms of continuous task time 1 ms 1 ms 1 ms 1 ms
If you increase the time slice to 20 %, the system overhead interrupts the continuous task every 4 ms (of continuous task time).
1 ms system overhead 4 ms continuous task 5 elapsed time (ms) 10 15 20 25 4 ms 4 ms 4 ms 4 ms 1 ms 1 ms 1 ms 1 ms
Glossary
39
If you increase the time slice to 50 %, the system overhead interrupts the continuous task every 1 ms (of continuous task time).
1 ms system overhead 1 ms continuous task 5 elapsed time (ms) 10 15 20 25
If the controller only contains a periodic task (s), the system overhead timeslice value has no effect. System overhead runs whenever a periodic task is not running.
periodic task
To change the system overhead time slice: 1. Open the RSLogix 5000 project. 2. In the controller organizer, right-click the Controller name_of_controller folder and select Properties. 3. Click the Advanced tab. 4. In the System Overhead Time Slice text box, type or select the percentage of overhead time (10 -90%). 5. Click OK.
Glossary
40
tag A named area of the controllers memory where data is stored. Tags are the basic mechanism for allocating memory, referencing data from logic, and monitoring data. The minimum memory allocation for a tag is four bytes. When you create a tag that stores a BOOL, SINT, or INT (which are smaller than four bytes), the controller allocates four bytes, but the data only fills the part it needs. User-defined data types and arrays store data in contiguous memory and pack smaller data types into 32-bit words. The following examples show memory allocation for various tags: start, which uses the BOOL data type:
Memory allocation allocation Bits 31 not used 1 0
start
station_status
Glossary
41
temp_buffer[1] temp_buffer[3]
temp_buffer[0] temp_buffer[2]
See alias tag, base tag, consumed tag. task A scheduling mechanism for executing a program. By default, each new project file contains a pre-configured continuous task. You configure additional, periodic tasks, as needed. A task provides scheduling and priority information for a set of one or more programs that execute based on specific criteria. Once a task is triggered (activated), all the programs assigned (scheduled) to the task execute in the order in which they are displayed in the controller organizer. You can only assign a program to one task at a time. See continuous task, periodic task. timestamp A ControlLogix process that records a change in input data with a relative time reference of when that change occurred.
uncached connection With the MSG instruction, an uncached connection instructs the controller to close the connection upon completion of the mSG instruction. Clearing the connection leaves it available for other controller uses. See connection, cached connection. unidirectional connection A connection in which data flows in only one direction: from the originator to the receiver. See connection, bidirectional connection.
Glossary
42
upload The process of transferring the contents of the controller into a project file on the workstation. If you do not have the project file for a controller, you can upload from the controller and create a project file. However, not everything that is stored in a project file is available from the controller. If you upload from a controller, the new project file will not contain: rung comments descriptions for tags, tasks, programs, routines, modules, or user-defined structures chains of aliases (aliases pointing to other aliases) Alias chains are not completely reconstructed from the controller. If there are several possible names for a data item, the firmware and software choose a best-fit alias that may not reflect how the alias was specified in the original project. See download. user-defined data type You can also create your own structures, called a user-defined data type (also commonly referred to as a user-defined structure). A user-defined data type groups different types of data into a single named entity. Within a user-defined data type, you define the members. Like tags, members have a name and data type. You can include arrays and structures. Once you create a user-defined data type, you can create one or more tags using that data type. Minimize your use of the following data type because they typically increase the memory requirements and execution time of your logic: INT SINT For example, some system values use the SINT or INT data type. If you create a user-defined data type to store those values, then use the corresponding SINT or INT data type.
Glossary
43
If you include members that represent I/O devices, you must use ladder logic to copy the data between the members in the structure and the corresponding I/O tags. Refer to "Buffer I/O" on page 8-1. When you use the BOOL, SINT, or INT data types, place members that use the same data type in sequence:
more efficient BOOL BOOL BOOL DINT DINT less efficient BOOL DINT BOOL DINT BOOL
You can use single dimension arrays. You can create, edit, and delete user-defined data types only when programming offline. If you modify a user-defined data type and change its size, the existing values of any tags that use the data type are set to zero (0). To copy data to a structure, use the COP instruction. See the Logix5000 Controllers General Instruction Set Reference Manual, publication 1756-RM003. See structure.
Glossary
44
watchdog Specifies how long a task can run before triggering a major fault. Each task has a watchdog timer that monitors the execution of the task. A watchdog time can range from 1 ms to 2,000,000 ms (2000 seconds). The default is 500 ms. The watchdog timer begins to time when the task is initiated and stops when all the programs within the task have executed. If the task takes longer than the watchdog time, a major fault occurs: (The time includes interruptions by other tasks.) A watchdog time-out fault (major fault) also occurs if a task triggered again while it is executing (periodic task overlap). This can happen if a lower-priority task is interrupted by a higher-priority task, delaying completion of the lower-priority task. You can use the controller fault handler to clear a watchdog fault. If the same watchdog fault occurs a second time during the same logic scan, the controller enters faulted mode, regardless of whether the controller fault handler clears the watchdog fault.
ATTENTION
If the watchdog timer reaches a configurable preset, a major fault occurs. Depending on the controller fault handler, the controller might shut down.
To change the watchdog time of a task: 1. Open the RSLogix 5000 project. 2. In the controller organizer, right-click name_of_task and select Properties. 3. Click the Configuration tab. 4. In the Watchdog text box, type a watchdog time. 5. Click OK.
Index
A
address assign indirect 7-1 enter 4-7 alias create 6-3 use 6-1 array create 3-10 index through 7-1 organize 3-1 produce large array 11-1 ASCII build string 13-18 compare characters 13-4, 13-10 configure serial port 12-3 configure user protocol 12-5 connect device 12-2 convert characters 13-12 decode message 13-14 enter characters 12-21 extract characters 13-2 look up characters 13-4 manipulate characters 13-1 organize data 12-8 read characters 12-9 write characters 12-14 compare ASCII characters 13-4, 13-10 compliance tables B-5 configure driver 9-1 load from nonvolatile memory 19-1 serial port for ASCII 12-3 user protocol for ASCII 12-5 consume integers from PLC-5C 10-9 tag 10-1 controller change properties 1-3 download 9-3 mode 9-5 shut down 16-1 suspend 16-1 verify 2-5 ControlNet configure driver 9-1 produce and consume data 10-1 convert ASCII characters 13-12 create alias 6-3 array 3-10 driver 9-1 project file 1-1 routine 2-3 string 13-18 string data type 12-8 structure 3-8 subroutine 2-3 tag 3-10, 4-7 tag using Excel 3-11 user-defined data type 3-8
B
bar code extract characters 13-2 search for a match 13-4 test characters 13-4, 13-10 branch enter 4-3 buffer I/O 8-1
D
data ASCII 12-8 definitions B-2 enter ASCII characters 12-21 force 14-1 produce and consume 10-1 data table 3-1 download 9-3 driver configure 9-1
C
chassis size 1-3 clear major fault 9-6, 15-1 minor fault 17-1 codes major fault A-1 minor fault A-3 communicate other controllers 10-1
Index
E
enter address 4-7 ASCII characters 12-21 force 14-2 function block instruction 4-4 ladder instruction 4-3 Ethernet configure driver 9-1 produce and consume tags 10-1 extract ASCII characters 13-2
program portability B-4 programming language B-3 tables B-5 indirect address 7-1 clear a major fault 15-6 instruction enter function block 4-4 enter ladder 4-3 instruction set B-4 IREF 4-4
L
LED force 14-7 load a project 19-1 logic enter function block instruction 4-4 enter ladder instruction 4-3 look up a bar code 13-4
F
fault clear 9-6, 15-1 create user-defined 16-1 develop routine to clear fault 15-1,
18-1
during prescan 15-6 indirect address 15-6 major fault codes A-1 minor fault codes A-3 monitor minor 17-1 test a fault routine 15-10 force disable 14-6 enable 14-5 enter 14-2 LED 14-7 monitor 14-7 remove 14-6 tag 14-1 function block controllers that support function blocks
M
major fault codes A-1 create user-defined 16-1 develop fault routine 15-1, 18-1 manipulate string 13-1 message decode string 13-14 to a single controller 10-11 to multiple controllers 10-13 minor fault clear 17-1 codes A-3 logic 17-1 mode controller 9-5 monitor forces 14-7
I
I/O buffer 8-1 synchronize with logic 8-1 ICON 4-4 IEC 1131-3 compliance data definitions B-2 instruction set B-4 introduction B-1 operating system B-2
Publication 1756-PM001D-EN-P - November 2001
N
nonvolatile memory 19-1
O
OCON 4-4 open routine 4-1 operating system B-2 OREF 4-4
Index
organize array 3-1 strings 12-8 structure 3-1 tag 3-1 tasks 2-2
20-1
run mode 9-5 rung enter 4-3
P
PLC-5C share data 10-6, 10-7, 10-9 prescan clear a major fault 15-6 produce large array 11-1 tag 10-1 tags for PLC-5C 10-6, 10-7 program portability B-4 program mode 9-5 programming language B-3 project download 9-3 load from nonvolatile memory 19-1 protect 20-9 restrict access 20-9 store in nonvolatile memory 19-1 upload 9-6 project file create 1-1 protect project 20-9 routine 20-1
S
save 1-2 see also store a project save as 1-2 security protect a project 20-9 protect a routine 20-1 Security Server software 20-9 send ASCII characters 12-14 serial cable wiring 12-2 configure port for ASCII 12-3 connect an ASCII device 12-2 shut down the controller 16-1 slot number 1-3 source key 20-1 status monitor 5-1, 5-2 store a project 19-1 string compare characters 13-4, 13-10 convert characters 13-12 create 13-18 data type 12-8 enter characters 12-21 extract characters 13-2 manipulate 13-1 organize data 12-8 read characters 12-9 search an array of characters 13-4 write characters 12-14 string data type create 12-8 structure create 3-8 organize 3-1 subroutine create 2-3 suspend controller 16-1 symbol
Publication 1756-PM001D-EN-P - November 2001
R
read ASCII characters 12-9 routine create 2-3 enter function block instructions 4-4 enter ladder instructions 4-3 languages 2-1 open 4-1 protect 20-1 restrict access 20-1 verify 4-10 routine source protection 20-1 RSI Security Server software 20-9 RSLinx
Index
U
upload 9-6 user protocol configure for ASCII 12-5 user-defined data type create 3-8
T
tag assign 4-7 create 3-10, 4-7 create alias 6-3 create using Excel 3-11 enter 4-7 force 14-1 organize 3-1 organize for message 10-11 produce and consume 10-1 produce large array 11-1 share with PLC-5C 10-6, 10-7, 10-9 string 12-8 task organize 2-2 test a fault routine 15-10
V
verify controller 2-5 routine 4-10
W
weight convert 13-12 write ASCII characters 12-14
Please complete the sections below. Where applicable, rank the feature (1=needs improvement, 2=satisfactory, and 3=outstanding).
Overall Usefulness 1 2 3 How can we make this publication more useful for you?
Can we add more information to help you? procedure/step example explanation illustration guideline definition feature other
Other Comments
Location/Phone Would you like us to contact you regarding your comments? ___No, there is no need to contact me ___Yes, please call me ___Yes, please email me at __________________________ ___Yes, please contact me via ________________________
Allen-Bradley Marketing Communications, 1 Allen-Bradley Dr., Mayfield Hts., OH 44124-9705 Phone: 440-646-3176 Fax: 440-646-3525 Email: [email protected]
PN 955107-82
Other Comments
PLEASE REMOVE
[ctrl-@] NUL 0
For technical assistance, call your local Rockwell Automation representative or contact Rockwell Automation in one of the following ways:
Phone United States/Canada Outside United States/Canada 1.440.646.5800 You can access the phone number for your country via the Internet: 1. Go to http://www.ab.com 2. Click on Product Support (http://support.automation.rockwell.com) 3. Under Support Centers, click on Contact Information 1. Go to http://www.ab.com 2. Click on Product Support (http://support.automation.rockwell.com)
Internet
Back Cover
Allen-Bradley, ControlLogix, DH+, Logix5000, PLC-5, RSLogix 5000, RSLinx, RSNetWorx, and SLC are trademarks of Rockwell Automation. ControlNet is a trademark of ControlNet International, Ltd. Ethernet is a trademark of Digital Equipment Corporation, Intel, and Xerox Corporation.
PN 957626-17
Copyright 2001 Rockwell Automation. All rights reserved. Printed in the U.S.A.
Programming Manual