PLCTAG_ERR_BAD_GATEWAY error

198 views
Skip to first unread message

Maurizio Santagati

unread,
Apr 5, 2023, 10:21:01 AM4/5/23
to libplctag
Hi all,
I'm testing libplctag.NET to connect to a Rockwell PLC with 1756-L61 CPU that is not directly reachable from my subnet.
Here my configuration as seen by RSLinx:

Configuration.png

I've build a connection path in this way "1,1,2,192.168.4.111,1,0" but it generates a STATUS_CODES.PLCTAG_ERR_BAD_GATEWAY error.
The complete Tag parameters used are:
 var tags = new Tag<TagInfoPlcMapper, TagInfo[]>()
 {
                Gateway = "10.4.34.35",
                Path = "1,1,2,192.168.4.111,1,0",
                PlcType = PlcType.ControlLogix,
                Protocol = Protocol.ab_eip,
                Name = "@tags"
};

Can someone help me, please?
Does libplctag support paths more complex than "1,x" ?

Thanks in advance.
Maurizio

Fernando B

unread,
Apr 6, 2023, 5:30:59 PM4/6/23
to libplctag
Hi Maurizio,

I believe libplctag does support custom cip routing is just not well documented, on the api or examples but I found this issue which Kyle talks about. Hopefully this gets you on the right path.


Happy coding, Fernando https://github.com/TheFern2

Maurizio Santagati

unread,
Apr 6, 2023, 6:39:24 PM4/6/23
to libplctag
Perfect tip, Fernando. It works great!
As detailed by Kyle to specify a path segment composed by an ethernet card, one should write '18,192.168.x.y' and NOT '2,192.168.x.y' like I did.

Thanks a lot.

Maurizio

Kyle

unread,
Apr 6, 2023, 8:59:42 PM4/6/23
to libplctag
Thanks, Fernando!

I thought I had that documented somewhere on the wiki, but I don't see it.   Huh.  

Best,
Kyle

Fernando B

unread,
Apr 7, 2023, 1:50:05 PM4/7/23
to libplctag
Noice glad you got it going!, hey the best documentation sometimes is the source code lol. I checked the code first, and saw how the path was being handled.
That's how I figured custom path was implemented. Issues are also documentation in my book.
Reply all
Reply to author
Forward
0 new messages