Sign in to follow this  
Followers 0
justwhy2003

Internal relay question

23 posts in this topic

Hi I know this is a total newbie question. What is the difference in using "S" internal relays or "M" internal relays? Until now ive always been using M type but ive been looking at a different programmers program and he uses M type in some places and S type in others. Both are used in the same method, i was just wondering what determines which should be used and for what reasons... Justin

Share this post


Link to post
Share on other sites
There is entire chapter in the programming manual about state (STL) programming. Before you read and understand it, I strongly suggest you not to touch existing S relays and their contacts in the program neither to create new S relays. Edited by Sergei Troizky

Share this post


Link to post
Share on other sites
There are strict rules governing S relays and stl programming - but only in FX models The A and Q series have S relays but these do not permit STL programming. I have often wonderd why they are there in these models - unless you want to signify a sequence and use S relays for this purpose???

Share this post


Link to post
Share on other sites
ok, im working through the programming manual to try and figure out s relays. if i could just ask a few questions: these are just normal relays/contacts in the ladder logic like x, y, and m but with the s prefix. They arent special contacts? im trying to use the example application in the programming manual but Gx wont allow me to compile the [RET] command at the end of the subroutines. is this the correct function, or does return have a diffrent command that im missing? justin

Share this post


Link to post
Share on other sites
As Goody says, the S elements are known as State Elements and are used in the FX series of PLCs for Stepladder Programming (STL). If you're not using one of the FX series, then I would strongly advise not using them as you may well find that you're getting weird errors .... stick to M elements. If you are using one of the FX series PLCs and you've read up on what Stepladder programming is and you really want to use Stepladder programming, then fine, else stick to M elements. The RET command that you talk about is the command that you would use at the end of a Stepladder routine to tell the PLC to return to normal programme operation. Stepladder is very useful for sequential events that rely on something happening before moving on to the next step. I often wish you could use it in the larger breed of PLCs, but you can't.

Share this post


Link to post
Share on other sites
Now, being informed that the answers depend on the PLC model, you could specify yours before asking more questions.

Share this post


Link to post
Share on other sites
STL is not quite exactly SFC, as there is no flowchart, it's all done in ladder. But it functions like an SFC, with steps.

Share this post


Link to post
Share on other sites
I have used STL programming on a lot of projects - of course all were Fxxx plc’s so they weren’t massive jobs but after much practicing and reading I found STL to be a wonderful tool. The pitfalls (of which there are many to start with) are mainly with the mitsi documentation. The examples in the manuals just could not be coded as shown. (They were more symbolic than actual programming) and there are lots of ‘undocumented’ features to be aware of too. Having said that, if done correctly, it makes for very neat and structured programming and makes fault finding very easy

Share this post


Link to post
Share on other sites
gx.bmpim following the example in the programming manual. why would the following rung not compile?

Share this post


Link to post
Share on other sites
This screenshot from dear old DOS Medoc might give you a clue .... not sure how GX Developer handles the RET command, but MEDOC shows the ladder as this when it's entered as instruction code. Edited by Colin Carpenter

Share this post


Link to post
Share on other sites
RET must be connected directly to the left power rail. You have a contact in front of it.

Share this post


Link to post
Share on other sites
And further to crossbows answer - you are using an 'out' instruction on S21 where if you want the program to flow normally you should use SET this auto resets the current state and sets the next state I have put a small STL program in the downloads section - download it and see how STL works :)

Share this post


Link to post
Share on other sites
Thanks for the help. Ill take a look at the example programs later today. The reason ive done my program as in the attached BMP is that i was copying straight from the programming manual example. Hopefully your example program will shed some light. Thanks again

Share this post


Link to post
Share on other sites
Which manual did you find that in? What page? I've never seen that, and I know you cannot connect RET under a contact like you have. I'll let my contacts at Mitsu know if there is an error in the manual.

Share this post


Link to post
Share on other sites
I got it from the FX0 programming manual. Its on page 3-4, 3-7 and the one im using, page 3-17. I think its the same in the Fx1n programming manual.

Share this post


Link to post
Share on other sites
The FX2N manual shows a contact after the left power rail. 3.3.3 on page 3-4 Rodney

Share this post


Link to post
Share on other sites
That's right .... here's the screenshot. From memory, the manuals have always seemed a bit vague about the positioning of the RET command. Probably better to just enter in the instruction editor and see where it gets put in the ladder editor?

Share this post


Link to post
Share on other sites
This is what I meant earlier when I said the STL programming manual is more 'symbolic' than actually how you enter the ladder - also, very confusing to anyone trying to learn STL. Even in the picture on the last post, it shows the STL S005 contact as double thickness but in reality you dont even need to use any n/o stl contacts within an stl step. All instructions between ---[sTL S20] and the next ---[sTL S21] state can be taken straight from the left power line. eg --| X0 |------------------[sET S20] ---------------------------[sTL S20] -----------------------------(T0 K10) --| T0 |-------------------[sET S21] ---------------------------[sTL 21]

Share this post


Link to post
Share on other sites
Goody hit that one on the head... It's because its in an STL step. You won't code the S5 in front of the rung, even though that's what it looks like in the book. Personally I've always avoided STL. I'd go through the effort and write SFC instead.

Share this post


Link to post
Share on other sites
Hi I am with Crossbow, SFC was much easier for me to learn and I am a total rookie.

Share this post


Link to post
Share on other sites
I disagree - but then, I have spent a lot of time and effort ironing out all the nuances of STL. I find it a very neat and well structured way to program - like a for instance; I never use outputs in my STL sequence. I Use M relays instead _ this allows me to put all my sequence outputs together consequitively - and its the easiest way I know of switching from auto to manual controls.

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