Unabled to connect

for everything else
Post Reply
edgar
Posts: 12
Joined: Mon Mar 15, 2010 4:15 am

Unabled to connect

Post by edgar »

Hey Guys,
I'm using SB70LC, now its running a Modbus Application. The Modbus Server/Slave works great but now i'm having an issue when i'm trying to connect to another controller. I execute the 'connect' and it times out, i see activity but for some reason i can connect. Is theirs anything i'm doing wrong? This is a TCP to TCP app.

Code within a Class object: The controller is on a DHCP network.
const char *pIP = "xx.yy.zz.aa";

IPADDR addr = AsciiToIp(pIP);
m_handle = connect(addr,0,502,TICKS_PER_SECOND*10);
Operation times out and m_handle is always -1.

Please let me know if i'm missing something.

Ed
User avatar
tod
Posts: 587
Joined: Sat Apr 26, 2008 8:27 am
Location: Southern California
Contact:

Re: Unabled to connect

Post by tod »

Probably need a little more info here. But you can try a couple of things, just to exonerate the NetBurner client. Assuming you have a PC on the LAN with your NB. Can you ping the controller? If so, can you open a DOS prompt and Telnet in using port 502?

If you can do that then you know nothing between you and the controller is blocking that port (like a firewall), and noone else is already using that port. So make sure you ctrl-] and quit Telnet before going on.

Please excuse my potential ignorance but I don't know anything about ModBus and I'm assuming it's somewhat irrelevant to your question as you're just trying to connect over TCP/IP from a client to a server.

I'm assuming that you don't have "xx.yy.zz.aa" in your ip string but some actual valid address you didn't want to disclose (or maybe there's a magic address I don't know about?) Other than that your use of connect() looks fine.

Is the controller on the same LAN as you? Do you have physical access to it?
edgar
Posts: 12
Joined: Mon Mar 15, 2010 4:15 am

Re: Unabled to connect

Post by edgar »

Thank you guys, Problem was solved with netburner tech support. The solution was as simple as adding a local port randomization mechanism.

Ed
Post Reply