Announcement

Collapse
No announcement yet.

Modbus TCP Kitchen Sink example

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Modbus TCP Kitchen Sink example

    The information provided in the AutomationDirect knowledge base is provided "as is" without warranty of any kind. AutomationDirect disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. In no event shall AutomationDirect or its suppliers be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages, even if AutomationDirect or its suppliers have been advised of the possibility of such damages. Some states do not allow the exclusion of limitation of liability for consequential or incidental damages so the foregoing limitation may not apply.

    Purpose:
    Modbus TCP Server for P1AM-ETH with access to P1 Input/Output Modules.

    This sketch creates a Modbus TCP Server for up to 8 connections. Slot1 Inputs are mapped to Modbus Input Bits 100001 to 100008. Slot2 Outputs are controlled by Modbus Coil Bits 000001 to 000008. Modbus Holding Register 400001 is always incrementing.

    The P1AM-100 cpu will require external 24vdc power for the IO modules to function. This example uses Serial.print() to display status information. The
    Serial Monitor must be running for the sketch to start.

    Note: Have attached a Cmore EA9 ver 6.52 to use in conjunction with this example.

    Dependencies:
    https://github.com/arduino-libraries/ArduinoModbus
    https://github.com/arduino-libraries/ArduinoRS485

    Check out the code here:
    https://github.com/AutomationDirect/...CP_KitchenSink
    Last edited by ADC_CommTeam02; 03-02-2020, 11:02 AM.

  • #2
    I got to loading up the sketch on the P1AM, the project on the EA9 but ran into a roadblock. I have the EA9-T6CL-R which does not support ethernet protocol, I have the EA-DH485-CBL to hook it up to the P1AM. is its possible to interface them? or does it have to be through the ethernet port of a supporting panel like the EA9-T6CL?

    Comment


    • #3
      Do you have the P1AM-ETH module to do ethernet? If so, the EA9-T7CL-R would be a more economical solution for an HMI that does Ethernet. The EA-DH485-CBL is a serial cable that does RS-485 specifically designed for connecting the EA9 panels to Allen Bradley PLCs.

      Comment


      • #4
        Hello again. so I got the EA9-T7CL-R. On the P1AM (24V powered) i have the P1AM-ETH, the P1-08SIM (slot 1) and the P1-08TRS (slot 2). I uploaded the programs on each and I'm using a CAT5e ethernet cable. I'm still getting "PLC-001: PLC Communication Timeout". I'm running the serial monitor and it get the "Done with setup" message. I have very little experience with C-More so bear with me. what am I not doing/missing?
        Last edited by pqelectron; 03-25-2020, 09:49 AM.

        Comment


        • #5
          PLC-001 means that the %DEVICE% did not respond to the HMI request.
          Maybe post your configs - ethernet IP address/subnetmask/gateway for HMI and P1AM-ETH

          Comment


          • #6
            Originally posted by kewakl View Post
            PLC-001 means that the %DEVICE% did not respond to the HMI request.
            Maybe post your configs - ethernet IP address/subnetmask/gateway for HMI and P1AM-ETH
            Yup that was exactly what my problem was. I called AutomationDirect and their tech Jeff setup the example on his end, called me back a couple hours later and got it to work! Seriously I have nothing but positive experiences every time i deal with AD. I'm posting screenshots of the settings that need changing for the example to work. (for the newbies like me)
            Attached Files

            Comment

            Working...
            X