Sign in to follow this  
Followers 0
DaveHarbon

Ethernet Comms

11 posts in this topic

I have a project at the moment to measure temperature of products (3) and display the information on some bespoke LED screens (3). The screens I have ordered are sat on the ethernet network and are controlled by sending ASCII data to them. The ASCII data contains the serial control, address and charachter data (the displays are controlled serially after the ethernet interface). Can I use the network SEND(090) command to send the data to a device on the ethernet network (same local network 1) of will I have to go down the route of using function blocks and open a socket/send data using the Omron function block library for the ETN module? Many thanks in advance Cheers Dave

Share this post


Link to post
Share on other sites
Dave I am going to assume that these screens are not Omron products, and therefore do not use the FINS protocol. The SEND instruction is a FINS SEND, only capable of FINS communications to Omron devices (or devices that use Omron FINS). So, Socket Services would be needed to send generic ASCII strings on Ethernet. Sadly, the CJ1M PLCs with built in Ethernet cards do not support Socket Services. They are FINS Ethernet cards only. The CJ1 with built in Ethernet does not have Socket Services or Email capabilities. A CJ1W-EIP21 module needs to be added to the PLC to use Socket Services to send ASCII data.

Share this post


Link to post
Share on other sites
You are correct, the screens are not Omron products and I do need to use socket services, i've changed my hardware today to CJ1M CPU13 + ETN21 module that supports socket services. Im having a little more progress at the moment, i'm a little unsure though how to send ascii data. I assume that this needs to be in hex in the D memory? Many thanks for your reply

Share this post


Link to post
Share on other sites
The ASCII strings need to be sent from somewhere in memory. It does not specifically have to be the Data Memory area, although this is probably the most commonly used. TCP or UDP?

Share this post


Link to post
Share on other sites
Hi PMCR, Yes, I've used DM and now got it working, I was confusing my translation of ascii to hex i.e. 02 ascii is 30 32 hex and not 32 hex as I was using, Many thanks for your help Dave

Share this post


Link to post
Share on other sites
Dave Thank you for your reply, and confirmation of success. Not enough users of this foum provide feedback to not only the individual who is assisting, but to the many others who read the thread. PMCR

Share this post


Link to post
Share on other sites
I've been toying around with socket services and I'm trying to get away from the omron function blocks as they are a little cumbersome. I have an issue at the moment with a response coming back from an Active open. I either get 0049 (The same port number has been specified more than once) or 2210 (The specified socket has not been connected). I'm developing my aplication to only open the socket when I need to, and send the data every second to update some LED displays (there will be upto three connections/displays). Do I really have to select a different local port number every time? Many thanks Dave

Share this post


Link to post
Share on other sites
No, you do not need to use a different local port every time. I would open the port, and leave it open, then send as you need to. Are you doing UPD or TCP sockets?

Share this post


Link to post
Share on other sites
Temperature_Display.bmp Hello PMCR, I figured that this might be the case. The application i'm developing reads temperature from a pyrometer via RS485 and then displays the infromation of a LED screen. The process is for forging metal and largely the system will be left idle. There three sets of pyrometers and LED displays on the one PLC. I envisaged switching the system on and starting to read via a HMI, opening the TCP port (Active) sending the data every second and then closing the port down after the process is complete. So the duty is very small. I've setup my HMI to effectively system run and open the TCP port, send the data and close. The close and send data appear OK, bu I can't consistently open the TCP port. I get an error that the port has been open before. My display equipment has an LED indicator on it that allows me to see when the port is open or closed. So i'm pretty sure that it's closing properly. Any idea's what I might be doing wrong here? Many thanks, Dave

Share this post


Link to post
Share on other sites
Dave Without being onsite and doing basic troubleshooting, I am not quite sure of where the problem is. Attached is some code that I was working on last night that might be helpful. It is a TCP Active connection to a Modbus device. Basically, this code opens a TCP Active socket to connect to a device, then sends and receives Modbus TCP commands as fast as possible. Looking through the code may help in opening / closing the socket. Socket_Service_TCP.cxp Edited by PMCR

Share this post


Link to post
Share on other sites
PMCR I've had a go with your sample code (very good) and I have the same problem. I see your code is "keep the socket open orientated" which I altered slightly to switch on and off with my program flow. When you close the socket and then try to open it again, I get a problem. It's as if the socket not shutting down entirely. I think I have issues here with the ethernet unit that I have for the demo display I have a the moment. I take delivery of the actual panels tomorrow. I'll talk to them about the problem. Many thanks for the help with the code. It was nice to see how it's done properly. I'll let you know how I get on, Cheers Dave Edited by DaveHarbon

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
Sign in to follow this  
Followers 0