Jump to content

Recommended Posts

Posted

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 

 

 

Posted

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

Posted
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.

Posted
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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...