Jump to content

Flex727

MVP 2017
  • Content count

    1,206
  • Joined

  • Last visited

  • Days Won

    97

Flex727 last won the day on August 12

Flex727 had the most liked content!

Community Reputation

152 Excellent

6 Followers

About Flex727

  • Rank
    UniGuru

Profile Information

  • Gender
    Male

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. I came from a computer programming background as well and I think that was probably the hardest thing for me - unlearning ingrained habits from that world. PLC ladder logic is fundamentally different and failing to wrap one's head around that is probably the most common problem I see with new PLC programmers. Joe Tauser's State Machine example shows the proper way to handle situations where you are stepping through a process sequentially and want to avoid code until it's time for it. It definitely opened my eyes some years ago when he first posted it here.
  2. I'm offering advice based on my experience. You're free to accept or ignore it as you choose. My way of doing things is my way, not the only way. My philosophy is to never use GoTos or conditional triggers for subroutines. I find that it's a better way, but it's not the only way. In my opinion, subroutines in ladder logic should be used differently than subroutines in normal computer programming. A normal computer program has a beginning and an end with subroutines for specialized tasks. In ladder logic, you have continuous execution of all code in a never-ending loop. Going off to execute a subroutine for a specialized task, or using GoTos, risks triggering the Watchdog Timer, which is a major fail for the programmer. I use the Main Routine only for Power-Ups and subroutine calls. Then all the code is broken up in logical chunks for easy understanding and readability into subroutines.
  3. Here is what the top part of my primary desktop looks like. I position the Version Swapper icon under the VisiLogic version that is currently active and swap as needed. Why so many versions? I refuse to update the firmware at a customer site if the installation is working. "If it ain't broke, don't fix it." Version Swapper works great and reliably on my Windows 7 system.
  4. Please allow me to repeat what I said above: Write your code with this in mind and you'll have much more success with PLC ladder logic, now and in the future.
  5. There is additional filtration available via ladder. Look under the FB's drop-down menu.
  6. You are trying to program like you would a computer with some other language, not program a PLC with ladder logic. PLC ladder logic should be organized completely differently. Every rung of every subroutine should be evaluated on every scan. You probably should be using a State Machine instead of what you're trying to do. Our resident genius, @Joe Tauser, has written an example program to help educate us on this terrific technique to handle the type of situation you are trying to deal with. Looking at your edit, it appears you might be headed in the direction of a State Machine, which is great. Look at Joe's example program and see if it helps you.
  7. If ladder rung #1 is supposed to be a standard latch circuit, it's wrong - MB 2 should be MB 4. I think conditional subroutine calls are very poor programming practice. You have to be extremely careful not to leave coils hanging in limbo when the subroutine stops being called. With PLC ladder logic, the next subroutine is normally called when the previous subroutine is finished - and not before. You don't need a bunch of code to create that situation, as you seem to be doing here.
  8. Yes, there is a GoTo in Unitronics Ladder Logic, but it should be avoided. It is poor programming practice in 99.9% of circumstances. There are far better ways to execute only the rungs you want executed. My philosophy is to work backwards from outputs or coils to inputs or contacts. Determine every circumstance that should turn that output or coil on and write that logic. When that is correctly done, there is no need to skip rungs because they will not activate the output or coil automatically. A simple way of accomplishing this is to assign a coil to turn on when a>=b, then place the inverted contact of that coil in front of the logic you want skipped.
  9. It seems that way too many programmers (especially in the beginning) fail to recognize what the ladder rungs are in ladder logic. The screen is not just a blank slate to write the logic willy-nilly. The purpose of the rungs and separating logic threads is that the compiler will create machine code that tells the PLC to fully evaluate a single ladder rung before moving on to the next rung. When you have two logic threads with dependency between them and place them both in the same ladder rung, the programmer has lost control over order of execution. When in separate rungs, the programmer knows the first rung will be fully evaluated before starting on the next.
  10. You don't need to do Download All & Burn until you're ready to place the machine into service. During program development and troubleshooting, just do a simple Download. Download All & Burn wastes a LOT of time unnecessarily.
  11. I think he said it backwards - do not combine networks in a single ladder rung. The first picture shows two independent networks, or logic strings in a single ladder rung. NEVER DO THAT. The second picture shows the the logic broken up into two separate ladder rungs properly. I created the examples in VisiLogic to show more clearly. Rung 1 shows how NOT to do it. Rungs 2 & 3 show the correct way:
  12. The first two don't look fine. The compare is false, yet the coil shows as true (they're in red). Do a find on each of the coils (MB 16, 17, & 41) and confirm they are not duplicated elsewhere. Also, confirm the subroutine with the compares is being called in the Main Routine.
  13. How many HMI screens do you have in the program? Probably the easiest thing to do is to open the V430 project, go to the first HMI screen, Ctrl-A, Ctrl-C, open the Samba project, go to the first HMI screen, Ctrl-V. Save & repeat for each screen.
  14. I would do it this way: ML 0 would be your total accumulated hours. You could add a reset pushbutton that zeroes both ML 0 & MI 0 when the blasting wheel is replaced.
×