Jump to content

Flex727

MVP 2023
  • Posts

    3,261
  • Joined

  • Last visited

  • Days Won

    236

Everything posted by Flex727

  1. Don't forget that you also need a Scan_EX FB for the MODBUS slave and addressing from the Siemens PLC will likely be "off by one" since Unitronics addressing starts at address zero and MODBUS addressing starts at one.
  2. Not sure I understand your question. You must use a socket initialization FB anytime you wish to assign a different configuration to the socket than the default assignment. Many programmers initialize all the sockets anyway just to have visibility into each socket's assignment and to help make sure there is no duplication of port numbers. Any socket that will be used for MODBUS communications (whether master or slave) must also have a MODBUS configuration FB. All the initializations, configurations, etc, should be activated by SB 2.
  3. Network ID is usually not important for TCP (but may depend on what device you're communicating with). The slaves table is only needed if the PLC is the master.
  4. You can use any socket for any purpose. Those are just the defaults, but don't inadvertently assign the same port number to two different sockets.
  5. Yes, you have 4 sockets available to you for Ethernet communication in the Vision line of PLCs (8 if you are using a V700). Simply initialize any sockets you wish to use if you want the sockets to be a protocol or port number different than the default. Here is the default (available in the Help file):
  6. Yes. There are example projects that came with your VisiLogic installation and there are YouTube tutorials and webinars available. Review those and make an attempt at what you're trying to do. If you still have difficulty or questions, drop back by and someone will help you.
  7. I've never encountered this situation, but I would contact Unitronics support directly. This error message looks to me like VisiLogic is out of memory, not the PLC. Is there some special situation with your PC that might result in insufficient memory space for VisiLogic?
  8. I neglected to answer this question. This option does create a conditional subroutine which is why I never use it. There may be a specific need for it that I haven't encountered which is the reason Unitronics included it. I rarely use any of the "display controls" and prefer to create all my HMI calls in ladder. The only exception to that would be PLCs with physical buttons that need to be associated with different screens in different ways. I just now see Joe's response, which I totally agree with. With his single subroutine for Outputs (and Inputs, perhaps in a different subroutine) he is creating I/O "buffering. This is excellent programming practice which allows for easy code revision, easier testing, and reduced confusion at a later date.
  9. The PLC doesn't care whether the code runs or not. The poor programming practice is due to the fact that conditional subroutines can often execute in ways you don't expect (for instance, coils being left in limbo). There is no reason to do it that way. Ladder logic is not the same as regular computer programming and should not be treated that way. Except for very unusual circumstances, the only purpose for subroutines (in ladder logic) is to break your code up into manageable chunks. Every line (ladder rung) in the entire program should be executed on every scan. This avoids unexpected behavior and ensures that you don't trigger the Watchdog Timer. Bear in mind, I am giving my opinion on best programming practice. Other experienced programmers may have a slightly different opinion and there is no absolute right or wrong here. I am providing the benefit of my experience and skill which you may accept or ignore.
  10. If you want a button to be inactive during certain times, use the "Disable mode" function, but your solution doesn't solve the problem you're stating. Since you can only push the button when you're on a certain screen and the only check you're performing is to check to see if you are on that screen, then you aren't accomplishing anything.
  11. What you are asking is why it is bad programming practice to have a subroutine called conditionally. Write your code such that every subroutine is called on every scan. To answer your question, any coil will remain in the last state it was in the last time it was executed. It sounds like you are WAY over-complicating your program. Unless there is a lot more going on than what you describe, you probably don't need a subroutine at all. Also, why do you need the "is displayed" operand for this? If the HMI screen is not being displayed, then you can't press the button. Why do you feel you need the extra check to make sure the screen is being displayed?
  12. No, there are no issues with this. Just be sure to install everything "As Administrator".
  13. Why are looking for a better solution? That's pretty much why you have positive transition contacts available as a programming option.
  14. I don't understand. You say you know how to multiply but don't know how to divide??? Or is it you're just getting the wrong result? If you're getting the wrong result it's because you cannot store 53000 in a 16-bit signed integer format. Try doing the divide before the multiply. If that's not possible, read the Help entry under "32-bit long values".
  15. Under the Store menu, use Load Timer/Counter Preset. You'll probably want to use an ML as the units are in 10ms (the value for 5 sec would be 500).
  16. Assign an MB to the field for Legal Entry. When that bit goes high, an entry was made to that variable. You can then test that entry in ladder in any way you need.
  17. There are two possibilities (assuming your wiring is correct). Either the jumper is set wrong (as @Cam mentioned) or you do not have the MI assigned to the correct analog input.
  18. I haven't had occasion to use this object, but looking at it, it seems pretty straightforward. Did you read the Help entry? A Radio Button object just presents a set of mutually exclusive items that the user can select. Only one of the items can be selected at a time. An integer register will contain the index number of the selected item. Besides the Help file, you can also hover your mouse over each item in the Properties Window for a tip on how to use each item. Put it in your program and play with it until you understand what's going on.
  19. There are example programs that came with your VisiLogic installation. I strongly recommend that you take a look at the one for MODBUS TCP Master. Look in Examples/Version 900/Project Examples/Communications/Ethernet/Ethernet MODBUS IP/V280_Ethernet_TCP_MODBUS_IP_Master.vlp Your program still doesn't have a CONNECT function and you definitely do NOT want the SCAN EX FB. Also, what are you trying to do in Rung 6? You are attempting to communicate on every scan, and while that may be possible depending on the device you're trying to communicate with, your other communication functions will not work with that.
  20. Don't you need to CONNECT to the slave before you can exchange data? Also, don't forget that Unitronics addressing starts at zero while MODBUS addressing starts at 1. Be sure to account for the "off by one". And you should change MB 1 & MB 2 in rungs 2 & 3 to positive transition contacts instead of direct contacts.
  21. I haven't run across this before, but as a general rule when I have issues with downloading I do the following: - Confirm the version of VisiLogic that you are using matches what version was originally used to download the project. - After making sure you have a saved version of the project, download a BLANK project to the PLC. - Download your original project again. - Now try Burn Upload Project again.
  22. Not that it makes that much difference, but it looks like Dustin should be using List of Images by Pointer, not Range.
×
×
  • Create New...