Jump to content

Recommended Posts

2 hours ago, Flex727 said:

AND logic would look like this:

image.png.cb3248979b69408cecffe74abaed9f4a.png

Yours is OR logic. What do you mean by "I cannot choose the MB or O"?

 

 

For this And logic, it's only for the Integer and Long. I thought I can use this structure before. Thank you.

image.png.eaf79ee60f7dd06b8547bbe231f3414c.png

 

Also,

For this Coil, when the Timer is done, turn off O1, O2, and O0 at the same time. 

Is this right? Can I put three coils in series on the same line, or I need to split into three lines?  Or I should set them in parallel? 

image.png.d6eff391f84a2aef498dfe477b7c33f2.png

I am a little bit confuse on this right now. Thank you.

Link to comment
Share on other sites

  • MVP 2023

Yes, with VisiLogic you can place coils in series. I recommend placing the Load HMI function on the next line by itself. Placing a couple of coils in series is okay, but I strongly recommend not loading up a single ladder rung with too much logic else you might get an unexpected result.

The AND function is for certain specialized needs to make working with the bits within a register easier. It is NOT for normal bit logic, which is why you can't select MB. Search for "logic" in the help file and you'll find AND there.

Link to comment
Share on other sites

  • MVP 2023

(And just as I finished writing this, Flex has replied)

I don't want to come in over Flex, but a comment.  I rarely ever use Inverted coils.  To me, keeping track of switching logic can becoming confusing using them, and you can possibly have unintended machine operation due to the logic only turning things OFF.  I find it much easier to always use direct coils, and the logic always works around "if this condition, or set of conditions is met" the output is ON.  It just seems to be a more natural way of doing things.

As to part of your question, Flex is fond of saying, "Unitronics don't charge for using extra ladder rungs".  Split your lines into separate nets.  Until you become more experienced, it makes things easier to understand as you can see each action on it's own.

cheers,

Aus

Link to comment
Share on other sites

  • MVP 2023
13 hours ago, Ausman said:

I rarely ever use Inverted coils.  To me, keeping track of switching logic can becoming confusing using them, and you can possibly have unintended machine operation due to the logic only turning things OFF.  I find it much easier to always use direct coils, and the logic always works around "if this condition, or set of conditions is met" the output is ON.  It just seems to be a more natural way of doing things.

I'm glad to see someone else with this same opinion. I ALWAYS avoid inverted coils. In my case it's because I'm an idiot and get easily confused. :)

Link to comment
Share on other sites

  • MVP 2023
8 hours ago, Flex727 said:

I ALWAYS avoid inverted coils.

+1

They are confusing and bad ju-ju.  Especially for a beginner. 

@Nancygogogo - delete these inverted coils from your logic and figure out how to make it work with regular coils, SETs, and RESETs.  If you're having trouble look over the Help topic "Coils".

Joe T.

Link to comment
Share on other sites

On 4/27/2018 at 3:27 PM, Ausman said:

To me, keeping track of switching logic can becoming confusing using them, and you can possibly have unintended machine operation due to the logic only turning things OFF.  I find it much easier to always use direct coils, and the logic always works around "if this condition, or set of conditions is met" the output is ON.  It just seems to be a more natural way of doing things.

Thank you for all your advice. For this one, the outputs are valves, so the conditions will switch back and forth between ON and OFF either control by user or timer. 

I am looking at the RESET and SET coil, it seems like I can use RESET coil to turns a coil OFF (unlatch) instead of using the inverted coil. Under both of the SET and RESET Coil, it said do not use a set coil without a reset coil in a program. But can I use a reset coil without the set coil? Cause I might just want to turn off the Valve. 

Thank you very much.

Link to comment
Share on other sites

  • MVP 2023

I think you're not really understanding how coils work. Keep in mind that direct and inverted coils are evaluated on every scan. If you have a direct coil conditional on a direct contact, the coil will turn on when the contact is closed and will turn off when the contact is open (the opposite happens with inverted coils). In other types of computer logic, action is only taken when the condition is satisfied and no action is taken when the condition is not satisfied.

This is where Set & Reset coils come in. With a Set coil instead of a direct coil, the coil will turn on when the condition is satisfied and will stay on even if the contact opens. You need to use Set & Reset coils in pairs because if you Set the coil, you can never turn it off without the Reset coil (and vice-versa).

Above, you have 3 inverted coils in series with a positive transition contact of timer TD 6. That will NOT work because those outputs (O 0, O 1, O 2) will stay on always except for a single scan when the timer expires, then immediately turn back on. No valve is capable of changing state in a single PLC scan. Those inverted coils should be changed to Reset coils. You will also need Set coils for when you want the valves to open.

Link to comment
Share on other sites

  • MVP 2023
37 minutes ago, Nancygogogo said:

do not use a set coil without a reset coil in a program

Adding to what Flex says, I think that you are getting names confused.  Set and Reset coils have nothing to do with Direct and Inverted coils.  Have a good look in Help/Help/Index/Coil/Coils for a description of each type.

The only coils I use for working actual physical outputs are Direct.  Set and Reset coils may be involved in controlling them.  So you might have an MB working as a Set/Reset condition, and that MB is the control for the Direct coil.

cheers, Aus

Link to comment
Share on other sites

22 minutes ago, Ausman said:

Adding to what Flex says, I think that you are getting names confused.  Set and Reset coils have nothing to do with Direct and Inverted coils.  Have a good look in Help/Help/Index/Coil/Coils for a description of each type.

The only coils I use for working actual physical outputs are Direct.  Set and Reset coils may be involved in controlling them.  So you might have an MB working as a Set/Reset condition, and that MB is the control for the Direct coil.

cheers, Aus

1

I am sorry, I am a little bit lost. I got the point what Flex said that for the SET coil, the coil will turn on when the condition is satisfied and will stay on even if the contact opens until the RESET coil is energized. And also for the direct coil, a coil turns ON when the contact is energized, allowing power flow to reach the coil from the net.

image.png.94ec46e6b43975dd3420ab0efbed8b9f.png

So in this case, as I said before when the timer is counting, O1, O2, and O3 are opened as well. After the timer is done, all of three output will be turned off until next contact triggers the Output on.

Is that correct if I set a SET coil for O0 and O2 in rung 7&8, then place the RESET coil in rung 10 for O0 and O2 (I know that I need to break it into 2 or 3 lines)? Thank you.

If I just use the direct coil in rung 7&8 for O0 and O2, what should I do if I want to close the valve by not using the inverted coil, is this possible or it completely wrong?  

One more question is about check the status of the Output, the logic I want to set up is: for example, check the status of O0, if the Valve is on, then turn off it, if not, then do the next step.  I think it probably is unnecessary in the ladder logic right now since if there is no to contact with energized, the output won't be on anyway. Am I correct?  Or I am wrong again... Thanks everyone.

Link to comment
Share on other sites

  • MVP 2023

You're almost there.  A normal coil (or inverted coil) ALWAYS updates it's status in the memory table.  If the logic leading up to a regular coil is true, the coil will assume a value of 1.  If the logic is false, the coil will go to 0.  Just like real relays with springs in them.

So the regular coils will get in a fight with the inverted coils in the logic you've shown.  Never use the same address twice for a normal coil instruction, as it will assume the state it's tied to in the bottom of the program.  Remember that PLCs solve logic from top to bottom.

Replace the regular coils with SETs and the inverted coils with RESETs.  These coil types on only operate on the memory when they're called, not all the time.

Joe T.

Link to comment
Share on other sites

  • MVP 2023

As Joe says, you're almost there but I still think you have coils and where to use them confused because the name "Coils" is given to a number of elements that do fundamentally different things.

Think of a light switch in your dark house.  You turn on the switch with your finger and the light bulb stays on until you turn it off at the switch.  In the ladder, the light switch is the Coil that is Set/Reset.  This in turn controls the Direct Coil which is the actual ouput powering the light bulb.  Turning the light on is imitated in the ladder by some control (your finger) Setting the Set coil (turning on the light switch) which then turns on the Direct coil (the light bulb).  The light stays on until you turn the switch off (a different finger action), which in the ladder is a Reset of the Set coil (a different control action), which then turns off and thus the Direct coil turns off (you can't see anything anymore because it is dark!).

I think it would be a good idea if you actually write a small bit of code to experiment with just a single action of Set/Reset working an output, and then monitor it.  You can learn a lot by having the control via a button push from the HMI, and the resulting action displayed in the HMI as well.  You can get a good idea on all of this by loading up the example file in Help/Examples/(Version 900)/Project Examples/Ladder/V120_Basic_coils_and_contacts.

cheers,

Aus

Link to comment
Share on other sites

On 4/30/2018 at 7:53 PM, Joe Tauser said:

Never use the same address twice for a normal coil instruction, as it will assume the state it's tied to in the bottom of the program.  Remember that PLCs solve logic from top to bottom.

 

I understood most of the time what I need in my program for the valves should be operated by the RESET/ SET coil right now, since what I need is similar to the light switch, not a car horn. 

As you said for this one, never use the same address twice for a normal coil. Does this mean that I cannot set two same address direct coils in a program, such, if there are two or three different ways or buttons to trigger the coil, is that the right way to put the contacts in OR logic (as Flex said before) and link with same output? Also, is this same for the RESET/SET coil or doesn't matter? 

Thank you so much.

Link to comment
Share on other sites

  • MVP 2023
57 minutes ago, Nancygogogo said:

the right way to put the contacts in OR logic (as Flex said before) and link with same output?

Yes!

 

57 minutes ago, Nancygogogo said:

Also, is this same for the RESET/SET coil or doesn't matter? 

SET & RESET can appear as many times as needed, but keep it to a minimum in order to be able to efficiently troubleshoot later. Use direct coils whenever possible. SET & RESET are typically used for latch circuits, but there can be other occasions when they're needed.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...