Jump to content

Outputs Not Working on V700


Recommended Posts

I have a subroutine to run 3 cylinders in a manual style mode.  When I run an online test, I can see all of my contacts and coils light red when I hit the corresponding buttons on my HMI, but none of the relays click and I have nothing register on the air manifold.  Originally before I tinkered with some of my program I only had three relays working, but now I'm getting zero.  I thought maybe I had a hardware issue but I've swapped snap-in modules and that did nothing.  The other kicker is, I have a reset button that I use in auto mode to retract all of the cylinders to home and that fires everything like it is supposed to.  So I'm convinced it has to be an issue in my program somewhere.  My programming background is basically all Allen-Bradley with a dabble in Mitsubishi.  I've copied below what my manual subroutine looks like.  Again, all of my HMI buttons turn the contacts and coils red, just getting no voltage across the terminals.  If I need to copy more of my auto mode program, I certainly can.  I'll take any help or guidance I can get.

Thanks,
PeterPan217

image.png.c0a5ede5275998d4582a3eaac66d937a.png

Link to comment
Share on other sites

  • MVP 2023

First of all, are you certain the subroutine is being called in the Main Routine? Have you gone online to see what happens?

I've been programming PLCs for many years and have never tried to use a conditional RET. It seems to me to be very poor programming practice. I see in VisiLogic Help that it is allowed, though I recommend against it. Just my opinion, but I consider conditional subroutine Calls and Returns to be avoided if at all possible. It makes the program much easier to understand and troubleshoot and avoids zombie coils.

Additionally, though this is not related to your problem, you have two logic threads in each of Rungs 4 & 5. Don't do that. Separate them out into two rungs each.

Link to comment
Share on other sites

I thought I had the subroutines called correctly, but now I am second guessing it.  I've been online and everything does it's red highlighting but I'm not getting the relays close and allow voltage to the terminals.  However, the same thing you mentioned about multiple logic threads on one rung is what I did for the subroutine calls.  I thought I saw that was OK in one of the help examples but I may be mistaken.  I'm sure you can tell this is my first time programming with VisiLogic.  I appreciate the help, I'll see how these changes work.

Link to comment
Share on other sites

  • MVP 2023
48 minutes ago, PeterPan217 said:

I've been online and everything does it's red highlighting

Keep in mind that the online indication is not necessarily doing what you might think. All VisiLogic is doing is querying the PLC for the state of each operand and indicating that on screen. It does not do any logic. Therefore, if a subroutine is not being called, it will still look like it is because the operands exist in the PLC and have a state that is displayed.

You are welcome to post your program here and we'll try to help.

Link to comment
Share on other sites

I broke up the logic like Flex suggested, in my subroutines and even calling them.  The manual mode works like I intended it to now.  However, now I'm struggling to get accumulating timers to reset with an HMI button.  Within my ladder, they have logic that will reset them, but if something goes wrong I have a button to basically restart the whole process, i.e. retract all cylinders and reset timers.

Flex, that would be great if you could look it over.  I haven't done anything with the AL-SS Material subroutine yet so don't worry about that, but the file is attached if you want to see what I'm meaning with the HMI Reset.  Y'all are the best!  I've been struggling for two days with this before I remembered about this forum.

Part Picker.vlp

Link to comment
Share on other sites

  • MVP 2023
1 hour ago, PeterPan217 said:

However, now I'm struggling to get accumulating timers to reset with an HMI button.

You have many duplicate coils in your program. That is a big no-no. With regular coils it results in "last one wins". With timer coils, it causes them to run at double speed (or not at all). Run "Project Optimizer" under the Build menu to help find them all. My best advice is to stop using conditional subroutines and write your logic so it's not needed - and NEVER have duplicate coils under any circumstance (duplicate SET & RESET coils are perfectly fine).

You still have multiple logic threads in a single ladder rung (Main Routine rung 1).

With Unitronics there is no need to place coils all the way to the right side of the ladder. Nothing wrong with it if that's what you want to do, but it makes the ladder difficult to read on a small screen.

 

Link to comment
Share on other sites

  • MVP 2023

No-one has mentioned this yet, (and your program does  need adjusting) but ensure that ALL the power supply requirements for the snap-in are correct and it is seated correctly.  The snap-in manual is easy to misread as it separately notes various power connections .

Please also look at point 11 in the pinned topic here:

https://forum.unitronics.com/topic/6229-ongoing-22-topics-almost-worth-pinning/

cheers, Aus

Link to comment
Share on other sites

  • MVP 2023
15 hours ago, PeterPan217 said:

So I can't have the coils reset by logic in the program AND have the option to reset by a push button?

Sure you can. Just make sure there aren't any duplicate coils. Place all the logic for a single coil in a single rung, including the ladder logic to activate the coil and the contact for the button. If you need to use SET and RESET instead of Direct Coils, you can have as many of those as you need.

Link to comment
Share on other sites

31 minutes ago, Flex727 said:

Sure you can. Just make sure there aren't any duplicate coils. Place all the logic for a single coil in a single rung, including the ladder logic to activate the coil and the contact for the button. If you need to use SET and RESET instead of Direct Coils, you can have as many of those as you need.

So just to make sure I'm understanding you correctly, I came up with this example question.  Instead of having a rung with one contact causing three direct coils to energize, then turning around and having a rung later on try to energize one the same coils, I should instead separate out my coils into three rungs and in one rung list all of the contacts that can energize each?

That would make more sense now that I think about it.  The way I programmed this was almost in a sequence where when something happened, this is all what occurs, and with those occurring, this would then occur, and so on.  That's how I used to always do it with AB PLC's so troubleshooting was easier because I'd just follow down rung by rung.  I'm noticing things in VisiLogic are a little different and don't like me taking that approach.

As an update, I was able to get my program to successfully do what I wanted it to last night, at least as an online test goes with my air manifold.  I'm sure I can still clean my program up a lot, but I did notice that I had two pairs of coils conflicting with each other that I eliminated one of each.

Link to comment
Share on other sites

On 9/1/2022 at 8:22 AM, Flex727 said:

Sure you can. Just make sure there aren't any duplicate coils. Place all the logic for a single coil in a single rung, including the ladder logic to activate the coil and the contact for the button. If you need to use SET and RESET instead of Direct Coils, you can have as many of those as you need.

NO NO, set reset must also be one of each if you want to be able to debug easily and go to bed early in the future.

in ladder logic, it is a very bad practice to have more than one instance of the same output.

their program is cyclic however you could have the same conditions to do a set and reset on different parts of the program at the same time and you won't be able to notice because it will be too fast for being able to see it, or it could be set and reset before you need it to scan for that contact being triggered.

In my experience is easy and quick to keep adding set resets to fix or proceed with the logic, but it is a lazy way of programming because you are not analyzing the entire scope of the program.

I just replaced an entire inherited program that used a lot of set-resets ... it did work but as I keep adding new features those parts of the previous code were a headache too..... 

 

Link to comment
Share on other sites

On 9/1/2022 at 9:12 AM, PeterPan217 said:

That would make more sense now that I think about it.  The way I programmed this was almost in a sequence where when something happened, this is all that occurs, and with those occurring, this would then occur, and so on.  That's how I used to always do it with AB PLC so troubleshooting was easier because I'd just follow down rung by rung.  I'm noticing things in VisiLogic are a little different and don't like me taking that approach

That's correct, the proper way to work is if everything runs on parallel at the same time, however, the truth is that plc has scan cycles, which makes it easy to do some trickery between cycles and I've seen that a lot in Unitronics examples. However, having said that even on AB you should not use more than one coil at the same time. I am pretty sure that if you do it, it only obeys one of the many instances that exists in the code I know because I did that too on my early days on a micrologix and banged my head against the wall a lot while asking why my logic didn't work as I intended.

Link to comment
Share on other sites

  • MVP 2023
2 hours ago, Fernando Castro said:

NO NO, set reset must also be one of each if you want to be able to debug easily and go to bed early in the future.

This is totally true, but my reference was to functionality. You absolutely cannot have duplicate direct coils and have them function properly, but you can have as many SET & RESETs as you would like and the program will function as intended.

Personally, I do try and have single instances of any coil, but I occasionally will have multiple instances of SET & RESET when the logic calls for them to be in different subroutines. This is precisely for the reason you cite - to make it easier to debug and for future understanding of the logic.

Link to comment
Share on other sites

18 hours ago, Flex727 said:

This is true, but my reference was to functionality. You absolutely cannot have duplicate direct coils and have them function properly, but you can have as many SET & RESETs as you would like and the program will function as intended.

I do try and have single instances of any coil, but I occasionally will have multiple instances of SET & RESET when the logic calls for them to be in different subroutines. This is precisely for the reason you cite - to make it easier to debug and for future understanding of the logic.

Ok, I forgive you... I do like to use subroutines a lot but it always gets tricky if you want to use conditional executions,  my most recent approach when using conditional logic on subroutines is to define a struct and "clear all" values when leaving the subroutine not active.

 

It's a way to use subroutines as "custom functions" that I can import and export to my other projects. It's an over-engineered solution but is very useful for making a modular project

, the only caveat is that I must define and reserve all memory addresses that will be used in each subroutine.

 

Link to comment
Share on other sites

  • MVP 2023
1 hour ago, Fernando Castro said:

Ok, I forgive you...

😂

1 hour ago, Fernando Castro said:

I do like to use subroutines a lot but it always gets tricky if you want to use conditional executions

Totally agree here as well. I make it a practice to NEVER use conditional subroutine calls (or returns).

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...