Jump to content

Flex727

MVP 2023
  • Posts

    3,279
  • Joined

  • Last visited

  • Days Won

    239

Posts posted by Flex727

  1. On 3/13/2018 at 5:12 AM, Ausman said:

    Hi,

    1).  Vision reads bar.

    2).  Vision executes bar entry routine.

    3).  Vision proceeds to bar.

    4).  Vision reads different codes.

    5).  Vision interprets codes, runs decision-making subroutine.

    6).  Vision waits for a while accepting results of decision-making sub.

    7). Vision leaves bar sub.....somewhat unsteadily.

    8). Vision attempts to run main program normally, but errors appear out of nowhere.

    :blink:

    Hmm, I read something recently that might apply. Oh, yes, here it is:

    image.png.a63a3d8e6b82ef4e1f48cae6c3d48b56.png

  2. I moved this thread to the correct forum.

     

    For coils, the DECIMAL address should be the same as the MB number, with the proviso that Unitronics addressing starts at zero whereas the MODBUS standard (and Siemens iirc) starts addressing at one. Therefore when addressing from the Siemens Master, add 1 to the MB number to get the correct decimal addressing for the master.

    • Like 1
  3. 14 hours ago, Joe Tauser said:

    Also, I'm not entirely sure what's under the hood in the way Unitronics handles being two Modbus IP slaves at the same time.  I'd give myself a way to turn on and off the slave functionality for each one:

    I've done this multiple times and there is no issue. The Vision PLC handles this without the need to add logic. I've also done multiple MODBUS R.H.R commands in the same PLC cycle with no problems.

  4. 6 hours ago, petchpetals said:

    My collegue told me that the level sensor is wired with input 9 and the temperature sensor is wired with input 10. Does that make sense ?

    Yes, I don't have a V430 here in my office and it's been awhile since I used one so I didn't realize how they had it labeled. You are correct. I had forgotten that some of the smaller Unitronics PLCs with built-in I/O have some digital inputs that can be jumpered and wired as analog inputs. Yes, inputs 9 & 10 can be wired with a thermocouple (negative to 9 & positive to 10). That will be T/C 0 and will be assigned analog input 0 in VisiLogic. Inputs 7 & 8 can be wired for T/C 1, which will be assigned analog input 1. Analog inputs 2 & 3 can be wired to I6 & I5, respectively.

    Sorry if I led you astray earlier - the V430 is a bit different in some respects than most other Unitronics I/O.

    For the temp sensors, the MI assigned will hold the temperature reading to the tenth of a degree (i.e. 98.6 F will be 986 in the MI). For the analog inputs, the MI will hold the analog to digital conversion of the mA measurement to a resolution of 14-bits, so it will be a number between 0 & 16383 (3277 - 16383 for 4-20mA).

  5. There are a number of example program that came with you VisiLogic installation. Take a look at those to see how to code your program for ethernet communications.

    1) When you assign and IP address to the PLC, it needs to be on the same subnet as your Raspberry Pi. In other words, whatever the address is of the Raspberry Pi, the PLC needs to have the first 3 numbers the same. The last number can be anything between 0 & 255 as long as it's unique to the network it's on. Subnet Mask should be set to 255.255.255.0 and default gateway is only important if you are trying to communicate over the internet. Just set it for the same subnet with the last number 0 or 255.

    2) Do you know how to set up your HW Configuration? That must be done in order for your PLC to collect data from the I/O. When assigning an MI to the analog input in the HW Config, it should be obvious which input you are assigning. The 4 rows are for analog inputs 0-3.

    I'm not sure what you mean by inputs 9 & 10. You only have 4 analog inputs, which will be labeled something like AN0 - AN3. Perhaps you're confusing them with digital inputs?

    Also, unless you are connecting your PLC through a hub, router, or switch, you may need to use a crossover ethernet cable.

  6. A couple of things:

    1) Please do NOT place multiple logic threads in a single ladder rung. You did not break them up into separate rungs. The whole point of ladder rungs is to separate out the logic so there are no conflicts or confusion within a logic statement.

    2) You don't really need anything in front of the SCAN_EX blocks. Just hang them directly on the left ladder rail. If you feel like something should be there, use SB 145 & SB 146 instead.

  7. Yes that all looks correct assuming you have the SCAN_EX blocks addressed correctly. And yes, you are correct that the MODBUS Configuration block is just showing you the defaults.

    There is no need to pack your ladder rungs so much. I like to tell people that Unitronics does not charge you by the rung. Break those logic pieces into separate rungs. What you have should work, but new users often get in trouble with overly complicated ladder rungs that don't compile the way you think they would. I would place each Socket Initialization, with its accompanying MODBUS Config into a separate rung (with SB 2 in front), and each SCAN_EX block into a separate rung.

  8. Yes you need to initialize and configure each socket you're going to use for MODBUS IP. Pick any two sockets, though I would leave Socket 1 initialized to Port 20256 to use for a VisiLogic connection. I would keep Socket 2 at the default of Port 502 and initialize Socket 3 to Port 503, but it doesn't really matter - just don't initialize two sockets to the same port number, keeping in mind the default assignments.

    You also need to configure each socket you're going to use for MODBUS IP with a MODBUS IP Configuration block. Don't duplicate addresses. The network ID isn't important with TCP, as I understand it, but you can assign them any way you want.

    Then you will need two separate MODBUS IP SCAN_EX function blocks. Be sure the SCAN_EX block assignments match to the relevant MODBUS configuration names.

    Set up one of the masters to communicate with port 502 and the other to port 503.

    That's all there is to it.

×
×
  • Create New...

Important Information

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