background image

52

Rockwell Automation Publication 1756-PM004D-EN-P - September 2012

Chapter 2

        Organizing Tags

The following example loads a series of preset values into a timer, one value (array 
element) at a time.

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.

EXAMPLE

Step through an array.

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).

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.

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…3.)

42358

Move
Source timer_presets[north_tank.step]

60000

Dest

north_tank.step_time.PRE

60000

MOV

/

north_tank.step_time.DN

EN
DN

Timer On Delay
Timer

north_tank.step_time

Preset

60000

Accum

0

TON

north_tank.step_time.DN

Add
Source A

1

Source B north_tank.step

0

Dest

north_tank.step

0

ADD

Equal
Source A north_tank.step

0

Source B

4

EQU

Move
Source

0

Dest north_tank.step

0

MOV

Содержание 1756-L65 ControlLogix 5565

Страница 1: ...Programming Manual Logix5000 Controllers I O and Tag Data CatalogNumbers 1756ControlLogix 1756GuardLogix 1768CompactGuardLogix 1769CompactLogix 1789SoftLogix PowerFlex withDriveLogix...

Страница 2: ...y is assumed by Rockwell Automation Inc with respect to use of information circuits equipment or software described in this manual Reproduction of the contents of this manual in whole or in part witho...

Страница 3: ...olLogix 5563 Controller 1756 L63S ControlLogix 5563S Controller 1756 L64 ControlLogix 5564 Controller 1756 L65 ControlLogix 5565 Controller 1768 L43 CompactLogix 5343 Controller 1768 L43S CompactLogix...

Страница 4: ...2 Rockwell Automation Publication 1756 PM004D EN P September 2012 Summary of Changes Notes...

Страница 5: ...duction 23 Tag Type 24 Data Type 25 Scope 27 Guidelines for Tags 29 Create a Tag 33 Adding Extended Properties to a Tag 33 Create an Array 35 Configuring an Array 38 Creating a User defined Data Type...

Страница 6: ...ure External Access 66 External Access Options 66 Configure External Access in the New Tag Dialog Box 67 Set Up External Access in the Tag Properties Dialog Box 69 View and Select External Access Stat...

Страница 7: ...or the future of Rockwell Automation engineering design tools and capabilities It is the one place for design engineers to develop all the elements of their control system Purpose of This Manual This...

Страница 8: ...6 Rockwell Automation Publication 1756 PM004D EN P September 2012 Preface Notes...

Страница 9: ...ystem you add the module to the I O Configuration folder of the controller When you add the module you also define a specific configuration for the module While the configuration options vary from mod...

Страница 10: ...ion Ownership Term Definition Connection A communication link between two devices such as between a controller and an I O module PanelViewterminal or another controller Connections are allocations of...

Страница 11: ...llerandanI Omodule Thecontrollermaintains and monitors the connection with the I O module Any break in the connection such as a module fault or the removal of a module while under power sets fault bit...

Страница 12: ...Acontrollerusing a listen only connection only monitors the module It does not write configuration data and can only maintain a connection tothe I O module when the owner controller is actively contr...

Страница 13: ...jected Listen only Onceaninputmodulehasbeenconfigured andownedbyacontroller othercontrollerscanestablishalisten only connection to that module These controllers can receive multicast data while anothe...

Страница 14: ...ng with a module this set of keying attributes is considered You can find revision information on the General tab of a module s Properties dialog box Figure 1 General Tab Attribute Description Vendor...

Страница 15: ...tch keying is also necessary to enable Automatic Firmware Update for the module via the Firmware Supervisor feature from a Logix5000 controller EXAMPLE In the following scenario Exact Match keying pre...

Страница 16: ...is product and revision specific With Compatible Module you can replace a module of a certain Major Revision with one of the same catalog number and the same or later that is higher Major Revision In...

Страница 17: ...configuration is for a 1756 IB16D module with module revision 3 3 Thephysicalmoduleisa1756 IB16Dmodulewithmodulerevision3 2 Inthiscase communication is prevented because the minor revision of the mod...

Страница 18: ...n of the physical module is higher than expected and the module determines that it is compatible with the prior major revision IMPORTANT Changing electronic keying selections online may cause the I O...

Страница 19: ...g used can fulfill the functional requirements of the application ATTENTION Be extremely cautious when using Disabled Keying if used incorrectly this option can lead to personal injury or death proper...

Страница 20: ...ion is allowed because the two digital modules share common data formats IMPORTANT Changing electronic keying selections online may cause the I O communication connection to the module to be disrupted...

Страница 21: ...Slot Type Member SubMember Bit Optional Where Is Location Network location LOCAL same chassis or DIN rail as thecontroller ADAPTER_NAME identifies remote communication adapter or bridge module Slot S...

Страница 22: ...put 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...

Страница 23: ...l routine executes the logic for the drill machine The map_outputs routine copies the values of output tags in the drill routine to their corresponding output devices 42369 Jump to Subroutine Routine...

Страница 24: ...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 inpu...

Страница 25: ...mbols are required to make logic easier to interpret In Logix5000 controllers there is no fixed numeric format The tag name itself identifies the data This lets you organize your data to mirror your m...

Страница 26: ...ines as you organize your tags See the Logix5000 Controllers Produced and Consumed Tags Programming Manual publication 1756 PM011 EXAMPLE Tags Digital I O Device Analog I O Device IntegerValue Storage...

Страница 27: ...integer floating pointvalue string and so forth Structure A data type that is a combination of other data types A structure is formatted to create a unique data type that matches a specific need Withi...

Страница 28: ...py data to a structure use the COP instruction Refer to the Logix5000 Controllers General Instructions Reference Manual publication 1756 RM003 Data type Bits 31 16 15 8 7 1 0 BOOL Notused 0 or 1 SINT...

Страница 29: ...er tags Global data Task Program Project Other routines Main routine I O data Programtags Local data System shared data Controller tags Global data Program_A Other routines Main routine Tag_4 Tag_5 Ta...

Страница 30: ...same name exists as a program tag for that program Certain tags must be controller scope controller tag Table 3 Controller Scope Tags If you want to use the tag Then assign this scope In more than one...

Страница 31: ...DINTs Take advantage of program scoped tags If you want multiple tags with the same name define each tag at the program scope program tags for a different program This lets you reuse both logic and ta...

Страница 32: ...r the alphabetical order of tags Logix Designer application displays tags of the same scope in alphabetical order To make it easier to monitor related tags use similar starting characters for tags tha...

Страница 33: ...n error X in Function Block Diagrams and the error underlined in Structured Text and the routine does not verify Restrictions to adding extended properties in logic The following restrictions apply wh...

Страница 34: ...es not verify Under the following circumstances a data type default value is going to be used Array is accessed programmatically with indirect reference Array tag does not have the extended property c...

Страница 35: ...ee Chapter 4 on page 65 for information on the External Access and Constant attributes AddingExtendedPropertiestoaTag To add extended properties to a tag 1 Select the tag in the Tag Editor 2 In the Ta...

Страница 36: ...nce the property is removed any value associated to the property is removed from the system The list is not available for other types of tags MinandMaxforDINT INT LINT SINT andREALDataTypes For data t...

Страница 37: ...type 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...

Страница 38: ...tion 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 42367 To expand an array and display its eleme...

Страница 39: ...indow the elements are in the order depicted below Subscript of Second Dimension Description 0 1 2 3 4 5 Subscript of First Dimension 0 1 1 5 2 5 1 25 1 25 1 25 Position of first hole from leading edg...

Страница 40: ...ags The Tag Editor window appears 2 Type a name for the tag and select a scope for the tag 3 Assign the array dimensions 42350 If the tag is Then type Where One dimension array Data_type x Data_typeis...

Страница 41: ...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 so forth a user defined data type is used ATTENTION An array that is ba...

Страница 42: ...he array to a single dimension Multi dimension arrays are not permitted in a user defined data type EXAMPLE User defined data type that stores the data that is required to run a machine Because severa...

Страница 43: ...L SINT or INT data types place members that use the same data type in sequence CreatingaUser definedDataType 1 On the Controller Organizer from the User defined folder under Data Types right click Use...

Страница 44: ...ype A description is optional 4 For each member of the user defined data type type a name data type style and description 5 Click the External Access column and choose an attribute Limit any arrays to...

Страница 45: ...or Properties pane check the properties that you want to add from the Extended Properties list The entries in the list depend on the selected member s data type You can check more than one property Mi...

Страница 46: ...theLogixDesignerapplicationlooks for an available description for a tag element or member Descriptions in user defined data types ripple through to the tags that use that data type Description of an a...

Страница 47: ...iptions Follow these steps to use pass through descriptions and append to base tag descriptions 1 In the Logix Designer application from the Tools menu choose Options The Work Station Options screen a...

Страница 48: ...through value of an item into the Description Engineering Unit State 0 or State 1 field of another item Follow these steps to use a pass through description as the starting point for a more specific...

Страница 49: ...f the tag or numeric expression within the dimensions of the array For example if a dimension of an array contains 10 elements then the value of the tag or numeric expression must be 0 9 10 elements M...

Страница 50: ...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 by using the descriptive tag names Y...

Страница 51: ...n Follow these steps to show in your logic the tag to which an alias points 1 From the Tools menu choose Options 2 Click the Ladder Display tab 3 Check Show Tag Alias Information 4 Click OK stop Local...

Страница 52: ...ick Controller Tags and choose Edit Tags The Tag Editor window appears 2 Select the scope of the tag 3 To the right of the tag name click the Alias For cell The cell displays a 4 Click 5 Choose the ta...

Страница 53: ...array index points here array 0 4500 array 1 6000 array 2 3000 array 3 2500 When index equals 2 array index points here To Use a tag in the subscript and Select a recipe from an array of recipes Enter...

Страница 54: ...For example when north_tank step equals 0 the instruction loads timer_presets 0 into the timer 60 000 ms When north_tank step_time is done the rung increments north_tank step to the next number and t...

Страница 55: ...egate Multiply Divide ABS Absolute value AND AND FRD BCD to integer MOD Modulo NOT Complement OR OR SQR Square root TOD Integer to BCD TRN Truncate XOR Exclusive OR Operator Description Table 7 Format...

Страница 56: ...the array subscript is out of range Transitional instructions also generate a major fault even if the rung is false The controller checks the array subscript in these instructions even if the rung is...

Страница 57: ...if the current language s content is blank for a particular component of the project However you can use a custom language to tailor documentation to a specific type of project file user IMPORTANT The...

Страница 58: ...guage or by using the import export utility to translate the documentation off line and then import it back into the project Once you enable documentation languages in the Logix Designer application y...

Страница 59: ...nable I O forces and SFC forces separately or at the same time You cannot enable or disable forces for a specific module tag collection or tag element ATTENTION Forcing can cause unexpected machine mo...

Страница 60: ...an alias tag also removes the force on the base tag CheckForceStatus Before you use a force determine the status of forces for the controller You can check force status ATTENTION Changes to forces can...

Страница 61: ...rce immediately takes effect Disabled Forces of this type are inactive If the project contains any forces of this type they are not overriding your logic Installed At least one force of this type exis...

Страница 62: ...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 produc...

Страница 63: ...is the state of the I O Forces status indicator 2 Open the routine that contains the tag that you want to force 3 Right click the tag and choose Monitor If necessary expand the tag to show the value...

Страница 64: ...ces can cause unexpected machine motion that could injure personnel Before you disable or remove forces determine how the change will effect your machine or process and keep personnel away from the ma...

Страница 65: ...expand the tag to show the value that is forced for example BOOL value of a DINT tag 4 Right click a tag or element that has the force and choose Remove Force DisableAllI OForces To disable choose Lo...

Страница 66: ...64 Rockwell Automation Publication 1756 PM004D EN P September 2012 Chapter 3 Force I O Notes...

Страница 67: ...bute By using these two attributes you can help safeguard tag data by preventing unwanted changes to tag values Also by reducing the number of tags exposed to external applications you can also reduce...

Страница 68: ...d and change the tag s value ReadOnly External applications can read but cannot change the tag s value None External applications cannot read or change the tag s value IMPORTANT The Logix Designer app...

Страница 69: ...New Tag dialog box lets you assign the external access attribute for the tag being created Follow these steps 1 On the Controller Organizer right click Controller Tags and choose New Tag IMPORTANT For...

Страница 70: ...e Type menu choose a tag type 3 From the External Access menu choose an external access option 4 Click OK As shown in the example below the External Access box is dimmed for an alias tag There may be...

Страница 71: ...5000 Controllers Produced and Consumed Tags Programming Manual publication 1756 PM011 SetUpExternalAccessintheTagPropertiesDialogBox The Tag Properties dialog box is used to edit properties of existin...

Страница 72: ...view the external access status of a tag in the Tag Editor window The External Access column displays the tag as Read Write Read Only or None Follow these steps to select multiple rows and set the ext...

Страница 73: ...on is a convenient way to find the base tag among all the cross reference records Follow these steps to locate a base tag 1 With the Tag Editor window open from the Logix Designer Search menu select t...

Страница 74: ...ctivated in the current license the tag is an alias tag the controller is in hard run mode Tag Editor The External Access box is disabled if you do not have permission to changethe external access set...

Страница 75: ...ied The following table describes the conditions in which the External Access column is disabled Add OnInstructionsExternal AccessConsiderations External Access settings can be used with parameters an...

Страница 76: ...gured for the base local tag Add 0n Instruction Parameters and Tags External Access Options Local tag Read Write Read Only None Input parameter Output parameter EnableIn parameter Read Only EnableOut...

Страница 77: ...ge a tag from Input or Output parameter to InOut parameter and the present attribute is either Read Write or Read Only no change if you switch between Input and Output parameters the value of the exte...

Страница 78: ...s that contain tags with any value other than Read Write Read Only and None Dialog Box Window Considerations PLC 2 PLC 5 SLC Mapping To map a tag Type a file number Choose a tag from the Name box Only...

Страница 79: ...ants and who can modify the constant attribute of a tag To change the value of a constant you must have the Tag Modify Constant Tag Values permission To modify the constant attribute of a tag you must...

Страница 80: ...hese steps to configure a tag as a constant on the New Tag dialog box 1 On the Controller Organizer right click Controller Tags and choose New Tag The New Tag Dialog Box appears 2 From the Type menu c...

Страница 81: ...cess Control Chapter 4 1 On the Tag Editor window right click a tag and choose Edit tag name Properties The Tag Properties dialog box appears 2 From the Type menu choose a tag type 3 Check Constant 4...

Страница 82: ...displays if a user tries to change the data type of a constant tag to a data type that cannot be constant Follow these steps to add a constant value in the Tag Editor window 1 On the Controller Organi...

Страница 83: ...nt license the controller is in hard run mode the Add On Instruction is in Source Protection mode 1 If the controller is in safety locked mode only the safety tags will be disabled from being accessed...

Страница 84: ...nt Value The Constant attribute will not apply to Input Output EnableIn and EnableOut Add On Instruction parameters It will not apply to Add On Instruction Local tags By denoting an InOut parameter of...

Страница 85: ...stant value 82 external access 73 external access 72 73 user defined data type external access 73 constant value availability 81 dialog box 78 tag editor 80 tag properties 78 value configuration 78 va...

Страница 86: ...e scope Logix Designer application 5 M memory allocation for tags 25 Min and Max for DINT INT LINT SINT and REAL data types 34 43 module I O configuration 7 N name guidelines for tag 29 reuse of tag n...

Страница 87: ...nsiderations 76 memory allocation 25 name 27 organize 29 overview 23 properties external access 69 reuse of name 27 scope 27 type 24 U user defined data type create 41 external access variables 73 gui...

Страница 88: ...86 Rockwell Automation Publication 1756 PM004D EN P September 2012 Index...

Страница 89: ......

Страница 90: ...em within the first 24 hours of installation review the information that is contained in this manual You can contact Customer Support for initial help in getting your product up and running NewProduct...

Отзывы: