Sign in to follow this  
Followers 0
markn

When to use STL programming?

19 posts in this topic

Hi Folks, Pardon my question as I am a rookie. I have been reading about using STL programming described in the FX programming manual, and I think I have an grasp about how it works. It appears that a program written with STL is simular to using conditional statements when programing with BASIC. Am I wrong? Regards.

Share this post


Link to post
Share on other sites
I would also look at SFC. It is supported by Mitsu and is one of the 1131 languages. The manual gives a good example and explains the different blocks and branches. It is well suited for sequencing and state programing. A lot of standards recommend it for sequencing (S88 and PackML). I see it as a powerful language and try to use it often. Though I have yet to meet another programmer that has. Check out the poerpoint from OMAC, it will give you a brief overview: http://www.omac.org/OMACTemplate.cfm?Secti...ContentID=49260 Regards, Craig

Share this post


Link to post
Share on other sites
My experience in Mitsubishi has been all ladder logic, but just this past week I was introduced to SFC. When it comes right down to it, STL and SFC are the same thing. STL is done in ladder logic, but allows you to break the code into a sequences. SFC is just a visual way of laying out STL, and I think much the better for it. I tried STL a while ago, but didn't like it because for me, it just complicated the code. SFC, does a much better job of breaking the code into chunks, especially since it physically uses ladder code in the blocks. I am planning to dig into it some more in the future.

Share this post


Link to post
Share on other sites
Hi Guys, Thanks for the replies, one of the things that is not clear in reading the manual about STL programming using GX developer, is how to actually enter the code aside from entering in the ladder logic mode. Are there an info on using the tools and functions of STL (SFC) while programimg with GX?

Share this post


Link to post
Share on other sites
STL is a fantastic tool and I use it all the time. There are however some pitfalls that you should be aware of. On the newer FX models all the states are retentive (they didnt used to be) and so on a power cycle you should be aware that the last active state will still be on. I use a zone reset (ZRST) on power up. Make all the steps little ones, break larger steps down. describe in words what your cycle will do and name each state before you program Try leave at least 10 spare steps between steps so that later you can add extra steps in sequence. Try only using only M relay outputs within states and use this M relay to operate Y outputs outside of the states. This makes hand/auto very easy to program A lot of programmers are scared of STL programming - but with preperation and practice it is easy to program and easy to read fault find ie man raise auto mode --| |---------|/|--------(Y0) ..X0......|.........arm valve --| |-----| ..M0 auto raise arm ----------------------[STL S20] --| |----| |-----------(M0) ......................auto ...................raise arm ----------------------[STL S30] etc

Share this post


Link to post
Share on other sites
I don't have a lot of Mitsui experience but I want to add one comment. When considering SFC or STL or any programming method other than good ole relay logic or ladder logic as it is now called. Don't forget most maintenance men are taught relay logic and that is all some were taught. SFC may look and be cool if you know it, but to the poor guy trying to figure out why the machine won't make widgets at 3 am it can just be a pain. Don't forget we always write code for at least two audiences. Audience one is the production people who want the machine to run and make widgets. Audience two is the maintenance people who must keep it running when we aren't there.

Share this post


Link to post
Share on other sites
I would agree we write for two (or more) audiences, but I have had very good acceptance from our maintenance and technician staff when using SFC. The monitor on an Mitsu SFC immediately goes to the code that is currently being run for the SFC. This alows the person to get to the piece of code quickly. When there, it is in ladder logic, so there are no new learnings. With small programs this is not a problem, but for multi axis or process machines, finding the piece of code that is causing the problem is usally the most inefficient part of troubleshooting. Of course on a well designed system going online should be the last resort. I see SFC as another tool in the arsenal. It is very good for organizing code and provideing an overview of the process. I think all the 1131 languages have a place and each one is better suited for different problems. Just my two bits, everbodies experiences are different. Of course learning something new takes time, but I think it is worth the effort. Craig

Share this post


Link to post
Share on other sites
I cannot emphasize it too much - but STL is actually easier for a maintenance guy to follow than comlicated logic. That is, if you lay the program out in a logical and sequencial manner. Take a common 'pick n place' program. You can put all the steps on one line for monitoring. The active step will be shown. Each individual step should be error trapped and the next step not allowed until all conditions have been met Its very easy to automatically switch from auto to manual and very easy to group all the outputs together (the M relays have allready been error trapped) The maintenance man can see very quickly where the problem is.

Share this post


Link to post
Share on other sites
Hi Goody, Thanks for the illustration, I'm with you on the ease of understanding. The problem I am having is inputing the info using GX developer. I have started a new program with the STL method checked off, and GX open with what appears to be a STL type chart, so I click on the first box(which I assume is a state), everything is ok till I try to program the Ladder diagram, input an NO contact the when I go to program an output I get an error which reads something like" wrong format or cannot perform a move from this contact. Thanks,

Share this post


Link to post
Share on other sites
I used to use STL programming a lot, especially back in the old days when an F1 was a state of the art PLC. Those were the days with no data registers as such and only about 24 (or was it 32?) timers. I used to write a lot of code for food processing cleaning systems and these normally were sequential and involved a lot of timers waiting for things to happen, then moving on. The beauty of the STL code was that it was OK to re-use timers as long as they weren't in adjacent steps, which meaned that I was able to use "multiple coils" without a problem. Without STL, I would have run out of timers on most jobs. Be aware (as far as I know) that it can only be used on the old F series and the FX range of PLCs. The A series, QnA and I believe the Q series of PLCs don't allow the use of STL, so if ever you think that you may be moving the code onto a larger platform, then you'll have a problem

Share this post


Link to post
Share on other sites
I think that MitSU is trying to move from STL to SFC (Q series supports SFC). If you want to learn something new and be able to utlize the same skill on another platform, go with SFC. I think Rockwell, Mitsu, GE, Simens, Beckhoff, etc. all support SFC. If you would like some examples I can upload them. Regards, Craig

Share this post


Link to post
Share on other sites
Hi Craig, It would be great to see some examples.

Share this post


Link to post
Share on other sites
Markin, you are talking about SFC programming only. STL and SFC are different methods. STL (as in the diagrams I showed) is a program within a program! The STL section is used just for the auto part (usually) and jumped in and out of as required. Incidentally, only the active step in STL is scanned, thats why you can use multiple coils. I never use multiple coils actually but in colins case that was a brilliant idea for the old F series.

Share this post


Link to post
Share on other sites
Hi Goody, I think I am confused over the difference in STL and SFC, the manual I have only refers to SFC. I can't seem to get past entering the first block. Could you explain how to begin a program using SFC? Markn

Share this post


Link to post
Share on other sites
Hello Folks, I had the Ah Ha experience this weekend. I have discovered how to use the GX developer to create or program using the SFC feature. I can now understand how to program each State and create a transition to another state. From what I can gather STL is created using either List or Ladder editors. Thank you all for your help.

Share this post


Link to post
Share on other sites
Good, maybe you can enlighten us now :)

Share this post


Link to post
Share on other sites
Hey Goody, I don't think I can enlighten anyone as I am obviously just starting out. I am learning on my own and really appreciate the sage feedback I am given through this forum. Anyways, I am using GX developer ver. 8 and what I have learned applies to creating a SFC program. When I first looked at using the SFC function, I wasn't able to enter any ladder functions, I finally stumbled upon the basics. First in creating a new project I checked the SFC function, click OK, this brings up the SFC Block discription, the first block I used a ladder function to energize the 1st state, enter first state discription and check type SFC, click OK , this brings up the SFC editing page. I finally figured out that by clicking on the state box would bring up a ladder type edit page on the right side of the screen which allows entering functions to perform for that particular state. Further on I stumbled upon using the transition functions. anyways sorry to be so long winded.

Share this post


Link to post
Share on other sites
I've just recently came across STL, I wasn't entirely struck on it!. The original program I believe was written using GX IEC and SFC As i did not have an original copy of the IEC code I had to go online with GX and download the code. I ended up with a program full of STL instructions that seemed to jump all over the place. I'm sure it is a good method of programming but in this particular example it made fault finding quite horrific!. (Another sizeable chunk of the program was in LAD) Out of cuiriousity is there anything i could have done to avoid this or does GX Dev interpret SFC as STL on an FX2N???? That was my understanding!??!! Cheers

Share this post


Link to post
Share on other sites
It sounds like you uploaded an SFC program and had the program type selected as ladder. That would explain why there were jumps every where (the conversion from SFC to ladder is messy). I have uploded a program without setting it as an SFC program and it changed it to STL (Ladder). The one other gotcha with the SFC is that if you name an SFC block it cannot be saved in the processor with the comments. This makes it a little diffcult to know the meaning of the blocks other than they are ladder or SFC. I will also try to post some code soon. I have a couple of applications, but my company does not look kindly on uploading code. I will see if I can post some of the examples from the manual and maybe the the state machine for PackML. I use a combination of SFC and Motion objects (Cascading Logic: A Machine Control Methodology for Programmable Logic Controllers - Gary Kirckof, P.E.), may not be the best, but it keeps it modular. Craig

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0