Jump to content

Flex727

MVP 2023
  • Posts

    3,301
  • Joined

  • Last visited

  • Days Won

    240

Posts posted by Flex727

  1. And to expand a bit for anyone unfamiliar with Ladder Logic. In normal computer programming, subroutines are typically used to execute some code under certain specific conditions (e.g. a print subroutine would only be executed when the operator issued a print command). This should not be done in Ladder Logic - subroutines should only be used to organize your code into manageable chunks, but every subroutine should be executed on every scan. You have to have a bit of a different mindset when creating proper code in Ladder Logic.

  2. 3 hours ago, Isakovic said:

    Turns out you don't need to have defined slave addresses in Modbus Configuration FB.

    Wow, this is interesting news. It seemed to me that I had problems at one time with the slave address incorrect in the Config FB, but maybe I'm misremembering. This is great information to file away for future reference. Thanks @Isakovic for taking the time to collect the data!

  3. Did the IT contractor forward port 20256 to the correct IP address of the PLC? Is there any firewall in place that might prevent access? Is the Default Gateway set correctly in the PLC? Are you certain about the external IP address (can you ping it from your phone)? Are you sure your phone is trying to connect through cellular and not through wifi?

    I have done this many times and usually have no issue as long as the addressing is correct.

  4. 3 hours ago, Isakovic said:

    I'm not sure about reinitializing Configuration FB. It does have addresses for only 15 slaves,

    I'm sure you're correct about not needing to reinitialize the FB in normal situations, but I assumed it would be necessary at some point if you have more than 15 slaves. I thought it would be simpler to have a single routine that repeats for each of the 20 slaves. You could do 10 and 10, but I don't think it saves any time as the FB initialization appears to complete in a single PLC scan.

    • Like 1
  5. On 6/10/2020 at 4:23 AM, newbie88 said:

    So do i need to close/open socket every time when i'm reading values out of it upon the complete switching?

    My understanding of MODBUS TCP is that you MUST Connect with each device you communicate with. To connect to a different device using the same socket, you must Disconnect, re-initialize the MODBUS Configuration FB, then Connect to the new device. You have System Bits that will help you determine the status of all this, but I would use timers to be sure sufficient time has occurred for all the operations to complete. I would expect communication with 20 slaves to take perhaps a couple of minutes if you want it to be 100% reliable.

    • Like 1
  6. 5 minutes ago, Ausman said:

    Hmmmm. I have great mental pictures of you restlessly prowling around the house waiting for midnight to tick over.  Coffee jitters, keys jangling in hands, can't wait to push the right one in and turn it!

    Eerie! It's like you were there. :)

    • Like 1
  7. I had a Hyundai Santa Fe once upon a time that strangely had the calendar date displayed on the dash. It was set with the month day and year and knew which years were leap years. However, the subroutine that it went into to allow February to have more than 28 days failed to have an exit. So, on leap years it would continue to count up from February 29th, each day incrementing up. It was easily fixed by resetting the date to March 1st, but I had to see what it would eventually do. Each day it incremented up until it hit February 99th, and since there were only 2 digits, I couldn't wait to see what it would do the next day. You would have thought that maybe it would go to 00, but it didn't. It completely lost its mind and displayed nonsense symbols every day thereafter.

    • Like 3
  8. 11 hours ago, Joe Tauser said:

    I believe you that Modbus IP takes over and won't let go.

    Before I wrote my comment I re-created his routine with just one socket and tried everything I could to get the MODBUS configuration to let go without a PLC reset. Nothing worked. I was very surprised. I also took a look at the System Integers that denote socket configuration, but they are all read-only. I'm thinking Unitronics needs to address this if possible.

  9. As far as I can tell, you cannot change the configuration (as opposed to the protocol) of a socket without a configuration FB. It seems that the socket initialization (or card initialization) should reset the configuration, but it doesn't except by PLC reset. Since there is no PCOM configuration FB that I am aware of, it seems that a PLC reset is your only option. You might want to contact Unitronics support to confirm this, and if confirmed, request they add the feature on a future update to VisiLogic.

    I'd like to find out that I'm wrong about this as I think it's an oversight by Unitronics.

×
×
  • Create New...

Important Information

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