Which Task To Run My Ladder Logic Program?
Placing a program in a task simply lets the processor know when to run your ladder logic program.
In order to place your program in the proper task you need to know when your program should execute. Ask yourself the following questions:
- Should the program run continuously when the controller is powered up over and over until the end of time?
- Should the program execute once every two minutes, or once every 25 milliseconds?
- Should the ladder logic program execute in response to an external event like someone pressing a button?
- Should the program have priority over other programs in the project, or should it have the lowest priority? [click to continue…]
Creating String Data Types For Use In Ladder Logic
A string is a User-Defined data Type or UDT with two members.
The two members or elements of the data type consist of a DINT used to store the length of the string and an array of SINT’s that store the individual characters of the string. By default the ladder programming software has a Pre-Defined String type named STRING. The default STRING data type cannot be changed, however you are welcome to make as many different User-Defined Strings as you need. The only variables that can be changed when creating a User-Defined String are the name and size of the array that holds the individual characters. [click to continue…]
How To Create User Defined Types For Use In Ladder Logic
User Defined Types allow you to create your own structured tags. So what! I mean really, what’s the big deal?
For starters structures allow you to create a more organized program with descriptive tag names which are intelligently grouped. User Defined Types, when organized properly, take less processor memory. Less memory means faster execution; this gets important when things like redundancy and scan time become critical. UDT’s allow code to be more portable, less prone to syntax errors, more readable as well as easier to modify. [click to continue…]
Getting The System Time Using Ladder Logic (GSV)
To get the Time/Date from the PLC it is necessary to retrieve the data with a Get System Value (GSV) instruction.
Simple enough right? Good, let’s dive in. The first thing you need to do is drag a rung and GSV instruction into the ladder editor. I plan on updating my time structure every processor scan so I will put the GSV instruction on an unconditional rung, which is a rung without any preceding instructions or logic. Your logic should look like the picture below. [click to continue…]
How To Force IO In Ladder Logic (RSLogix 5000)
Forcing IO is one of the handiest ways of troubleshooting logic and checking peripheral devices.
Before you start forcing things lets look at some of the “Dos and don’ts” when forcing IO. [click to continue…]
How To Use The Ladder-Logic Cross Referense Tool (RSLogix 5000)
The ladder logic cross reference tool is without a doubt the feature I use most.
Back in the day if you wanted to run a cross-reference on tags you had to go through an actual paper printout made from a dot matrix printer. The cross-reference print out could fill an entire box. I would grab post it notes and mark the various places the bit was used. What a nightmare.
Thankfully technology has changed PLC’s for the better. Now cross-referencing is done with the click of a button. All instances are displayed and hyper linked. [click to continue…]
Pasting Neutral Text Into The Ladder Editor
The following code is the textual equivalent to the more familiar symbolic ladder logic.
Below is the graphical representation of the above text. The code above can be copied and pasted into the ladder editor. Click on the images to make them larger. [click to continue…]
Ladder Logic Input Filter
The De-Bounce circuit filters chatter or noise and produces a consistent output signal.
This is a useful circuit for filtering “noisy” input signals and can be used for many applications. The circuit can be used for sensors, noisy communication signals or any number of peripheral devices.
The ladder circuit is comprised of three rungs. The first two ladder rungs filter both states of the input. The last ladder rung incorporates the two filtered inputs and provides a single filtered output. Click on the images for a full size view. [click to continue…]