JaySharp90

Alternative to SET/RSET

12 posts in this topic

Hello,

For my plc ladder programs I've just used whatever seems to work, so to turn things on and off I've just been being asserting either set x.xx or rset x.xx. This always gives me warnings when I compile (I eventually turned those warnings off as they didn't seem to affect anything), so I was wondering what the correct way to do on/off was? I assume if the program is warning me against doing it with set/rset there must be a way they recommend.

I also want to start using the interlock instruction which, from the help information for that, it looks like if I use set/rset to set things on or off the interlock instruction won't affect those things' states. This seems bad.

Thanks,

Jay

Edited by JaySharp90

Share this post


Link to post
Share on other sites

Hello,

it is not error, only warning about duplicated output (by set, rset normal situation). The program will work normally.

Share this post


Link to post
Share on other sites

You could also use KEEP.

 

Share this post


Link to post
Share on other sites

The SET / RSET is an effective method to turn outputs ON and OFF. As stated, it is just a warning. If you duplicate a standard OUT instruction, the first OUT will not work. Below are three examples of latching.

11 hours ago, JaySharp90 said:

I also want to start using the interlock instruction which, from the help information for that, it looks like if I use set/rset to set things on or off the interlock instruction won't affect those things' states. This seems bad.

Why do you feel a need to use the IL/ILC instructions? In my opinion, it can be an effective method of disabling sections of code but otherwise not use them. The JMP/JME instructions are even more confusing. I believe most programmers will encourage you to steer clear of them.

MrPLC_ON_OFF.thumb.jpg.9bd2b21f18bbddd7d

Share this post


Link to post
Share on other sites
Quote

Why do you feel a need to use the IL/ILC instructions? In my opinion, it can be an effective method of disabling sections of code but otherwise not use them. The JMP/JME instructions are even more confusing. I believe most programmers will encourage you to steer clear of them.

For some reason though, Japanese programmers tend to love JMP/JME  :D, whose programs I hate to troubleshoot.

Share this post


Link to post
Share on other sites
5 minutes ago, innoaloe said:

For some reason though, Japanese programmers tend to love JMP/JME  :D, whose programs I hate to troubleshoot.

I almost posted a latching example using the JMP/JME. I found it in a Japanese program that nearly drove me crazy.

Share this post


Link to post
Share on other sites
On 8/16/2017 at 10:28 PM, IO_Rack said:

Why do you feel a need to use the IL/ILC instructions? In my opinion, it can be an effective method of disabling sections of code but otherwise not use them. The JMP/JME instructions are even more confusing. I believe most programmers will encourage you to steer clear of them.

For the interlock thing, it was just to prevent buttons on the HMI being able to be pressed if a level transmitter reached a certain point (i.e. if the tank is too full, prevent the user from turning on any of the pumps that feed stuff in). The buttons are a mix of command and just push buttons so I wasn't sure of the best way to stop the user from being able to interact with them. I was specifically asked to look into the interlock things, although no one here seems keen on it so I might just go back and tell them that.

Thanks everyone else for the help with set/rset. I knew it was just a warning, I just thought there might be an alternative that everyone else uses to avoid the warning. SET/RSET makes sense to me, so guess I'll just keep using it

Edited by JaySharp90

Share this post


Link to post
Share on other sites
9 hours ago, JaySharp90 said:

For the interlock thing, it was just to prevent buttons on the HMI being able to be pressed if a level transmitter reached a certain point (i.e. if the tank is too full, prevent the user from turning on any of the pumps that feed stuff in). The buttons are a mix of command and just push buttons so I wasn't sure of the best way to stop the user from being able to interact with them. I was specifically asked to look into the interlock things, although no one here seems keen on it so I might just go back and tell them that.

I wouldn't let any of us discourage you from using them if it makes sense to you. The important thing is to understand how they operate. The fact that you are asking the forum, says you are taking the proper care.

The warning in the help section says that the SET/RSET and KEEP instructions will retain the last state inside the IL/ILC even when the IL is turned OFF. It will prevent it from tuning ON but it will Not turn if OFF.

Share this post


Link to post
Share on other sites
On 8/18/2017 at 11:37 PM, IO_Rack said:

The warning in the help section says that the SET/RSET and KEEP instructions will retain the last state inside the IL/ILC even when the IL is turned OFF. It will prevent it from tuning ON but it will Not turn if OFF.

That was my main concern with interlock. Is there any way to reset all sets at once, or do you just need to do each one individually? If I have to do it for each one, I feel like interlock doesn't really benefit me much.

Share this post


Link to post
Share on other sites

If you have all your SETS in contigious blocks (say channel 200 to 220) you can use BSET #0000 200 230 will write 0 to all bits in all those channels.

Share this post


Link to post
Share on other sites

What's the best method for replaced set-reset programing?

When I programer pump system I use set-reset, but I always wondering what's the best method? 

Sometimes I used 'jmp' and 'goto' but sometimes I had the 'watchdog' warning, they already know, the scan cycle. 

Edited by rootsqr

Share this post


Link to post
Share on other sites

I use SET RSET or KEEP. KISS!

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