Jump to content

Flex727

MVP 2023
  • Posts

    3,261
  • Joined

  • Last visited

  • Days Won

    236

Everything posted by Flex727

  1. You're too kind. My approach, as is most of the other experienced members on this forum, is not just to answer questions, but to teach. More education helps the user and anyone else browsing these boards. I could have written your program for you in about 2 minutes flat, but you would not have benefited as much. We all learn best while doing, not watching.
  2. I haven't had time to review your code yet, but I'll make a general statement. Typically there isn't an easy or elegant way to have a master control in two different places. In any system there can only be one master if you want straightforward code, at least in my experience. If you need two different masters controlling the same thing you generally have to think it through very carefully and the algorithm will have to be tailored to the exact situation. You have to deal with communication timing and register overwrite. It can easily become a mess, especially if you don't fully understand the underlying mechanics. If someone smarter or more experienced than me comes along with elegance, I am definitely interested in learning along with you.
  3. You will also need to know the PLC name to connect with VisiLogic. That's also available from INFO Mode.
  4. -You don't need anything in the bottom part of the MODBUS Configuration in the slave. -You really don't need anything gating your SCAN_EX FB in the Slave. Just hang it directly on the left rail. -Place your MB 0 (Ready to connect) after you MODBUS Configuration, not before. You're NOT ready to connect until you've configured your MODBUS communications. It doesn't really matter since the config does occur before MB 0 gets used, but it's the principle of the thing. -Use a Direct Contact of SB 13 instead of a Positive Transition of SB 3. -You don't really need the delay timer TD 0. None of these things would stop your program from working, but I'm trying to help you with best programming practices. MODBUS is simple and straightforward. It's also very universal. I use it whenever possible. The only thing you have to watch for is getting all the details right. Once you've done that it's smooth sailing. Feel free to ask about any of these suggestions if you're curious.
  5. Just for clarity to everyone following this saga. The EXL-CAB295 is for the EX-A2X, NOT the EX-A1!
  6. I know this is a stupid question, but I've been caught by this. Do you by any chance have an Ethernet module installed in the PLC and is there any chance you're plugging the expansion cable into the Ethernet port instead of the expansion port?
  7. Store the value in a temporary location immediately after transferring it. Compare the new value to the stored value (+/-5). When the new value is greater than stored value +5 or less than the stored value -5, then send the new value and store it again to the temporary location.
  8. I just caught this. Sorry, I was referring to your rung comments in the PLC program. Have you had any luck in getting a single slave to communicate?
  9. Confirm that you are using the correct cable (it's not the same cable as that used with the EX-A2X) and confirm that you are plugging the correct end of the cable to the module and the correct end to the PLC (the cable can only be oriented one way). Also, confirm that the I/O modules are identical, and in the same order, as in the hardware configuration in the PLC program.
  10. What does "I went in to all the Socket Parameters" mean? In my post above I was suggesting you use Socket 2 in the slaves and initialize to 20261 - 20263. It doesn't matter which socket you use as long as the port number is correct. Also make sure they're all initialized to TCP Slave. The default for Socket 0 is UDP. My other suggestion is to limit your code to a single slave and get that working properly before trying to tackle communicating with 3 slaves simultaneously.
  11. What does this mean? I didn't see any glaring problems, but the issue with comms is that every single detail must be exactly right in order for everything to work. It requires going through every entry of every FB, loading into the PLCs, and observing operation - something I didn't have time to do.
  12. 1) When commenting, use full sentences. 2) Use the port numbers I suggested, Leave Socket 1 as 20256 for PC-PLC comms. 3) You cannot initialize more than one socket to the same port number. 4) Don't try to initiate a MODBUS command immediately on the heels of the previous one. Give it a little delay (maybe 20-50ms) You seem to be confusing local ports and remote ports. For simplicity, and to avoid confusion, I always use the same port number for master and slave, that way it's impossible to confuse them. Same port number for master and slave means the following: Master PLC: S0=20261, S2=20262, S3=20263 Slave 1 PLC: S2=20261 Slave 2 PLC: S2=20262 Slave 3 PLC: S2=20263
  13. If you would add comments to the rungs telling us what you're trying to do it would help immensely. Your code doesn't really match that well with your post and there is no way to tell if what you're doing is right if I don't know what you're trying to do. A few small items: 1) You do not need a ladder rung to set SB 168. Just the Power-Up as Set is sufficient (which you have done). 2) Try to avoid using Port 502 for this (just as a convention) as that is normally used for communicating with SCADA and other Ethernet connected devices. To help with identification, use Port 20261 for Slave 1, 20262 for Slave 2, etc. (just a suggestion, the PLC doesn't care what port numbers you use). 3) You don't really need to perform reads and writes separately since you have the handy Unitronics function for R/W. 4) If you have separate sockets for each slave there is no need to disconnect the socket, ever. 5) What is Socket 3 being used for? 6) Name your MODBUS_IP Configs to match the slave it will be used for.
  14. It's impossible to tell what you have from a screenshot of 3 rungs. Post your entire project with very specific questions and we'll try to help. Please keep in mind that nearly everyone on this forum is an unpaid volunteer with actual jobs, not Unitronics employees. We want to help but no one has time to write your program for you.
  15. Sounds like a fun project. Is this a classroom exercise? Regardless, take your best shot at it and post your project here. Someone will be happy to assist.
  16. It would help a lot if you showed us what was underneath those warning messages.
  17. This is an IT question, not a PLC question. The PLC doesn't behave any differently than any Ethernet connected device. You do not need a computer in the network with the PLC. All you need is to have the PLC connected to the internet in some fashion. The most common simple (most simple, but not the most secure) connection is to have the modem connected to a router and the router connected to the PLC. Within the router setup you would set up port forwarding to have port 20256 forwarded to the IP address of the PLC. Then you would connect to the PLC from outside the network with VisiLogic by connecting to the static IP of the modem and port 20256.
  18. Sometimes when I'm driving I feel like my car is invisible too.
  19. The EX-A1 is NOT a remote expansion adapter. It is a LOCAL adapter. Local adapters do not need to be specified in the Hardware Configuration. Just place your IO-DI16, IO-RO16, etc, modules on the DIN rail in the Hardware Configuration. The local expansion adapter is assumed.
  20. You should always endeavor to avoid conditional subroutine calls for this very reason. Write your code so that every ladder rung is executed on every scan.
  21. I'm going to have to take back my nicety. You must have MB 33 there because of MB 30. MB 33 being set allows the function to wait if there is a Function in Progress until MB 30 goes low. Without MB 33, then if MB 30 is high, that MODBUS transaction will not occur.
  22. Remember that power flow will only occur on the scan with the positive transition. MB 12 can be high all day and there will be no power flow to MB 33 except on the scan when the transition occurred. While you're online, manually Reset MB 12, then Set it again to see if the MI increments.
×
×
  • Create New...