Jump to content

Flex727

MVP 2023
  • Posts

    3,276
  • Joined

  • Last visited

  • Days Won

    239

Posts posted by Flex727

  1. 4 hours ago, Khom said:

    1- Erase old programs to start fresh and,

    When you install a new program from VisiLogic it will erase the old one automatically.

    4 hours ago, Khom said:

    2- Would appreciate with any help to get me started with linking and communicating the PLC with Visilogic.

    Just grab a mini-USB cable and plug it between your PC and PLC. You can install the necessary driver from within VisiLogic.

    4 hours ago, Khom said:

    I assume the miniUSB port is only for the sake of reprogramming and not initialising the PLC with new IP address, what would be used to set an IP?

    Assuming you have a V200-19-ET2 module installed in the PLC, you can set the IP address either through INFO Mode or by ladder within the PLC program.

    I heartily recommend reading through the Help file included with VisiLogic. It has most of the information that you seek. Also, there are example projects that came with your VisiLogic installation. Don't worry that many of the examples are for other PLC models as the programming is the same for all.  They can be very helpful. Unitronics has many webinars online that will walk you through the basics of programming Unitronics PLCs.

  2. Perhaps I'm the only one, but I suspect not - everytime with any gadget or situation with software running I am always trying to figure out the algorithm. For example, I've been driving a rental car this week. It's the first car I've driven that has that horrible auto-shutoff of the engine when stopped at a light. Personally, I think it's a really stupid feature and it's unnerving. However, I noticed it didn't shut off right away so I started to try and figure out what conditions caused it to shut off. It seemed to be a timer at first, but then the timer seemed to vary. Everytime I collected a new piece of data it seemed to contradict what I had already figured out. Then once it re-started all by itself while I still had my foot on the brake and hadn't moved. This algorithm was starting to look very complicated and I knew it couldn't be right.
    Then it hit me! It was indeed extraordinarily simple, there was just a single added piece that I didn't take into account at first. The whole thing is one line of code, as follows:

    image.png.8b7520c30bdca4e3cf2e57200fcf9d67.png

  3. 14 hours ago, Fernando Castro said:

    I mean most other brands ask you to keep or change values stored in memory, but unitronics seems to do, it only for timers... and also what about everything being persistent in the memory 

    This is correct. I, likewise, wish there was an option for integer registers during download like there is for timers. However, no integer register should be affected by a download. The only reason a register's value might change is due to ladder logic or a Power-Up value when the PLC is reset. Do you perhaps have some Power-Ups you're unaware of? Downloads sometimes reset the PLC then the Power-Up would take effect.

  4. This is not something I've ever had to do, but my first thought would be enter the time in UTC format for Variable 1 and an ML or DW for Variable 2, then do the appropriate math before  subtracting Variable 2 from Variable 1. After that, a little more math before comparing to SI 31. The Help file provides plenty of information about these functions to assist you.

    I'm sure someone will come along who has done this before and will provide a ridiculously easy solution.

  5. If you search this forum you will find that this has been asked and answered many times. The bottom line is that there is no software simulator available. It is recommended that you purchase a PLC for your software development. This is usually a cheaper solution than other manufacturers' simulators and is guaranteed to be 100% accurate in the simulation. Unitronics PLCs are designed to operate without the associated I/O for the programmer's convenience (and cost saving). When you consider that the PLCs are inexpensive and the programming software is free this is a workable solution.

  6. 19 minutes ago, AlexUT said:

    There are multiplication and division inside linearization FB and in some cases result may surprise you.

    This is what I suspected all along. There is math behind the scenes to execute the linearization function. Trying to linearize very large numbers can result in a register overflow somewhere in that math. Use AlexUT's suggestion to divide the ML by 100. It's very simple, can be in the same ladder rung, and doesn't even require another operand.

  7. 10 hours ago, Jesse said:

    Can't edit them either because of the watermark.

    What I do is place the image on the HMI screen in VisiLogic, do a screen print to copy the screen, paste it into Paint, crop as needed, then rotate and save as .bmp. This eliminates the watermark. Make sure you have a pixel available in the upper left corner if you want a transparent image. This sounds a bit tedious, but once you've done it a few times it's quick and easy. You can quickly build your own library to use.

    Also, be sure your HMI display is not expanded size before the screen print.

  8. 39 minutes ago, Joe Tauser said:

    Should we just delete these posts from the forum?

    In my opinion, no. It's a good opportunity to explain that a PLC is always the best simulator and is usually cheaper than software simulators for other manufacturers.

  9. Just looking at your Haustechnik.vlp file, you need SB 2 in front of your MODBUS Configuration block in ladder rung 12 of the Main Routine. You are currently initializing your MODBUS Configuration on every scan which can interfere with communication. Your TCP/IP Connect and MODBUS R/W functions appear to be trying to work on a single scan. You can't do that. You do not need to disconnect after every R/W. Just connect then leave it connected, then perform your R/W function whenever you want, but no more often than about every 50-100ms. If you insist on connecting and disconnecting for every R/W (very much NOT advised), then make sure you allow TIME for all that to occur - Ethernet connect and disconnect can be SLOW.

    For your Connect function, Set a bit at the end of your MODBUS Config, then use that bit (direct contact, not a transition) to Connect. At the end of the Connect thread, Reset the bit. Once the Socket is connected, you can communicate at will.

    There is no reason to scatter your communication functions all over your program. Place your Configs and Connects in the Main Routine near the top with the SB 2 stuff. Your R/W function can be elsewhere as needed. This helps with troubleshooting. In the slave program I would also place the SCAN_EX in the Main Routine near the top. None of this prevents the program from working, but it is best practice.

    Also PLEASE stop putting multiple logic threads in a single ladder rung. For example, in rung 10 you have 4 separate subroutine calls in the ladder rung. That should be 4 separate rungs. Same thing in rung 12. That subroutine call should be in a separate rung. Another example, BMA Routine rung 1 you have 3 logic threads in a single rung. Yes, this often works, and no you don't get a compile error, but it is extremely poor programming practice and can cause unfortunate logic bugs due to the compile being different than what you expect.

×
×
  • Create New...

Important Information

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