Author Topic: How to communicate to a 1734-AENT, 1734-AENTR rack w EEIP Ethernet/IP library.  (Read 1649 times)

bachphi

  • Hero Member
  • *****
  • Posts: 642
    • View Profile
How to communicate to a 1734-AENT, 1734-AENTR rack with EEIP Ethernet/IP library.

With the current market supply situation, getting a PLC may be an issue for some,
and for a simple job, you may not need to have a PLC, but using just  I/O via Point IO ethernet adapter/coupler 1734-AENT and EEIP ethernet/ip library. 
The EEIP library can be downloaded from Sourceforge web site.
There are sample codes as well as a Youtube video (https://www.youtube.com/watch?v=NLCXnVpDgl4). 

But after following their sample and instruction, I could not get my solution running, and keep getting error:
An unhandled exception of type 'Sres.Net.EEIP.CIPException' occurred in EEIP.dll
Connection failure, General Status Code: 1 Additional Status Code: 789 Invalid segment in connection path.
From what I can see, other people ran into the same  issue.

Below is my actual working solution and its setup:

I set up the AENT with a static IP address, and a rack size of 4 ( AENT + IB8 + OB8E + IB8).
I  set Slot 1 Input bit 3 to be ON, and slot 3 input bit 5 ON.

Code: [Select]
Imports System
Imports Sres.Net.EEIP

Module Program


    Sub Main(args As String())

        ' The Following Hardware Configuration Is used in this example
        '  Allen-Bradley 1734-AENT Ethernet/IP Coupler
        '  Allen-Bradley 1734-IB8 8-Channel Digital Input Module [Input 3 ON]
        '  Allen-Bradley 1734-OB8E 8-Channel Digital Output Module w Status
        '  Allen-Bradley 1734-IB8 8-Channel Digital Input Module [Input 5 ON]

        '  This example also handles a reconnection procedure if the Impicit Messaging has Timed out
        '  (If the Property "LastReceivedImplicitMessage" Is more than one second ago)

        Dim eeipClient As EEIPClient = New EEIPClient()

        Try
            eeipClient.IPAddress = "192.168.10.11"  ' IP address
            eeipClient.TCPPort = &HAF12             ' port 44818

            eeipClient.RegisterSession()

            'From the eds file, the path for the Exclusive Owner Assembly Connection Is:
            '"20 04 24 66 2C 64 2C 65" ( Class 4, Config Assy. 102, Output Assy. 100, Input Assy. 101)
            eeipClient.ConfigurationAssemblyInstanceID = &H66   '102

            ' Parameters from Originator -> Target [OUTput from O=>T for 'Consumsed']
            eeipClient.O_T_InstanceID = &H64    ' Instance ID of the OUTput Assy. 100
            eeipClient.O_T_Length = 1          '#OfOutputModules The Method "Detect_O_T_Length" detect the Length using an UCMM Message
            eeipClient.O_T_RealTimeFormat = Sres.Net.EEIP.RealTimeFormat.Header32Bit    ' Header Format
            eeipClient.O_T_OwnerRedundant = False
            eeipClient.O_T_Priority = Sres.Net.EEIP.Priority.Scheduled  'implicit msg
            eeipClient.O_T_VariableLength = False
            eeipClient.O_T_ConnectionType = Sres.Net.EEIP.ConnectionType.Point_to_Point
            eeipClient.RequestedPacketRate_O_T = 100000     ' 500ms is the Standard value

            ' Parameters from Target -> Originator [T Produced to O as Inputs]
            eeipClient.T_O_InstanceID = &H65    '' Instance ID of the INput Assy. 101
            eeipClient.T_O_Length = 11          ' 8-bytes status header + 2In + 1 OutInstance
            eeipClient.T_O_RealTimeFormat = Sres.Net.EEIP.RealTimeFormat.Modeless
            eeipClient.T_O_OwnerRedundant = False
            eeipClient.T_O_Priority = Sres.Net.EEIP.Priority.Scheduled
            eeipClient.T_O_VariableLength = False
            eeipClient.T_O_ConnectionType = Sres.Net.EEIP.ConnectionType.Multicast
            eeipClient.RequestedPacketRate_T_O = 100000     ' RPI in  500ms is the Standard value

            ' Forward open initiates the Implicit Messaging
            eeipClient.ForwardOpen()

            While Console.ReadKey().Key <> ConsoleKey.Enter

                Dim ReturnedData As Byte() = eeipClient.AssemblyObject.getInstance(&H65)
                Console.WriteLine("State of 1st Input byte: " & ReturnedData(8))
                Console.WriteLine("State of 2nd Output byte: " & ReturnedData(9))
                Console.WriteLine("State of 3rd Input byte: " & ReturnedData(10))

                'eeipClient.O_T_IOData(0) = 3                'Write to Slot 2 Output Bit 0 & 1
                System.Threading.Thread.Sleep(500)

            End While


        Catch ex As Exception
            Console.WriteLine("Exception:" & ex.ToString)

        Finally
            ' Close & Unregister the Session
            eeipClient.ForwardClose()
            eeipClient.UnRegisterSession()
        End Try



    End Sub
End Module


« Last Edit: June 01, 2023, 08:26:25 AM by bachphi »
===================================================
This is NOT alt.read.my.mind.
No such thing is sh^t-for-brains unless you are posting to alt.read.my.mind.
===================================================