![]() ![]() ![]() ![]() ![]() ![]() |
||
![]() |
||
![]() ![]() ![]() ![]() This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc. |
||
![]()
|
New Here? Please read this important info!!!
![]() |
#1 |
Member
![]() ![]() Join Date: Dec 2016
Location: Southeast
Posts: 134
|
ControlLogix: Ladder vs. Structured Text
With this upcoming project, since I am really a "C"/"C++" programmer and *not* a PLC/Ladder programmer, I would like to use Structured Text for my logic.
So just for the fun of it, I re-wrote a couple of ladder programs here in "C" just to see what they'd look like, and it turned out to be a thousand IF statements with some embedded PIDs and Timers (an oddball-looking program, I'd say). Anybody here using Structured Text with ControlLogix? Can the entire thing be written in Structured Text, or do you still have to cross over to another model in order to use certain macros? |
![]() |
![]() |
#2 |
Lifetime Supporting Member
|
Most of LAD programming instructions are available in ST, however, some are not; if your application requires OSRs, OSFs, TONs, TOFs, RTOs, CTUs, CTDs ( just to name a few), you will also need to implement LAD programming routines in addition to ST.
I/O processing with ST is like commuting to work using a thirty foot mobile home... ![]() Last edited by dmargineau; April 17th, 2017 at 02:53 PM. |
![]() |
![]() |
#3 |
Member
|
Maintenance and production will hate you
If you do it in what you want, maintenance and production will hate you. In a real life troubleshooting world 1000's of IF statements will make your head spin. A ladder that is broken down to a area of machine will make it easy to troubleshoot. That is why they are so widely used, ST is great for a complex TASK, but thats about it.
__________________
Work safe, have fun, don't die |
![]() |
![]() |
#4 |
Member
![]() ![]() Join Date: Feb 2015
Location: Houston, TX
Posts: 224
|
Only fairly involved math operations that require several steps. Other than that, no.
Probably good idea if you're in integrator/contractor and your trying to obfuscate your code to ensure call backs and more billable hours from a customer (not that it can't be done in ladder). But either way, after that you'd be on my blacklist.
__________________
This statement is false. |
![]() |
![]() |
#5 |
Member
![]() ![]() Join Date: Dec 2006
Location: Montgomery, Alabama
Posts: 467
|
Some of the worst PLC programs I've seen were written from "true" programmers. Most plant personnel will not understand anything but ladder. Perhaps you are good at c programming, but there is a trick to ladder and it really only comes with experience. Just remember the customer in whatever you choose.
|
![]() |
![]() |
#6 |
Lifetime Supporting Member
![]() ![]() Join Date: Aug 2008
Location: Indiana
Posts: 92
|
I have never programmed in structured text, though I've done troubleshooting and rework with quite a few programs that have it. In my experience there is always a mix of text and ladder in a program. I've been told by a couple of programmers that I know that use structured text, that you "can" do the whole thing in text, but it's easier to go with ladder for some things.
From my viewpoint, (as the guy that normally comes in later on to repair or modify the original equipment) if I saw that the entire program was done in structured text, you would be able to hear me cussing from five miles away. That's just my opinion though. ![]() |
![]() |
![]() |
#7 | |
Member
![]() ![]() Join Date: Oct 2010
Location: Argentina
Posts: 676
|
Quote:
OSR -> OSRI OSF -> OSFI TON -> TONR TOF -> TOFR RTO -> RTOR
__________________
"If you can't solve a problem, then there is an easier problem you can solve: find it." (George Pólya) |
|
![]() |
![]() |
#8 |
Lifetime Supporting Member
|
|
![]() |
![]() |
#9 |
Lifetime Supporting Member
![]() ![]() Join Date: Jan 2006
Location: WI
Posts: 2,063
|
The problem is that the OP doesn't know the Logix platform very well at all, and is starting from scratch on a rather large project resulting in a non-traditional approach.
ST has it's place, and for the fun of it I've taken logic used previously done in ladder on a ControlLogix for use in batching and re-did a lot of it in ST. The objective was to learn a bit of Codesys, in which I decided the ladder editor on that platform wasn't great so I decided what the hell, learn some Codesys and mess around more with ST. Because of my experience in this area, and having good structured methods to begin with applying that knowledge to ST came pretty easily, I did have some challenges but I did find some advantages too it, which was more due to the Codesys platform. Primarily the ST editor is much nicer and I could define a simple function (No Logix equivalent) rather than function block (AOI). I even built in an equivalent to the Logix "Phase Manager" functionality. I was actually pretty surprised, the ST logic is pretty "clean" however this was due to already working from established standards and methods of handling large process systems. So yes, it can be done. But be prepared for being responsible for this 100% even 1-2-5yrs after the fact. |
![]() |
![]() |
#10 |
Member
![]() ![]() Join Date: Oct 2007
Location: Tennessee
Posts: 2,316
|
this is what I would do.
See what programs are on the plant floor - ladder versus structured text. find out how many maintenance guys know structured text and are comfortable with trouble shooting. see what the company specification and requirements are for programs. get with management, engineering, and maintenance and get an agreement on how to proceed. if they say ladder, ladder it is. if they want structured text, then st it is, and if no one in maintenance can work on it, and production suffers, everyone in the meeting gets the blame, not just you. BUT, you will be the one getting all the calls! Remember, maintenance can be your best friend or your worst nightmare! you can't just throw something at them and expect them to work on it, you need to work with them and explain things. james |
![]() |
![]() |
#11 | |
Lifetime Supporting Member
![]() ![]() Join Date: Jun 2012
Location: Australia
Posts: 2,777
|
I have customers that outright ban ST in their procurement specification.
I have other customers that will accept ST as long as the price your company is quoting includes 24/7 remote troubleshooting support for 5-10 years after the machine is purchased for any issues that can't be immediately diagnosed using the HMI. I have customers that couldn't care less what language you program your machine in, as long as it works. I have customers that will have their technicians review your code as soon as you hand over the job, and if it's poorly written (no matter what language you chose), your company will not be favourably looked upon for the next round of tenders. The common theme here is that it makes no difference what I like doing inside my PLC, I do what the customer wants. They're the ones paying me to do it, and if they don't like what I'm doing, they don't have to pay me. If your customer will accept ST, and the resulting ST code is clear, concise, and easy to follow for a suitably skilled maintenance technician (who I can almost promise you, will not be a C++ programmer), then go for your life. If not, you'd have to spend a long time convincing me that it's a good idea. Also: Quote:
![]() |
|
![]() |
![]() |
#12 | |
Lifetime Supporting Member
![]() ![]() Join Date: Jul 2012
Location: no
Posts: 371
|
Quote:
I think your strategy depends on your industry. There are some places where it is expected that the customer's employees will tinker in your program. In others, such as OEM, it's the complete opposite. You don't want to make it easy for people to tinker in your program in the first place. |
|
![]() |
![]() |
#13 | |
Member
![]() ![]() Join Date: Dec 2006
Location: Montgomery, Alabama
Posts: 467
|
Quote:
|
|
![]() |
![]() |
#14 |
Member
|
I should say that in my experience "jumping" the regular program scan order is considered in the PLC world just as bad practice as using GO TO statement used to be considered in Basic, Visual Basic etc. Each has its use but better to be avoided for clarity.
Modern PLC processors are typically fast enough so not to worry about the execution times and not to skip sections of the code with jumps. Just my two cents.
__________________
Don't trust, don't fear, don't beg... |
![]() |
![]() |
#15 | |
Member
![]() ![]() Join Date: Dec 2006
Location: Montgomery, Alabama
Posts: 467
|
Quote:
|
|
![]() |
![]() |
Bookmarks |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Which programming method is better - ladder logic or structured text | sinha_nsit | LIVE PLC Questions And Answers | 32 | February 29th, 2016 11:47 AM |
RS Logix Structured Text | JasonWade | LIVE PLC Questions And Answers | 22 | July 28th, 2014 05:19 PM |
why use structured text and function block over Ladder | spidermonkey | LIVE PLC Questions And Answers | 46 | January 8th, 2013 10:02 AM |
Structured Text on a PLC-5 | antjon1 | LIVE PLC Questions And Answers | 6 | March 30th, 2006 01:05 PM |
Documentation on Structured Text | cmulder | LIVE PLC Questions And Answers | 13 | June 11th, 2003 11:10 AM |