jbelz68

TCP socket with Omron NX102

5 posts in this topic

Hi, I'm new to this forum. I'm trying to talk to a Mettler Toledo load cell with TCP socket on a Omron NX102. The load cell port is 23 (telnet). I can talk to the load cell with my laptop using their software or with Putty without any issues.

I use the SktTCPConnect function as follow:

SktTCPConnect_instance(
Execute :=TRUE,
SrcTcpPort :=UINT#0, // Local TCP port number: Automatically assigned.
DstAdr :='192.168.250.50', // Remote IP address
DstTcpPort :=UINT#23, // Destination TCP port number
Socket =>WkSocket); // Socket

But the SktTCPConnect instance .Done output never returns true so I can't move forward with the next instructions. I made sure all the SktTCP functions have their Execute inputs intialised to False before that. 

In the built-in Ethernet IP port settings, the TCP/UDP message service is set to Use and I left the default 64000 under Port 1 - Port No. 

What am I doing wrong?

Thanks 

 

 

Share this post


Link to post
Share on other sites

I find it much easier to use in ladder. I would try making a variable for the execute input and toggling it on and off to see what happens. I have found with this function block occasionally you need to toggle it on and off again. Also - have you disconnected Putty and all other devices you were connecting with before trying to connect with the PLC? 

You can also use the SktGetTCPStatus function block to get more information. I attached a screenshot from a program I have used it in previously

Capture.PNG

Share this post


Link to post
Share on other sites

Thanks @photovoltaic, it did the trick.

I didn't even have to toggle the execute input, it connected straight away. Not sure what was wrong with the ST, but I will now switch to ladder.

 

 

Share this post


Link to post
Share on other sites
1 hour ago, jbelz68 said:

Thanks @photovoltaic, it did the trick.

I didn't even have to toggle the execute input, it connected straight away. Not sure what was wrong with the ST, but I will now switch to ladder.

 

 

I strongly suggest making a variable for execute, I have had this function lose connection before (which is very easy to detect with SktGetTCPStatus ) and re-toggling the execute bit restored the connection.

Share this post


Link to post
Share on other sites
27 minutes ago, photovoltaic said:

I strongly suggest making a variable for execute, I have had this function lose connection before (which is very easy to detect with SktGetTCPStatus ) and re-toggling the execute bit restored the connection.

yes, will do, thanks for your help.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now