Jump to content

Recommended Posts

Posted

Hi Everyone,

  This is my second PLC, it is a Samba.  I am having an issue with my set coils. When a set coil is energized or ON, my corresponding RESET for that coil gets energized also. This has me stumped as I believe all my reset coils are isolated until I want them to come on. This is happening to a few coils in the sketch named Machine Logic.  Any help would be appreciated.  I posted the sketch. 

 

Thank you,

Scott

1311-1.vlp

  • MVP 2023
Posted

Visilogic has a confusing way of displaying all coils of a certain address with the status of the coil.  Your Reset coil shows it's on because the Set coil turned it on.  If you call the Reset it will go off.

You may want to write yourself an experimental program and test it while looking at it online to prove this to yourself.

Joe T.

 

PS - thank you for posting your code.  So many people post problems on the forum and expect us to be mind readers.  One of my pet peeves.

  • Upvote 1
Posted

Thanks for the reply Joe. 

I was testing the reset rung (pic below) and I could not get my coils O3 and O1 to come on until I took out Reset coil MB 11.  I was thinking that MB 11 was Resetting before  O3 and O1 could energize..  Does that look possible or am I dealing with something else?  Do you see anything else that is not "Best Practice" programming in this sketch?  I appreciate your help and knowledge.

 
 

Thanks again,

Scott

Reset.PNG

Posted

I have a reset button on the main hmi screen (mb9).  When the machine needs to be reset the operator hits the reset button.  Then hits the anti-tiedowns which then retracts the cylinders (O3 and O1) and resets mb11 (reset hit) coil.

 

Thanks,

Scott

  • MVP 2023
Posted

OK.  Some tips-

1.  Always use a positive transitional with an HMI button.  You don't want the PLC to keep setting the Reset.

2.  You can only use a regular coil once in your program.  You've got the two outputs in question assigned twice - the status of the output will be whatever it was in the last place it was used, which can be very confusing.

3.  A timer consists of two parts - the timer coil, and then contacts referenced to it.  It is a common mistake to think that a coil acts like a contact.

4.  I'm guessing from your logic that O1 and O3 are on as long as I1 Anti-tiedown is on.  Do you want them on after that?

5.  It's a good idea to keep individual output control separated, even if you use redundant logic.

6.  Notice the reset of MB 8 and MB 11 when the operator releases I1 with a negative transitional if they were on.  If you don't know about transitionals, check the Help.

Code attached.

Joe T.

1311-1 JT.vlp

  • Upvote 2
Posted

Thank you Joe,

In reference to your list.

#1.  Got it.  Is this only more efficient or will a regular contact cause potential issues?

#2.  This would explain why it was acting erratic when trying the program.   

#3.  Got it.

#4.  I would like the outputs O1 and O3 to stay on or SET during the cycles, but only when holding the anti-tiedown when the reset button has been hit. I added reset coils in rung 8 and 9.  Please let me know if I'm out in Left field. Code attached.

#5. Got it.

#6.  I read through transitions under help.  It is making sense.

 

 

Thanks,

Scott

 

1311-1 JT-SRP.vlp

  • MVP 2023
Posted

An HMI button is like a regular input - it will be on as long as you hold it.  If you only want something to happen once then use the transitional.

Only call one subroutine per network.

I did a search on the coils you're resetting and found you are still using them as a regular coil.  Don't do this; the logic driving the regular coil will always win.  If you just want the extract and retract to be complimentary then drive them with a NC of the other.  I don't see anything calling your Manual subroutine, but when you do call it O0 will go off regardless of what O0 is doing, unless the clamp MB 10 is on.  Then it will go on or chatter.  Use MBs to communicate between subroutines, and put all your outputs in one subroutine.  I like to put one output per net and stack them in order.

If you're going to use Sets and Resets, make sure you keep track of where they turn on and off.  It's easy to get lost with this kind of coding.

I've also attached a state machine example of how to code.  This method uses a numeric pointer to jump between steps and limits what can be done in each step, as only one step can be active at a time.  It will require you to re-think your program but it's way easier to troubleshoot.  It really helps if you draw a flowchart of your program before you start writing it. 

Joe T.

 

1311-1 JT-SRP 1.vlp

State machine example.vlp

  • Upvote 2
Posted

Thanks Joe,

  I failed to mention that the "Manual" subroutine was for troubleshooting; to make sure I wired my valve stack correctly.  That will be eliminated.  Thanks for the state machine example.  I looked through it and followed a lot of it, but I am just having a hard time thinking of how it would look in an application like mine.  It may just be that I am getting use to this type of programming, though.  I will definitely be looking into it more. 

  Like I said this is my second PLC to program (both are unitronics) and I am enjoying it a lot.  Do you have any advice on learning programming?  Classes or tutorials?  I would eventually like to get into Allen Bradley, as that is what is used the most in my neck of the woods, but I don't want to be held to one product as many programmers are.  Any advice is much appreciated.

I will give an updated on this project in the next few days. 

 

Thanks again,

Scott

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
×
×
  • Create New...

Important Information

This site uses cookies. By clicking I accept, you agree to their use.