Data Access Control

In RSLogix 5000 software, version 18 and later, you can prevent programmatic modification of InOut parameters by designating them as constants. You can also configure the type of access you will allow external devices, such as an HMI, to have to your tag and parameter data. You can control access to tag data changes with the Logix Designer application by configuring FactoryTalk security.

Constant Values

InOut parameters may be designated as constant value tags to prevent their data from being modified by controller logic. If the logic of an Add-On Instruction contains a write operation to a constant value parameter, the Add-On Instruction will not verify in the Add-On Instruction definition context.


External Access

External Access defines the level of access that is allowed for external devices, such as an HMI, to see or modify tag values.





0 comments :

Using Standard and Safety Tags

When creating a safety Add-On Instruction, follow these guidelines for standard and safety tags:

· Standard tags may not be used as Input, Output, or InOut parameters of a safety Add-On Instruction.
· Safety tags may be used as Input parameters for standard Add-On Instructions.


0 comments :

Determining Which Parameters to Make Visible or Required

To help you know that specific data is passed into the Add-On Instruction, you can use required parameters. A required parameter must be passed each argument for a call to the instruction to verify. In Ladder Diagram and Structured Text, this is done by specifying an argument tag for these parameters. In a Function Block Diagram, required Input and Output parameters must be wired, and InOut parameters must have an argument tag. If a required parameter does not have an argument associated, as described above, then the routine containing the call to the Add-On Instruction will not verify.

For Output parameters, making a parameter visible is useful if you do not usually need to pass the parameter value out to an argument, but you do want to display its value prominently for troubleshooting.

Required parameters are always visible, and InOut parameters are always required and visible. All Input and Output parameters, regardless of being marked as required or visible, can be programmatically accessed as a member of the instruction's tag.

Figure 1 - Simulation Instruction in Function Block


Figure 2 - Simulation Instruction in Ladder


This table explains the effects of the Required and Visible parameter settings on the display of the instruction.



If you have a parameter for which the user must specify a tag as its source for input or its destination as output, and you do not want this to be optional, set the parameter as required. Any required parameters are automatically set to visible.

The Visible setting is always set to visible for InOut parameters. All InOut parameters are required.


0 comments :

Using a Single Dimension Array as an InOut Parameter

The InOut parameter can be defined to be a single dimension array. When specifying the size of this array, consider that the user of your array can either:

· pass an array tag that is the same size as your definition.
· pass an array tag that is larger than your definition.

When developing your logic, use the Size instruction to determine the actual size of the referenced array to accommodate this flexibility.


0 comments :

Creating an Alias Parameter for a Local Tag

Alias parameters simplify connecting local tags to an Input or Output tag that is commonly used in the Add-On Instruction’s application without requiring that manual code be created to make the association. Aliases can be used to define an Input or Output parameter with direct access to a local tag or its member.
Changing the value of an alias parameter changes the data of the local tag or local tag member it represents and vice versa.

Alias parameters are subject to these restrictions:

· Alias parameters must be either Input or Output parameters.
· You can only create an alias parameter for a local tag or its member.
· Only one Input and one Output parameter may be mapped to the same local tag or the same member of a local tag.
· Only BOOL, SINT, INT, DINT, and REAL data types may be used.
· Alias parameters may not be constants.
· The External Access type of an alias parameter matches the External Access type of the local tag to which it is mapped.

0 comments :

Selecting a Data Type for a Parameter

The Logix5000 controllers perform DINT (32 bit) and REAL (32 bit) math operations, which causes DINT data types to execute faster than other integer data types. Data conversion rules of SINT to INT to DINT are applied automatically, and can add overhead. Whenever possible, use DINT data types for the Add-On Instruction Input and Output parameters.


0 comments :

Passing Arguments to Parameters by Reference or by Value

The following information will help you understand the differences between passing argument tags to parameters by reference or by value.
AspectBy Value (Input or Output)By Reference (InOut)
ValueSynchronous - the argument's value does not change during Add-On Instruction execution.Asynchronous- the argument's value may change during Add-On Instruction execution. Any access by the instruction's logic directly reads or writes the passed tag's value.
PerformanceArgument values are copied in and out of the parameters of the Add-On Instruction. This takes more time to execute a call to the instruction.Parameters access argument tags directly by reference, which leads to faster execution of instruction calls.
Memory usageMost amount.Least amount.
Parameter data types supportedAtomic (SINT, DINT, INT, REAL, BOOL).Atomic, arrays, and structures.

0 comments :

Considerations When Creating Parameters

Consider the following information when you are creating parameters.

1.- Passing Arguments to Parameters by Reference or by Value
2.- Selecting a Data Type for a Parameter
3.- Creating an Alias Parameter for a Local Tag
4.- Using a Single Dimension Array as an InOut Parameter
5.- Determining Which Parameters to Make Visible or Required
6.- Using Standard and Safety Tags
7.- Data Access Control

0 comments :

Using GSV and SSV Instructions

When using GSV and SSV instructions inside an Add-On Instruction, the following classes are supported:

· AddOnInstructionDefinition(1)(2)
· MotionGroup
· Axis
· Program(2)
· Controller
· Routine(2)
· Controller Device
· Redundancy
· CoordinateSystem
· Safety
· CST
· Serial Port
· DF1
· Task(2)
· Fault Log
· Wall Clock Time
· Message

(1) GSV-only. SSV instructions will not verify.
(2) The classes that represent programming components - Task, Program, Routine, AddOnInstructionDefinition - support only this as the Instance Name.

When you enter a GSV or SSV instruction, the Logix Designer application displays the object classes, object names, and attribute names for each instruction. This table lists the attributes for the AddOnInstructionDefinition class.

Attribute NameData TypeAttribute Description
MajorRevisionDINTMajor revision number of the Add-On Instruction
MinorRevisionDINTMinor revision number of the Add-On Instruction
NameStringName of the Add-On Instruction
RevisionExtendedTextStringText describing the revision of the Add-On Instruction
VendorStringVendor that created the Add-On Instruction
LastEditDateLINTDate and time stamp of the last edit to an Add-On Instruction
SignatureIDDINT32-bit instruction signature value
SafetySignatureIDDINT32-bit safety instruction signature value

0 comments :

Unavailable Instructions within Add-On Instructions

Most built-in instructions can be used within Add-On Instructions. The following instructions cannot be used.

Unavailable Instruction Description
BRK         Break
EOT         End of Transition
EVENT         Event Task Trigger
FOR         For (For/Next Loop)
IOT                 Immediate Output
JSR                 Jump to Subroutine
JXR                 Jump to External Routine
MAOC         Motion Arm Output Cam
PATT         Attach to Equipment Phase
PCLF         Equipment Phase Clear Failure
PCMD         Equipment Phase Command
PDET         Detach from Equipment Phase
POVR         Equipment Phase Override Command
RET         Return
SBR         Subroutine
SFP                 SFC Pause
SFR         SFC Reset

but the data instances must be passed as InOut parameters.

· ALMA (Analog Alarm)
· ALMD (Digital Alarm)
· All Motion Instructions
· MSG (Message)

0 comments :

Programmatic Access to Data

Input and Output parameters and local tags are used to define an instructiondefined data type. Each parameter or local tag has a member in the data type, although local tag members are hidden from external use. Each call to an Add-On Instruction uses a tag of this data type to provide the data instance for the instruction's execution.

The parameters of an Add-On Instruction are directly accessible in the controller's programming via this instruction-defined tag within the normal tagscoping rules.

Local tags are not accessible programmatically through this tag. This has impact on the usage of the Add-On Instruction. If a structured (including UDTs), array, or nested Add-On Instruction type is used as a local tag (not InOut parameters), then they are not programmatically available outside the Add-On Instruction definition.


0 comments :

Nesting Add-On Instructions

Add-On Instructions can call other Add-On Instructions in their routines. This provides the ability to design more modular code by creating simpler instructions that can be used to build more complex functionality by nesting instructions. The instructions can be nested to seven levels deep.

Add-On Instructions cannot call other routines via a JSR instruction. You must use nested instructions if you need complex functionality consisting of multiple routines.


0 comments :

Runtime Editing

Add-On Instructions can only be edited offline. If the intended functionality needs to be changed in a running controller, consider carefully if an Add-On Instruction is suitable.


0 comments :

Instruction Size

Add-On Instructions have one primary logic routine that defines the behavior of the instruction when executed. This logic routine is like any other routine in the project and has no additional restrictions in length. The total number of Input parameters plus Output parameters plus local tags can be up to 512.

There are no limits on the number of InOut parameters. However, limit extended properties (.@Min and .@Max syntax) should not be defined on an InOut parameter of an Add-On Instruction and should not be used in Add-On Instruction definition logic or the logic does not verify.

Limits cannot be accessed inside Add-On Instruction logic.

The maximum data instance supported (which includes Inputs, Outputs, and local tags) is two megabytes. The data type size is displayed on the bottom of the Parameters and Local Tags tab in the Add-On Instruction Definition.



0 comments :

Transitional Instructions

Some instructions execute (or retrigger) only when rung-condition-in toggles from false to true. These are transitional-relay ladder instructions. When used in an Add-On Instruction, these instructions will not detect the rung-in transition to the false state. When the EnableIn bit is false, the Add-On Instruction logic routine no longer executes, thus the transitional instruction does not detect the transition to the false state. Extra conditional logic is required to handle triggering of transitional instructions contained in an Add-On Instruction.

Some examples of transitional instructions include: ONS, MSG, PXRQ, SRT, some of the ASCII instructions, and some of the Motion instructions.


0 comments :

Programming Languages

Select the programming language based on the type of application you are developing. Ladder Diagram, Function Block Diagram, and Structured Text can be used for Add-On Instruction logic.

Each of the programming languages supported in the Logix Designer application is targeted for different types of applications and programming styles. In general, Ladder Diagram executes simple boolean logic, timers, and counters the fastest. Function Block Diagrams and Structured Text may be more efficient if you take advantage of the more advanced process and drives instructions available in those languages.

You cannot compare execution times for the same Add-On Instruction written in different programming languages. There are fundamental differences on how the different languages execute and are compiled.


0 comments :

Safety Instruction Signature

When a sealed safety Add-On Instruction is downloaded for the first time, a SIL 3 safety instruction signature is automatically generated.


0 comments :

Instruction Signature

The instruction signature, available for both standard and safety controllers, lets you quickly determine if the Add-On Instruction has been modified. Each Add- On Instruction has its own instruction signature on the Add-On Instruction definition. The instruction signature is required when an Add-On Instruction is used in SIL 3 safety-related functions, and may be required for regulated industries. Use it when your application calls for a higher level of integrity.

Once generated, the instruction signature seals the Add-On Instruction, preventing it from being edited until the signature is removed. This includes rung comments, tag descriptions, and any instruction documentation that was created. When an instruction is sealed, you can perform only these actions:

· Copy the instruction signature
· Create or copy a signature history entry
· Create instances of the Add-On Instruction
· Download the instruction
· Remove the instruction signature
· Print reports

The instruction signature does not prevent referenced Add-On Instructions or User-defined Data Types from being modified. Changes to the parameters of a referenced Add-On Instruction or to the members of a referenced User-defined Data Type can cause the instruction signature to become invalid. These changes include:

· Adding, deleting, or moving parameters, local tags, or members in referenced User-defined Data Types.
· Changing the name, data type, or display style of parameters, local tags, or members in referenced User-defined Data Types.

If you want to enable project documentation or source protection on an Add-On Instruction that will be sealed with an instruction signature, you need to import the translated information or apply source protection before generating the signature. You must have the source key to generate a signature or to create a signature history entry for a source-protected Add-On Instruction that has an instruction signature.


0 comments :

Safety Add-On Instructions

Safety Add-On Instructions are used in the safety task of GuardLogix safety controllers. Create a safety Add-On Instruction if you need to use your instruction in a safety application. Safety Add-On Instructions are subject to a number of restrictions. These restrictions, enforced by the Logix Designer application and all GuardLogix controllers, are listed here for informational purposes only.

· They may use only safety-approved instructions and data types.
· All parameters and local tags used in a safety Add-On Instruction must also be safety class.
· Safety Add-On Instructions use relay ladder logic only and can be called in safety routines only, which are currently restricted to ladder logic.
· Safety Add-On Instructions may be referenced by other safety Add-On Instructions, but not by standard Add-On Instructions.
· Safety Add-On instructions cannot be created, edited, or imported when a safety project is safety-locked or has a safety task signature.


0 comments :

Encapsulation

Add-On Instructions are designed to fully encapsulate the code and data associated with the instruction. The logic inside an Add-On Instruction uses only the parameters and local tags defined by the instruction definition. There is no direct programmatic access to controller or program scope tags. This lets the Add-On Instruction be a standalone component that can execute in any application that calls it by using the parameters interface. It can be validated once and then locked to prevent edits.


0 comments :

Instruction Functionality

Complex instructions tend to be highly application specific and not reusable, or require extensive configuration support code. As with the built-in instructions, Add-On Instructions need to do one thing, do it well, and support modular coding. Consider how the instruction will be used and manage interface complexity for the end user or application.

Add-On Instructions are best at providing a specific type of functionality or device control.

0 comments :

Considerations for Add-On Instructions

When deciding whether to develop an Add-On Instruction, consider the following aspects.

1.- Instruction Functionality
2.- Encapsulation
3.- Safety Add-On Instructions
4.- Instruction Signature
5.- Safety Instruction Signature
6.- Programming Languages
7.- Transitional Instructions
8.- Instruction Size
9.- Runtime Editing
10.- Nesting Add-On Instructions
11.- Programmatic Access to Data
12.- Unavailable Instructions within Add-On Instructions
13.- Using GSV and SSV Instructions

0 comments :

Components of an Add-On Instruction

Add-On Instructions are made up of the following parts.

General Information

The General tab contains the information you enter when you first create the instruction. You can use this tab to update that information. The description, revision, revision note, and vendor information is copied into the custom help for the instruction. The revision is not automatically managed by the software. You are responsible for defining how it is used and when it is updated.


Class information for safety controller projects appears on the General tab as well. The class can be standard or safety. Safety Add-On Instructions must meet requirements specific to safety applications.


Parameters

The parameters define the instruction interface; that is, how the instruction appears when used. The parameter order defines the order that the parameters appear on the instruction call.


Local Tags

The Local Tags tab defines tags that are used by the logic within the Add-On Instruction and are not visible outside the instruction. Other Add-On Instructions or programs in the project cannot access these tags.

The only way to make a local tag or one of its members accessible from outside the instruction is by defining an alias parameter.


Data Type

Parameters and local tags are used to define the data type that is used when executing the instruction. The software builds the associated data type. The software orders the members of the data type that correspond to the parameters in the order that the parameters are defined. Local tags are added as hidden members.

The data type for a Local Tag may not be a multi-dimensional array or an object type, which includes all Motion types, MSG, ALARM_ANALOG, and ALARM_DIGITAL.

The data type field is unavailable for members of a Local Tag.

Logic Routine

The logic routine of the Add-On Instruction defines the primary functionality of the instruction. It is the code that executes whenever the instruction is called. Shown below is the interface of an Add-On Instruction and its primary logic routine that defines what the instruction does.


Optional Scan Mode Routines

You can define additional routines for Scan mode behavior.


Instruction Signature

The instruction signature consists of an ID number that identifies the contents of the Add-On Instruction and a timestamp that identifies the specific date and time at which the instruction signature was generated or a signature history entry was made (whichever came last).


Once generated, the instruction signature seals the Add-On Instruction, preventing it from being edited while the signature is in place.

In addition, when a sealed safety Add-On Instruction is downloaded for the first time, a SIL 3 safety instruction signature is automatically generated. The safety instruction signature is an ID number that identifies the execution characteristics of the safety Add-On Instruction.

Signature History

The signature history provides a record of signatures for future reference. A signature history entry consists of the name of the user, the instruction signature, the timestamp value, and a user-defined description. Up to six history entries can be stored. If a seventh entry is made, the oldest entry is automatically deleted.

Change History

The Change History tab displays the creation and latest edit information that is tracked by the software. The By fields show who made the change based on the Windows user name at the time of the change.


Help

The name, revision, description, and parameter definitions are used to automatically build the Instruction Help. Use the Extended Description Text to provide additional Help documentation for the Add-On Instruction. This content reflects updates as Parameters or other attributes are changed in the definition.

The Instruction Help Preview shows how your instruction will appear in the various languages, based on parameters defined as required or visible.



0 comments :

About Add-On Instructions

With Add-On Instructions, you can create new instructions for sets of commonly-used logic, provide a common interface to this logic, and provide documentation for the instruction.

Add-On Instructions are intended to be used to encapsulate commonly used functions or device control. They are not intended to be a high-level hierarchical design tool. Programs with routines are better suited to contain code for the area or unit levels of your application.

These are some benefits to using Add-On Instructions:

• Reuse code
– You can use Add-On Instructions to promote consistency between projects by reusing commonly-used control algorithms.
– If you have an algorithm that will be used multiple times in the same project or across multiple projects, it may make sense to incorporate that code inside an Add-On Instruction to make it modular and easier to reuse.

• Provide an easier to understand interface
– You can place complicated algorithms inside of an Add-On Instruction, and then provide an easier to understand interface by making only essential parameters visible or required.
– You can reduce documentation development time through automatically generating instruction help.

• You can export an Add-On Instruction to an .L5X file that can then be imported into another project. You can also copy and paste between projects.

• Protect intellectual property
– You can place your proprietary code inside of an Add-On Instruction, then use Source Protection to prevent others from viewing or changing your code.

• Simplify maintenance
– You can simplify code maintenance because Add-On Instruction logic, monitored in the Logix Designer application, animates with tag values relative to that specific instance of the Add-On Instruction.

• Track revisions, a chang history, and easily confirm instruction functionality with high-integrity Add-On Instructions
– You can add an instruction signature to your Add-On Instruction, which generates a unique identifier and prevents the instruction from being edited without resulting in a change to the signature.

An Add-On-Instruction can be used across multiple projects. You can define the instructions, the instructions can be provided to you by someone else, or they can be copied from another project.

Once defined in a project, they behave similarly to the built-in instructions already available in the Logix Designer application. They appear on the instruction toolbar and in the instruction browser for easy access, just like built-in Logix Designer application instructions.

Like standard Add-On Instructions, safety Add-On Instructions let you encapsulate commonly-used safety logic into a single instruction, making it modular and easier to reuse. In addition to the instruction signature used for high-integrity Add-On Instructions, safety Add-On Instructions feature a SIL 3 safety instruction signature for use in safety-related functions up to and including SIL 3.


0 comments :

Designing Add-On Instructions

Introduction

Add-On Instructions are available beginning with RSLogix 5000 software, version 16. Add-On Instructions are custom instructions that you design and create. Beginning in RSLogix 5000 software, version 18, high integrity and safety Add-On Instructions are available.

Topics
1. About Add-On Instructions
2. Components of an Add-On Instruction
3. Considerations for Add-On Instructions
4. Considerations When Creating Parameters
5. Planning Your Add-On Instruction Design

0 comments :

Printing a Ladder Logic Program

You may print your program only while off-line. To print,

Right-mouse first line in project tree
Select Generate Report…
De-select Tags
Click on Print

0 comments :

Restoring Ladder Logic Programs

You may restore your ladder logic program from the files on the computer hard disk to the PLC either before going on-line. Before going on-line, do the following steps:

Select File
Select Open
The file selector window will appear.
Double-click on the appropriate project. The project is now loaded into the PC
From the “Offline” box in the upper left part of the screen, select Download
A window will pop up asking for confirmation. Select Yes
If the processor is in the run mode, you will be asked if it is okay to switch to program mode before continuing. Select Yes
The files will be downloaded
If the processor was in the run mode when you started, you will be asked if it is okay to switch to back to run mode before continuing. Select Yes


0 comments :

Saving Ladder Logic Programs

Ladder logic programs (projects) may be saved for future use. By saving your ladder logic programs, you are able to resume your experiment, even though others have been using the same PLC. One usually saves the program to the default program directory on the hard disk and then saves the program to a USB flash drive or your personal account.

To save the ladder logic currently in the PLC,

Select File
To save with the same project name, select Save
To save with a different project name, select Save As...
To save your project to another directory, use Save As... and select the proper drive and directory.


0 comments :

Importing

1. Importing Database from CSV files

To import an address/tag/description database from a .CSV (comma separated variable) file:

From the main menu select Tools.
Select Import Tags...
An Import Tags window will appear. Select the following:
Files of Type - CSV
Select the appropriate file.
On Collisions: - Overwrite
Create tag if it doesn't exist - checked
Click on Import
The addresses and tags are imported.
A window showing the status of the import will be displayed. Click on OK when finished.

2. Importing PLC Program

To import ladder logic rungs contained in a library (.L5X) file: (This procedure also imports tags used in the ladder logic)

Place your cursor where you want the ladder logic to be added. It will be placed before the cursor. If you want to add it to the end of the program, place the cursor on the (End) rung.
Right-mouse the left side and select Import Rung..
Select the appropriate L5X file and click Import
An import configuration window appears. This is your opportunity to change tags, but normally not necessary. Check the extreme left side. Any tags already defined in the project will be indicated with a yellow triangle.
Click on OK Any tag collisions are also noted in the "Errors" window at the bottom of the screen.


0 comments :

Input/Output Forcing

For inputs, the force function allows one to override the actual status of external inputs by forcing individual discrete inputs to be ON or OFF. Input forces are written to the input image table and have no effect on the actual input. The value in the force table overrides the actual input. For example, if Local:0:I.Data.13 is forced to 1 (ON), it will appear in the input image and ladder logic as 1, regardless of the actual status of the device.

For outputs, the force function allows one to override the processor logic and force individual discrete outputs to be ON or OFF. Output forces are written directly to the output device and do not appear in the output image table. The value in the force table overrides the value in the output image. For example, if Local:4:O.Data.2 is forced to 1 (ON), the actual output will be ON, regardless of how it appears in the ladder and output image table.

One can program forces in one of two ways:

• Position the cursor on an instruction in the ladder program which references a real I/O address and from the right-mouse menu select Force On or Force Off.

• Edit the input or output force from the data monitor window. The force is in the “Force Mask” column. Set the force using either the tag name aliased to the physical I/O, or access the individual bit in the I/O module data tag. The current state of the force is indicated as:

(blank) there is no force for this address
1 address is forced ON
0 address is forced OFF

To change the force status of the bit, edit the entry in the “Force Mask” column.

To enable forces, locate the forces list box just below the mode selection box. Select Forces | I/O Forcing | Enable All Forces. A confirmation window will appear. Click on Yes.

To temporarily disable all forces, select Forces | I/O Forcing | Disable All Forces from the force list box. A confirmation window will appear. Click on Yes.

To remove all forces, select Forces | I/O Forcing | Remove All Forces from the force list box. You will be asked if you want to remove all forces. Click Yes to remove all forces.


0 comments :

Displaying Memory Locations

The watch window allows one to display and monitor a few tags without searching through the entire tag database. This feature is very useful for debugging program operation and mathematical operations. The display the watch window, select View | Watch from the RSLogix5000 main menu. The watch window appears below the ladder logic window. If the watch list is set to "Current Routine", all of the tags used in the displayed routine along with their current values are shown in the watch window. If the watch list is set to "Quick Watch", one specifies the tags to be monitored in the "Name" column.

To change the value of a tag in the watch window, double-click in the “Value” column. Now change the value.

To change the data of a tag, first display the tag. If it is a structure, you can only change individual structure elements. Click on "+" to show the elements. Use the mouse to put the cursor into the (white) value box, and type the new number, followed by <Enter>.

One can also display the tag values by browsing the Controller Tags or Program Tags. Double-click on the Controller Tags or Program Tags (depending on location of tag) to open the data monitor window. Click on the Monitor Tags tab to display the values of the tags.


0 comments :

Online Editing With PLC in Run Mode

The ladder logic program may be edited while the PLC is in the Run mode. A few more steps are required, since accepted rungs are not immediately executed. The process of online editing is illustrated by Figure 1. After rungs are edited, they must be tested and then assembled before the process is complete. If the edits are discovered to be unacceptable while in the "Test Edit" mode, the edits may be untested and modified, or cancelled.

While online editing a rung (edit, insert, replace, or delete), edit zone markers are placed in the left margin. These indications are explained below. While a rung is being edited, the zone markers are lower case, indicating that the edited rung exists only in the computer memory, not in the PLC. After a rung is accepted, the edit zone markers change to upper case letters, indicating that the edited rung is now in the PLC, but not being executed. Other rungs may be edited. After edited rungs are accepted, the old (R and D edit zones) and new rungs (I edit zones) co-exist in the PLC. However, only the old rungs are executed. The new rungs are skipped, indicated by the edit zone markers in the left margin.

To execute the new rungs, the edits must be tested (right mouse, Test Edits). While the edits are being tested, the new rungs (I edit zones) are executed and the old rungs (R and D edit zones) are skipped.

If the program operation with the new rungs is acceptable, then the new rungs should be assembled (right mouse, Assemble Edits). When the rungs are assembled, the old rungs are deleted from the PLC memory and the edit zone markers are removed.

If the new rungs are unacceptable, then the new rungs should be untested (right mouse, Untest Edits). When the rungs are untested, rungs are restored to their state before the rungs were tested. The old rungs (R and D zones) are executed and the new rungs (I zones) are skipped.

After the rungs have been untested, or before the edits are tested, the edits may be cancelled (right mouse, Cancel Edits). When the edits are cancelled, the new rungs (I zones) are deleted and the edit zone markers are removed.

Lower-case edit zone markers

e) (Offline and online) These rungs are currently being edited and are contained in the computer memory. If one is working offline, the edit zone marker disappears after the rung is successfully verified (right mouse button selection). If one is working online, the edit zone marker is changed to an upper-case I after the rung is successfully accepted (right mouse button selection).

i) (Online) These rungs will be inserted into the PLC program, but exist in the computer memory, not in the PLC memory. After the rung is successfully accepted (right mouse button selection) the rung is inserted into the PLC memory and the edit zone marker is changed to an upper-case I.

r) (Online) These rungs will be replaced in the PLC program. An r marked rung is always preceded by an e marked rung. After the e marked rung is successfully accepted (right mouse button selection) the r edit zone marker is changed to a R edit zone.

d) (Online) These rungs will be deleted from the PLC program. However, the lowercase d indicates that the deletion only exists in the computer memory. When the rung is accepted (right mouse button selection), the lower-case d is replaced by an upper-case D, indicating that the deletion exists in the PLC memory.

Upper-case edit zone markers

I) (Online) These rungs are inserted into the PLC program. To test the rung execution, select "Test Edits" (right mouse button selection). Select "Assemble Edits" to finalize rung insertion and to remove the edit zone markers.

R) (Online) These rungs are replaced in the PLC program. However, an R marked rung is still executed until "Test Edits" is selected. When "Assemble Rungs" is selected, the rung is deleted.

D) (Online) These rungs are deleted from the PLC program. However, a D marked rung is still executed until "Test Edits" is selected. When "Assemble Rungs" is selected, the rung is deleted.


0 comments :

Adding Comments to Ladder Program

Select the rung you wish to comment by placing the box cursor on the left power rail of the rung, or on any instruction in the rung.
Right-click on the left power rail for the rung
Select Edit Rung Comment
A window opens with a vertical cursor. Type descriptive text. Two consecutive <Enter> keys will terminate the comment.

To change an existing rung comment double click on the comment box and a text window opens with the comment. Make your changes. Click on the green check mark when finished.

To display the rung comments on the ladder logic display, the “Display page titles/rung descriptions" must be enabled. From the main menu:

Select Tools
Select Options...
Expand the Ladder Editor line
Select Display
Make sure "Show Rung Comments" is check marked

0 comments :

Counters

Counter blocks are placed in the ladder rung in much the same way as timers. To enter an up counter into a rung, first click on the CTU and position the arrow on the right side of the rung.

Click the mouse.
A CTU instruction will appear at the right side of the rung. A box with a cursor will appear.
Type the tag in the “Counter” field and press <Enter>
Type the preset value and press <Enter>
Type the initial accumulator value and press <Enter>

For other types of counter instructions are selected by clicking on the Timer/Counter tab and then the appropriate mnemonic (CTU, CTD, or RES (reset timer)).

Note: to refer to the counter done bit in a contact address, use "counter_tag.DN".

0 comments :

Timers

To enter a timer into a rung, position the cursor on the right side of the rung, or to the left of where you want to place the instruction.

Click on the Timer/Counter tab above the ladder window and click on TON.A timer instruction will appear at the right side of the rung. A box with a cursor will appear.

Type the tag in the “Timer” field and press <Enter>
Type the preset value and press <Enter>
Type the initial accumulator value and press <Enter>

Other types of timer instructions are selected by clicking on the Timer/Counter tab and then the appropriate mnemonic (TON, TOF, RTO, or RES (reset timer)).

Note: to refer to the timer done bit in a contact address, use "timer_tag.DN".

0 comments :

Entering Branches (Logical OR)

Change the processor back to program mode:

Click on the arrow to the right of "REMOTE RUN" box
Click on Program
Click on Yes

Either insert a new rung, or start rungs edits on an existing rung, placing the cursor on the instruction that will parallel the new branch. To start the branch:

Place the cursor on the contact that will parallel the new branch.
Click on the branch icon (looks like a “branch”) above the ladder window or right click the mouse and select Insert New Branch
A branch will appear to the right of the cursor with a blue box surrounding the right side of the branch
Place the mouse cursor on the blue box and hold down the mouse button as you drag the branch to the desired location of this side of the branch, usually on the other side of an instruction. The blue oval on the rung that changes to green indicates the location of this branch leg. Release the mouse button and the program will place the branch.

Instructions are entered on branches just as if they were a separate rung.

To make a series of parallel branches that have parallel sides (instead of nesting, which looks like an inverted tree), the branch is extended down.

Place the cursor on the lower left corner of the branch.
Right click the mouse
Select Extend Branch Down
A branch will appear below the existing branch and parallel with the existing branch.

0 comments :

Two Contacts in Series (Logical AND)

The first ladder program to be implemented will be a simple series control rung. Two switches, SW3 and SW4, will be placed in series and will be used to control a single light, LA1.

Use the right mouse button to access editing functions whenever possible. Clicking on the right mouse button brings up the editing menu with available options. The menu is different depending on the (box) cursor location. If the box is on the left rail of a rung, rung editing functions: accept, cancel, cut, paste, append rung, insert rung, etc. If the box is on an instruction, then instruction editing functions are presented if the right mouse button is clicked: append/insert instruction, insert/append branches, change instruction type, cut, paste, etc. As you place the instructions into a ladder program, one can either append or insert the instruction. Append places the new instruction to the right of the current cursor position, and insert places the instruction to the left. If the cursor is on the left power rail, append or insert will append or insert a rung. Appended rungs are placed below the current rung, and inserted rungs are placed abovethe current rung.

If ladder window is not displayed, double-click on “MainRoutine” under “Main Task” in the project window. Place the cursor (blue box) on the END rung. If not, click on the left rail of the bottom rung.

Click on the Insert Rung icon (├─┤). A new rung appears at the top of the screen with a blue box on the left. The "e" in the box indicates this is an edit zone. Now the individual instructions for the new rung will be entered.
A normally open (NO) relay contact is needed at the input, so click on the appropriate contact symbol (┤├) above the ladder window.
Move the cursor arrow tip close to the left side of the rung and click the mouse. The NO contact will appear with a box around it and a question mark above it.
Switch SW3 will be used first, so type the tag for that switch ("SW3") and press <Enter>. The symbolic and physical address of the relay that controls the contact will appear above the contact symbol on the ladder diagram.
Click on the ┤├ contact symbol above the ladder window and then click on the new rung to the right of the first contact and add a second NO relay in series with the first. Use the symbol or address for switch SW4 ("SW4") for this contact.

The output for this rung will be light LA1.

Click on the output coil symbol (-( )-) above the ladder window.
Move the cursor to the right side of the rung and click the mouse. A normal output coil symbol will appear with a box above it.
Type the symbol or address for light LA1 ("LA1").

Since the output instruction has been entered, the rung edits may now be accepted.

Click on the left rail of the rung. A blue box appears.
Click the right mouse button.
Click on Accept Rung Edits. Now the rung is loaded into the controller's memory. The "e" indications on the left side of the rung should disappear.

To change the processor to the run mode use the following keystrokes:

Click on the arrow to the right of "REMOTE PROG" box
Click on Run
Click on Yes

The controller is now set to respond to input conditions and perform appropriate output commands. The ladder power rails change to green, indicating the processor in the run mode.

Try the input switches in various combinations and observe the output. Also observe the changing status of ladder components on the screen. Energized or true conditions cause the elements to be highlighted on the ladder diagram.


0 comments :

Ladder Logic Programming

The OFFLINE/ONLINE box should show "REMOTE PROG" backlighted in blue. The steps necessary to program the first part of the experiment, the series rung, will be explained in detail. For the other parts of the exercise, only the different steps required to do these parts are explained.

1. Two Contacts in Series (Logical AND)
2. Entering Branches (Logical OR)
3. Timers
4. Counters
5. Online Editing With PLC in Run Mode

0 comments :

Processor Download

Click on the down arrow in the OFFLINE/ONLINE window. Select Download. A Download window will pop up. Click on Download. If a window pops up informing you that the communication configuration is different, click on Don't Apply. If a Save Project window appears, click on OK.

When a windows pops up and asks if you want to go Online, click on Yes. Skip to the online editing functions.

0 comments :

Starting a Project with the Controllogix

Wire the switch/light board before proceeding. Power up the computer, the PLC rack, and external power supply, as needed. Turn the key on the PLC to the REM (middle) position.

If RSLinx is not already started, then start the program. If the RSLogix5000 Programming Software main menu is not already displayed, click on the RSLogix5000 icon. The main menu screen should appear with a list of selections. If the error message "Project file does not exist! OK to create it?", click on "Yes". The software will start up in the offline mode and a ladder may be displayed.

Communications should already be set up properly. To check that they are properly configured, select Communications | Who Active. Click on "+" box next to "AB_DF1-1" since the ControlLogix processor is connected with a serial cable to the PC. A processor icon should appear with "1756-L61 LOGIX5561" or "1756-L63 LOGIX5563" and maybe a name of the current program in the processor. Click on Close.

If your project is already in the PLC, click on the down arrow beside the small window in the upper left (should have "OFFLINE") and select Go Online. A ladder diagram should appear. Skip to the online programming functions.

When starting a project for the first time, it is best to initially set it up offline, and then go online. The initial setup consists of specifying the processor and configuring the discrete I/O modules.

1. Configuring the Processor.
2. I/O Configuration.
3. Specifying Other Tags.
4. Processor Channel Configuration.
5. Processor Download.

0 comments :

Configuring the Processor

When starting a project for the first time, check and make sure the OFFLINE/ONLINE window (upper left side, below row of icons) displays "No Controller". From the menu bar select File | New, or click on the paper sheet icon. If you are prompted to close the current project, select Yes. A window titled "New Controller" is displayed.

Select the proper processor type in the first field, which should be:
- 1756-L61 ControlLogix 5561 Controller
- Select the proper revision level, 18.
- Type in a controller name.
- Select the proper chassis type (7- or 10-slot) and slot for the processor (probably "0").
- Select the proper directory in which the project will be saved (Should be
- "C:\Projects\RSLogix 5000").
- Click on OK.

The project data bases will be created. A project window and a large blank area will appear.

If in the G-22 lab, set up project communications. (If not in the G-22 lab, do this step before you download the program for the first time.) On the main menu bar, select Communications | Who Active. Click on "+" box next to "AB_DF1-1" since the processor is connected with a serial cable to the PC. Select the line with "1756-L61 LOGIX5561" or "1756-L63 LOGIX5563". Check box "Set Project Path". Click on Apply. Click on Close.

You are now ready to configure the I/O channels. The OFFLINE/ONLINE window displays "Offline".

0 comments :

I/O Configuration

Using the RSLogix software, configuration of the inputs and outputs involves two steps:

1. specifying modules in the rack
2. assigning tags to the I/O channels

The second step is not absolutely necessary, but it is easier to specify symbols now than when programming the ladder logic. The RSLogix programming software aids the programming of a PLC because one does not need to memorize the I/O addresses and file addresses, but can refer to them symbolically, as a label.

Right-click on the “1756 Backplane” line below the I/O Configuration folder in the project tree. A pop-up window will appear. Select New Module... A window titled "Select Module" will appear. Expand the “Digital” category (right-click mouse on “+” sign to left of “Digital”). To specify the I/O modules,

In the main part of the window, a list of available modules is displayed. Click on the type of module in slot 1 (a 1756-IB32/A). You may need to scroll to this line. Click on OK.
A window titled "Module Properties" will appear. Enter a name for the module (Suggestion: digital_in). Verify that the slot number is correct (slot 1) and make sure Comm Format is "Input Data".
Uncheck the “Open Module Properties” box
Click on OK to accept the default module configuration..
Slot 1 is now configured for a 32 point discrete input module.

Right-click on the I/O Configuration folder in the project tree and add a 1756-OB16I.
The steps are similar to the steps to add the discrete input module. When a “Select Major Revision” box pops up, select “1”. Make sure the module name is different from the discrete input module. The Comm Format should be "Output Data".

The I/O Configuration folder should have the following subitems:

[1] 1756-IB32/A discrete_in
[2] 1756-OB16I discrete_out

Now assign tags to the input channels. Double-click on the Controller Tags line in the project tree window (should be second line). The Controller Tags window will appear. To assign symbols to the discrete input channels,

Click on the Edit Tags tab.
A table will appear with a white last row. New tags are entered in the last (white) row.
Type your tag name, in this case "Start_PB" in the Tag Name column and press <Tab>.
Click on the down arrow in the Alias For column.
Click on "Local:1:I" and click on the "+" to display the members of this structure.
Click on "Local:1:I.Data" and then on the down arrow.
Click on the proper bit ("0" in this case).

Click on the entry for the Description. The Type for "Start_PB" should change to BOOL. Type in a description in the box, for example, "Start push button switch" and then press <Enter> or click back on the box in the Description column.
Repeat the above 6 steps to specify the tags and descriptions for the other input and output channels.

Now some of the other tags need to be defined.

0 comments :

Specifying Other Tags

It is good practice to enter all of the tags (variables) before you start programming. If you enter a rung with undefined tags, errors will be reported. At that point, you can enter new tags into the program and clear the verify errors.

In a similar manner as done for the I/O tags, type in tags for a few timers, counters, and booleans.

For timers, the data type is TIMER.
For counters, the data type is COUNTER.
For booleans, the data type is BOOL

Now the processor channel information must be specified.

0 comments :

Processor Channel Configuration

For the processor, the baud rate of the serial port must be set to match the baud rate in the RSLogix communication configuration.

Right-click on the Controller (top line) folder in the project tree window.
Select Properties
Select the Serial Port tab
Make sure the baud rate is 19200.
Click on OK when finished.

Now the processor needs to be downloaded with the blank ladd.

0 comments :