You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old April 20th, 2017, 04:24 AM   #61
Ravioli
Member
United States

Ravioli is offline
 
Join Date: Dec 2015
Location: United States
Posts: 39
Quote:
Originally Posted by SoftwareJanitor View Post
And colorization IS a nice feature, I'll admit that, but I don't see why ST couldn't do the same thing. If it's a boolean variable and it's ON, then show the variable name in bright green.
Colorization would be fantastic if added to RSLogix, to at least show the value of BOOLs. Right now hovering over a tag will tell you at that time what the value is, but doesn't update unless you move off and move back. Plus if you're looking at 6 conditions for a machine to change state, it can be hard to monitor vs. in ladder where you can see the inputs come in as they happen. There's no reason they couldn't add this colorization, but they haven't, and that's what cripples ST for troubleshooting. SFC at least highlights the active step.

Another good thing with Ladder, is when other constructs are used (counters, timers, messages), you also see what the accumulator and preset values are as they come in, if it's in error, DN, etc.

Quote:
Originally Posted by SoftwareJanitor View Post
Good point about use of JMPs and LABELS. It's just not considered good programming practice. Leave that stuff to the compiler writer.
Excessive JMPs can be hazerdous in a PLC program cause done improperly they can lead to watchdog fault, if you never leave your loop


Quote:
Originally Posted by SoftwareJanitor View Post
As to your reply regarding the "popularity" of Ladder logic, I really believe Ladder has survived because Industrial Controls programming (for whatever reason) has lived in a vaccum all these years, while conventional programming languages have continued to evolve. Windows OS is not written in Ladder logic. No application that runs on your phone is written in Ladder Logic. Ladder Logic is not "popular", it's just a niche "language" that evolved for PLC processors out of the early days of relays. But instead of moving mainstream with the PLC programming language, Rockwell chose to expand Ladder to include Function Blocks, then user-defined Function Blocks, and that's about it. And while Ladder was probably readable in the early days, it's gotten too convoluted with all the rungs extending down the screen, and all the awkward wiring connections you have to insert when IFs start getting more complicated.
Industrial controls probably exist in a vacuum because products have really long lifecycles. So much time and cost goes into building any given custom PLC panel and program, upgrades can be hard to justify, as it can easily costs hundreds of thousands to upgrade a complex system, with no major improvement in functionality since the mechanical system it's controlling is the same. For this reason we have PLC2 ladder programs that were converted to PLC5 programs, and we're struggling to get funding to convert to ControlLogix as PLC5 is approaching its sunset date.

With ladder it's probably more readable now because high resolution monitors are so common place vs text based 6200 software, or handheld programmers.

Use the right tool for the job. We have programs that use a combination of ST, SFC, and LD.

ST for algorithms, and initialization code
SFC to control the main state of the process (with steps that aren't that complicated)
LD dealing with the actual IO.

Usually when maintenance are in, they are looking at the IO in the ladder, as that's where the problem usually resides. This combinations leaves maintenance happy because they can still troubleshoot their ladder, and leaves the programmers happy because they can use ST.
  Reply With Quote
Old April 20th, 2017, 11:03 AM   #62
keshik
Lifetime Supporting Member
Canada

keshik is offline
 
Join Date: Jun 2011
Location: Portland, OR
Posts: 327
Quote:
Originally Posted by SoftwareJanitor View Post
keshik:
====
Rockwell has a "bad ST editor"?? What's so bad about it? Are you saying it doesn't continuously check for errors (like Visual Studio and any decent editor nowadays does)?
I mean bad in several ways. One is the way that the editor functions. In Studio 5000 as far as I can tell, you can't make online edits with it (which will make your life terrible in a production environment). You can't see the actual value of a tag without using a watch window. In Codesys I believe that online edits are an option (depending on the actual hardware). As well, you can see the status of all of your tags at run time as well without having to use the watch window.

Also, different manufacturers implement structured text differently. Just because some instruction is used in Codesys doesn't mean that you can use that same instruction in Studio 5000. If you go back in time a bit on Peter's posts you will see some of his comments about it in regards to how different vendors match up to the actual standard.

That all being said, I used to use ST almost exclusively when I was working with Codesys systems. This is a combination of (in my opinion at least) that their implementation of ST is pretty good and ladder is pretty bad. I was also the only person who was maintaining those systems. Now I'm at a different company where I use Rockwell and I pretty much exclusively use ladder. I'm pretty sure I would get myself in some hot water if I used anything else as there's a lot more people here that would also support these systems.
  Reply With Quote
Old April 20th, 2017, 11:07 AM   #63
dmargineau
Lifetime Supporting Member
United States

dmargineau is offline
 
dmargineau's Avatar
 
Join Date: Dec 2011
Location: Midwest
Posts: 2,255
Quote:
Originally Posted by keshik View Post
I mean bad in several ways. One is the way that the editor functions. In Studio 5000 as far as I can tell, you can't make online edits with it (which will make your life terrible in a production environment). You can't see the actual value of a tag without using a watch window.
Really?!......As far as you can tell...
  Reply With Quote
Old April 20th, 2017, 11:17 AM   #64
keshik
Lifetime Supporting Member
Canada

keshik is offline
 
Join Date: Jun 2011
Location: Portland, OR
Posts: 327
Quote:
Originally Posted by dmargineau View Post
Really?!......As far as you can tell...
I haven't figured out how to do it, though I haven't tried super hard to, as I haven't used much ST in Studio 5000.

Worst case I suppose you can do the same trick that you do with AOIs, is to make a new AOI/routine with a different name (and your changes), import it, and then change your JSR. What could go wrong doing that?
  Reply With Quote
Old April 20th, 2017, 11:20 AM   #65
keshik
Lifetime Supporting Member
Canada

keshik is offline
 
Join Date: Jun 2011
Location: Portland, OR
Posts: 327
Well, I'm wrong about that. From the Online Help:

Quote:
About Structured Text Online Editing
The Logix Designer application allows you to make online edits to your structured text routines from within the Structured Text editor window. To make an online change, simply start a pending edit from within the routine.
  Reply With Quote
Old April 20th, 2017, 12:31 PM   #66
Remrun
Member
United States

Remrun is offline
 
Join Date: Nov 2014
Location: Louisiana
Posts: 12
You can make online edits in structured text. Been a while but I have done it.
  Reply With Quote
Old April 20th, 2017, 12:44 PM   #67
Ken Roach
Lifetime Supporting Member + Moderator
United States

Ken Roach is offline
 
Ken Roach's Avatar
 
Join Date: Apr 2002
Location: Seattle, WA
Posts: 13,386
I don't particularly enjoy doing online edits to Studio 5000 ST routines, because the editor as acting on the whole sheet, not just one one line like it would in an RLL editor.

It tends to be a little laggy (on my VM, which is the only environment I use) because it's continuously updating the syntax checks for the whole sheet as I type.

So when I make wholesale changes to a ST routine, I copy it out to Notepad++ then copy the whole thing back in.

The hovertext feature does work well to show tag details (including the current value), and I'm not really sure how I'd feel about active colorization because I've never seen it done.
  Reply With Quote
Old April 20th, 2017, 03:26 PM   #68
Ravioli
Member
United States

Ravioli is offline
 
Join Date: Dec 2015
Location: United States
Posts: 39
Quote:
Originally Posted by Ken Roach View Post
The hovertext feature does work well to show tag details (including the current value), and I'm not really sure how I'd feel about active colorization because I've never seen it done.
I don't know about in newer versions, but in Version 20, when the tooltip pops up it will show the value at that time, but not after that. I just checked and verified this was the case by hovering over a timer.acc value. The timer was counting up, but the displayed "value" doesn't update.

Colorization might be a good optional feature. Much like autoscroll in SFC.



Also, online edits are started by clicking the far left icon in the editor (paper with pencil) "Start Pending Routine Edits"

Last edited by Ravioli; April 20th, 2017 at 03:28 PM.
  Reply With Quote
Old April 20th, 2017, 03:36 PM   #69
dmargineau
Lifetime Supporting Member
United States

dmargineau is offline
 
dmargineau's Avatar
 
Join Date: Dec 2011
Location: Midwest
Posts: 2,255
Quote:
Originally Posted by Ravioli View Post
I don't know about in newer versions, but in Version 20, when the tooltip pops up it will show the value at that time, but not after that. I just checked and verified this was the case by hovering over a timer.acc value. The timer was counting up, but the displayed "value" doesn't update.
The statement you have quoted refers to Online ST (Structured Text) programming tooltip.

Your example is LAD; the Accumulator value is real time displayed within the TON instruction graphic block.
  Reply With Quote
Old April 20th, 2017, 03:44 PM   #70
keshik
Lifetime Supporting Member
Canada

keshik is offline
 
Join Date: Jun 2011
Location: Portland, OR
Posts: 327
Quote:
Originally Posted by dmargineau View Post
The statement you have quoted refers to Online ST (Structured Text) programming tooltip.

Your example is LAD; the Accumulator value is real time displayed within the TON instruction graphic block.
Look at the top part of his screenshot.
  Reply With Quote
Old April 20th, 2017, 03:55 PM   #71
dmargineau
Lifetime Supporting Member
United States

dmargineau is offline
 
dmargineau's Avatar
 
Join Date: Dec 2011
Location: Midwest
Posts: 2,255
Quote:
Originally Posted by keshik View Post
Look at the top part of his screenshot.
And?!

'timer1' is configured and running in LAD; you're looking at it.

There is no TON in ST programming?! ST timing is using the TONR.

Configure a TONR in ST, get it running and hover the pointer over the Accumulator; you will see the real time value.
  Reply With Quote
Old April 20th, 2017, 07:05 PM   #72
Ravioli
Member
United States

Ravioli is offline
 
Join Date: Dec 2015
Location: United States
Posts: 39
It doesn't matter WHERE the tag is set, when you hover over a tag in an ST program in RSLogix 5000 v 20 (can't speak to newer), the tooltip does not update after it first appears.

Observe a TONR timer. I have the Program tags window open, and a trend of the ACC, showing that yes the timer is functioning, and the trend ACC value matches program tags. The tool tip is frozen to a value from several seconds earlier.

  Reply With Quote
Old April 20th, 2017, 10:06 PM   #73
Ron Beaufort
Lifetime Supporting Member
United States

Ron Beaufort is offline
 
Ron Beaufort's Avatar
 
Join Date: Jul 2002
Location: Charleston, SC
Posts: 5,318
frankly I've been trying to steer clear of this thread – because it's rather obvious that many (most?) of the contributors have clearly made up their minds - and there's no way to change their opinions ... (Ford? or Chevy?) ...

but ...

there have been a couple of posts that have offered some programming techniques that (at least in SOME cases) MIGHT (that's MIGHT) present an unsafe condition ...

I've decided to at least mention these – for anyone who might not be aware of what evil lurks just under the surface of this particular pond ...

in the figure below, we have three separate pumps – which have been programmed by three separate programmers ...

PUMP_A has been programmed in Relay Ladder Logic using a very common "seal-in" type of construction ...

PUMP_B has been programmed by a programmer who was trying to come up with the same functional operation – but by converting the same "seal-in" type of construction to its equivalent in Structured Text ...

PUMP_C has also been programmed to give exactly the same operation – again by trying to duplicate the Ladder Logic's "seal-in" construction in the equivalent Structured Text format ...

(note that the STOP button is wired Normally-Closed in the field) ...

so ...

when the boss comes around to check the operation of the pumps – he is pleased with the results ...

each pump starts running when the START button is pressed ...

and each pump keeps running when the START button is released ...

and each pump quits running when the STOP button is pressed ...

and each pump remains stopped when the STOP button is released ...

specifically, all of the pumps "meet the specifications" which the programmers were trying to achieve – at least in normal day-to-day operation ...

but ...

suppose that all of the pumps happen to be running merrily along – and then the ControlLogix processor has a "Go-To-Run" experience ... (you can test this situation out by just switching the processor from the RUN mode – to the PROGRAM mode – and then back to the RUN mode again) ...

naturally all three of the pumps turn OFF while the processor is in the PROGRAM MODE (as expected) ...

but oops! ...

when the processor is placed back into the RUN mode, we're surprised to find that PUMP_C comes back ON again ... the other two pumps do NOT come back ON until the START button gets pressed ...

so ...

is the UNEXPECTED and SURPRISING start-up of PUMP_C a "big deal?" ...

well, in many (most?) cases – probably not ... but then again – in some cases (maybe just a few) this effect could lead to a very dangerous situation ...

in any event, the words "UNEXPECTED" and "SURPRISING" are seldom (if ever) welcome additions to a PLC programmer's vocabulary ...

the reason for the difference in the operation of PUMP_C relates to the little [square bracket] characters around the := "assignment" element ...

naturally there's more to it than this – but here's a quick down-and-dirty explanation ...

[:=] makes a simple NON_RETENTIVE assignment ... (which is treated similar to an Output Energize instruction during the processor's PRE-SCAN operation) ...

:= (on the other hand) makes a RETENTIVE assignment (similar to a Latch or an Unlatch instruction) – and so the processor's PRE-SCAN operation doesn't automatically tell this type of element to go write into its bit/box during a "Go-To-Run" event ...

anyway ...

many people begin writing their Structured Text code without knowing that there can be differences in operation between the two "assignment" elements – and the results of those differences can be quite "spectacular" in some cases ...

party on ...
.
Attached Images
File Type: png STX_vs_RLL.PNG (30.4 KB, 79 views)
__________________

2-B ?
Best regards, ----+----] [----+------------( )----
Ron | |
PLC Training Boot Camp | 2-B |
+----]/[----+

I once was lost, but now am found, was blind, but now I see.


Last edited by Ron Beaufort; April 20th, 2017 at 10:28 PM.
  Reply With Quote
Old April 21st, 2017, 12:03 AM   #74
Epy
Lifetime Supporting Member
United States

Epy is offline
 
Epy's Avatar
 
Join Date: Jul 2012
Location: Allen-Bradley Valley
Posts: 371
Thanks for that Ron! Didn't know that.

For others who were also intrigued by this, see page 13: http://literature.rockwellautomation...m007_-en-p.pdf
__________________
Quote:
Originally Posted by ganutenator View Post
customers:
I don't know how to do it so it must be easy
  Reply With Quote
Old April 21st, 2017, 07:16 AM   #75
FactoryTalktotheHand
Member
United States

FactoryTalktotheHand is offline
 
Join Date: Nov 2013
Location: Michigan
Posts: 494
Personally, I would only use Structured Text for handling large arrays of data, in code that once you get hashed out never really needs to be looked at again. If you're doing a bunch of internal math, techs don't really need to see that (just make sure it works). But anything with real-world I/O should be done in Ladder or Function Block.

Last edited by FactoryTalktotheHand; April 21st, 2017 at 07:19 AM.
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
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 04: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 10:10 AM


All times are GMT -5. The time now is 08:55 AM.


.