Jump to content

Flex727

MVP 2023
  • Posts

    3,263
  • Joined

  • Last visited

  • Days Won

    237

Everything posted by Flex727

  1. @Fernando Castro, thank you for this. I suddenly had a pressing need for this strategy on my current project and it worked perfectly.
  2. I like your method, kratmel! Here's what I ended up doing: The original bit was an "enabled" bit that I needed to use to hide an HMI element, so it needed to be flipped. Normally that's not a problem, but when you have 25 of them it's a pain. I have begged Unitronics for a checkbox on the HMI element hide setting to allow either on or off to hide the element, but I'm sure we'll never see it.
  3. This works perfectly. I think I learned this in middle school math and totally forgot.
  4. No, I need to TOGGLE each bit in the vector. Some of the bits are on and some are off. I need to flip each bit. It doesn't have to be immediate, just in a single scan. I can brute force it by copying each bit to another vector with an inverted contact and coil (x25), requiring 4 rungs, perhaps fewer, but I was just looking for a clever way to do it without all that typing. Or maybe I'm misunderstanding what you're suggesting. I'm thinking I can convert the vector to an integer, multiply by -1, then subtract 1, then convert back to a bit vector. I'll see if that works.
  5. Can anyone think of a clever way to toggle every bit in a vector of 25 MBs in a single ladder rung and a single PLC scan?
  6. crash888's problem was that he wanted the value of the operand (COUNTER2) to be retained when the PLC is rebooted (retain checkbox was checked). He found that instead it was being reset to zero. Gabriel Franco correctly noted that crash888 also had a value entered in the box for Initial Value, so while the value was retained, it was immediately being overwritten on the first scan by the value (0) in the Initial Value box. Unitronics needs to automatically uncheck the retained value checkbox and grayout the feature when something is entered into the Initial Value box, or grayout the Initial Value box when the retain is checked, since they are contradictory.
  7. It would be nice if UniLogic (and VisiLogic) had the option to assign a value to integer operands on download similar to what is done with timer presets. Nevertheless, Gabriel Franco is absolutely correct in solving crash888's problem.
  8. I've often wondered about this. Is it incompetence, or some misguided sense of wanting to be proprietary?
  9. This is basic to ladder logic and you need to recognize this in order to be proficient in this programming language. Understand that the coil is both activated (if off and power passes to the coil) AND deactivated (if on and power doesn't pass to the coil) by the logic in a ladder rung. If one rung turns it on and another turns it off, it can't exist in both states simultaneously. If two different logic conditions are needed activate a coil, then simply place them both in the same rung. By the way, you can run Project Optimizer from the Build menu in VisiLogic and it will tell you all instances of duplicate coils.
  10. Normally, string data is stored in a vector of MIs, 2 characters per MI. You can easily read string data from a Data Table to an MI vector, but I don't think it's possible to directly transfer that data to a List of Texts HMI element. If there is some roundabout way to do this I'd love to know it.
  11. I split this off to its own topic. For Enhanced Vision PLCs such as the V350, You must select "Burn Upload Project" during download in order to have the project available to upload.
  12. kratmel is absolutely correct. As I mentioned, we really need to see your project to understand what you're trying to do. The simplest method that solves kratmel's concern is the following:
  13. It would be best to see your project, but offhand I would try using a Negative transition of the alarm bit to Set the output. It might look something like this:
  14. You can also utilize RTC in ladder by using SI 30 - SI 38. There is also plenty of information in the Help file.
  15. You can easily create any kind of backup to SD in ladder, including Operand. Just add that and you can initiate the backup from Remote Operator.
  16. You seem to be demonstrating this well, but I'm amazed - I've never had this happen with the hundreds (thousands?) of downloads I've performed, both in the field and on my test bench. This is potentially a big problem that perhaps should be addressed by Unitronics Support.
  17. Or does the new program have the operands moved about? The retained memory will not know if the operand is at a different address with the new program.
  18. Flex727

    Vic

    My guess is that Vic's V570 is set up to communicate via MODBUS over UDP and he doesn't want to (or can't) modify the V570 program to change the socket protocol. Therefore he needs the UniStream PLC to communicate with the V570 using UDP.
  19. 😂 Totally agree here as well. I make it a practice to NEVER use conditional subroutine calls (or returns).
  20. Make it a practice to have them download a blank project and perform Initialize & Reset when starting up with a new PLC. This will also prevent what happens to me occasionally on my test bench where I do my program development. These PLCs will get hundreds of downloads for each project and eventually something in memory gets corrupted. A blank program download fixes that.
  21. 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.
×
×
  • Create New...