Menu

Mulitple instances of eeip / connecting to more than one device

JK
2019-08-02
2022-09-01
  • JK

    JK - 2019-08-02

    Is it possible to connect to more than one device using implicit messaging?

    I am able to connect individually. However, if I try to connect to 2 devices at the same time I get a C# Socket Exception: "Only one usage of each socket address (protocol/network adapter/port) is normally permitted'.

    Is this a known limitiation or am I doing something wrong?

    Thank you!

     
  • Jurell Spivey

    Jurell Spivey - 2019-08-08

    You must change the port number for the various devices.

    Example:
    eeipClient1.OriginatorUDPPort = 0x08AE;
    eeipClient2.OriginatorUDPPort = 0x09AE;

    Make sense?

    Thanks

     
    • Jim Sornig

      Jim Sornig - 2022-06-25

      Hi Jurell,

      I tried changing the Originator UDP Port and the connection starts but times out. Is there another propery that I must change? I am using a Turck I/O Block TBEN.

      Thank you for any help
      Jim

       
  • JK

    JK - 2019-08-09

    Thank you Jurrell. This solved my problem.

     
  • Ryan Campbell

    Ryan Campbell - 2019-10-17

    I'm having this exact same problem but setting the port to anything other than 0x08AE results in the connection timing out. Is the port supposed to be set after ForwardOpen or only after RegisterSession? Do I maybe have to do something with windows firewall?

     
    • Bisl

      Bisl - 2022-04-20

      Hey Ryan,

      I think I'm having the same timeout issue with multiple devices, did you manage to find a solution?

       
      • Ryan Campbell

        Ryan Campbell - 2022-04-22

        Hey Bisl,

        This was a few years ago so my memory is a bit fuzzy and I don't remember where I put that code. But I was never able to get the default code to work. What I learned though was that basically, some devices will always respond on the default UDP port regardless of claims; in my case it was a Turck FEN20. Proper Unicast UDP should allow port binding, which is why it's frustrating.

        So I ended up writing a connection manager that was basically a dictionary of connection objects using the built-in connection ID as the key. So when a message was received, the connection ID could grab the proper .NET object and respond appropriately.

        Hope this helps.

         
        • Jim Sornig

          Jim Sornig - 2022-06-25

          Hey Ryan,

          I am having the same issue. I have two Turck Blocks and when I change the Originator Port the connection starts but times out pretty fast. Do you think you could find your code and show an example.

          Many Thanks,
          Jim

           
          • Ryan Campbell

            Ryan Campbell - 2022-09-01

            Sorry it took so long to respond but I did finally get a chance to dig around for that project and upload it to GitHub. I tested it before I left the office today and it is working with a couple of Turck devices on my desk.

            Here's a link to my testing branch

             
  • Ryan Campbell

    Ryan Campbell - 2022-09-01
     

    Last edit: Ryan Campbell 2022-09-01
  • Ryan Campbell

    Ryan Campbell - 2022-09-01
     

    Last edit: Ryan Campbell 2022-09-01

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.