Click here to learn the biblical way to get to heaven! (The most important page on this site)


Disclaimer: This document is written in the hope that you can utilize for your own education to gain knowledge of PLC systems (should you decide to utilize this document). Although I believe the information in this document to be accurate, it is YOUR responsibility to verify this information before implementing it in any way, especially when damage to personnel or equipment could result. By continuing to read this document, you agree to hold no one who writes, modifies, or distributes this document liable in any way (even negligence). Due to the wide variety of plant applications, some of the examples in this document may be prohibited at your location, or could cause damage to equipment, or harm personnel.
[Visit my Church Website] -- [Return to Index Page] -- [View Training Courses] -- [Contact ATI for Training] *Copyright 2005
Author: Ricky Bryce (Montgomery County, IL)
VPS Hosting Referral Code MJDCDJYou can have your very own virtual server though VPSLink! Using REFERRAL code MJDCDJ you will receive a 10% discount on your new account, and I will get a service credit on my account. My personal preference is the Link 2 package running XEN for starting out (You can upgrade any time). You can choose from a variety of Linux distributions such as CENTOS, Fedora, Debian, and Ubuntu. This is a great package for learning Linux, and setting up your own web page, or email server.

Getting Started with Structured Text in RSLogix 5000


For complex algorithms, ladder logic can be too cumbersome and time consuming to program. A higher level programming language can greatly simplify your calculations. Variables can be assigned, and operated on, and loops can be used for multiple operations in the same scan.


With object oriented programming quickly becoming a standard, more programmers are beginning to use structured text as the primary means of programming PLC's. Ladder logic is based on many of the same concepts as Assembly Language. Higher level programming languages are available today eliminating the need to program with ladder logic. When this happens, those who troubleshoot and program PLC systems must be able to decipher a structured text routine.


To create a new structured text routine, right click on a program, and add a new routine as shown.





Name the routine, and specify the type as a Structured Text Routine.






Be sure to add a JSR statement to the MainRoutine so this subroutine will execute.





If you aren't use to structured text, at first these examples will seem a bit cumbersome and hard to get used to at first, but working with multiple addresses, and performing complex operations at once is much easier and simpler.






The comment flags allow you to document the structured text program. (Note: // can be used to comment a single line as well)







The IF conditional checks an expression. If the expression immediately following the IF statement returns a 1, the operation after the THEN statement will be executed. If the expression returns a 0, the operation after the ELSE statement will be executed.



In this example, if Switch 0 is ON, Light 0 will be turned on... If Switch 0 is off, light 0 will be shut off.








Here is an example of a Timer On Delay with Reset:




STXTimer and STXTimerReset are declared in the tag database:





You can now download and test your work.



For more information on Structured text, please read AB document #1756-PM001.