Help - Search - Members - Calendar
Full Version: ControlLogix Ethernet Comms
Forums.MrPLC.com > PLCs and Supporting Devices > Allen Bradley
patb63
I've tried searching until I'm blue in the face and can't seem to find exactly what I need. I want to send ASCII data to and from an L5562 processor to my PC via Ethernet. My questions are:

1) Can this be done with a MSG instruction through an ENBT module? If so, how do I set it up?

2) What will I need in a vB program on my PC to capture this data besides an IP address to look for?

I am awaiting arrival of an EWEB module, which I know will allow me to do this via a sockets interface. I'm just trying to find another alternative for this.

Thanks for any and all info.
Contr_Conn
QUOTE
1) Can this be done with a MSG instruction through an ENBT module? If so, how do I set it up?

No, ENBT can't do it, wait for your EWEB to arrive

QUOTE
2) What will I need in a vB program on my PC to capture this data besides an IP address to look for?
port number

Take a look at TN32962, it has simple VB application for windows
patb63
QUOTE(Contr_Conn @ Sep 20 2007, 03:49 PM) [snapback]59438[/snapback]
QUOTE
1) Can this be done with a MSG instruction through an ENBT module? If so, how do I set it up?

No, ENBT can't do it, wait for your EWEB to arrive

QUOTE
2) What will I need in a vB program on my PC to capture this data besides an IP address to look for?
port number

Take a look at TN32962, it has simple VB application for windows


Thanks for the info.

BTW, my EWEB module is here. I have been semi-successful in getting communications going via sockets to/from the controller. I've examined the EWEB module instruction manual and when my head quits hurting, I'm hoping to have a better understanding of this module.

Any idea where there might be some sample code out there to try and refine my logic?
Contr_Conn
QUOTE(patb63 @ Sep 27 2007, 01:31 PM) [snapback]59713[/snapback]
Any idea where there might be some sample code out there to try and refine my logic?

Did you check TN32962?
Another good one is 33672 once you done learning with 32962
Leadcommander
You can get tag data from ControlLogix using some java code called CELL
Check out http://mywebpages.comcast.net/ncherry/

I have used this to get barcodes read out of an array for a business management software.
I then wrote in how many tags I had read and the PLC code shuffled remaining Barcodes up the array.

I have also used the EWEB module on a different job for TCP connections to a Servo controller if you need a hand with that.

Cheers yes.gif
rookieplcguy
Hello Gents,

I apologize for the late intrusion (and lack of ability to help with the contribution to the thread)...

From my understanding of the thread there is no way to communicate/send a string to a ENBT (1756-ENBT to be exact).

I am using 1756-ENBT modules, a 1756-L62S LogixPLC and of course RSLogix5000.

I'm just getting into the field (fresh meat from school) and my project requires a Vision PC to communicate to the PLC via ethernet (strings preferably). If I can't do strings is it possible just to send values for the tags (ex VARIABLE_1=1 or 0)?

The vision PC is running Sherlock I believe (I will confirm later). We are scanning parts that are zooming by on a press line to check against an ideal part image. I will be recieving this data, storing it in the PLC and then sending an output to a PV1500+.

Any help would be appreciated...

Thanks
Joe

(sorry for hi-jacking the thread)
TWControls
Hi Joe and welcome to the forum

It is quite possible that you can communicate directly from your vision pc to your ENBT. What you need to find out is how your vision pc communicates. It may already have some type of OPC drivers to communicate with the PLC. If it has these drivers then a STRING data type will not be a problem.

Pretty much the ENBT can communicate over ports 44818 which is preferable or 2222 which is an older protocol. Any other port and you would need an EWEB.

So confirm the software your Vision PC is running and see if the manual says anything about communications drivers for PLCs.

TW
Contr_Conn
QUOTE
ENBT can communicate over ports 44818 which is preferable or 2222 which is an older protocol
Not exactly:
ENBT supports Unscheduled CIP protocol comms on TCP Port 44818,
It also supports UDP scheduled communications (I/O) on UDP port 2222
It does not support older CSP protocol (TCP port 2222)

Your device must be able not just connect to these port but also "Speak" CIP protocol that is a core of logix systems
TWControls
QUOTE(Contr_Conn @ Oct 18 2007, 06:23 PM) [snapback]60625[/snapback]
QUOTE
ENBT can communicate over ports 44818 which is preferable or 2222 which is an older protocol
Not exactly:
ENBT supports Unscheduled CIP protocol comms on TCP Port 44818,
It also supports UDP scheduled communications (I/O) on UDP port 2222
It does not support older CSP protocol (TCP port 2222)

Your device must be able not just connect to these port but also "Speak" CIP protocol that is a core of logix systems

Thanks for correcting me on the Contr_Conn
rookieplcguy
Hey guys thanks for the help here :D
Definately makes a noob feel welcome (at the job & at the forum)


We are using Sherlock version 7 I belive.
I was speaking with our vision guy and he said that there is an option for a ControlLogix string output. I think/hope this means we're in buisness :)
Contr_Conn
QUOTE(rookieplcguy @ Oct 18 2007, 10:06 PM) [snapback]60633[/snapback]
I was speaking with our vision guy and he said that there is an option for a ControlLogix string output. I think/hope this means we're in buisness :)

Tell the vision guy that you need more information than just a "string":
1. Will vision support CIP? If he does not know what CIP is, then see item 3.
2. If he supports CIP, then you can do it from Logix/ENBT
3. If Not then Vision guy needs provide a detailed protocol description that you will have to implement using EWEB's Open Socket interface and Logix programming. Based on you level of expertize it will not be task for you.

Also, are you sure they need a string over Ethernet and not over serial port?
patb63
[attachmentid=5538]Okay, I've gotten this far and I'm getting to the point of pulling the hair out of my bald head.

The attached program takes string data from a serial port on a ProSoft module and sends it over a socket to a PC using an EWEB module. The PC sends a message back giving an assignment for the barcode. Once the barcode is processed, the PLC sends a confirm message back to the PC over the socket. The PC then acknowledges that message. Also, every ten seconds, a status message is sent to the PC. The PC acknowledges the status message the same way as the confirm message.

Here's the rub:
1) the status message sends okay; the acknowledgement from the PC comes back okay
2) when a barcode is sent, the PC sends the assignment, the confirm is sent back and the acknowledgement is received......then the MSG instruction for reading the socket errors out with an error code of 00ff (hex) and an extended error code of 36 (hex).....the closest explanation for these codes is ECONNRESET - "connection reset by peer" - whatever that means
3) at one time this code worked..then something changed and it quit working

Again, I'm asking for any assistance anyone can lend.

Thanks.
Contr_Conn
This error means that the PC closed connection.
To determine why PC does it you need to enable EWEB logging to see what is going on and/or use Ethereal to see packets going from and to EWEB


patb63
You're so right!!!

Called A-B Tech Support and they told me the same thing. I had the guy writing the PC vB part of this system check and he found an error in his code!!!!

Which means.........MY PART WORKS!!!!!! nana.gif nana.gif nana.gif nana.gif

So, my post above can be seen as a preliminary method of having socket communication from a ControLogix to a PC. I'll be improving this code and can repost it in the downloads area when I'm done if anyone's interested.
Contr_Conn
QUOTE
You're so right!!! Called A-B Tech Support and they told me the same thing.

Because techsupport guy you talked to knows EWEB dancered.gif
Contr_Conn
I briefly looked at your program - looks like you are using code from tutorial technoote.
This is OK to start but not enough for "production" code.
I don't see (may be I missed it) any checks for errors after every MSGexecuted.
This needs to be done to prevent next MSG from coming out if connection lost or closed.

Take a look at other socket technotes, they will give you ideas on how to check connection state and execute re-connect if necessary.

Most of error codes like the one you mentioned above are self-descriptive and can be easily handled in your program.

Also be careful with DELETE-ALL commnd - it will remove all sockets form EWEB even they created by another controller.

patb63
Thanks Contr_Conn for the advice. This program was really just to prove that we could use the EWEB module for our communication. I now have to go back and make the code "packageable" for our other engineers to use for their projects. I will investigate more fully the MSG error checking. As far as the Delete All Sockets, this will be the only controller communicationg with the server.



You were right about the AB tech support guy knowing the EWEB module. I was very pleased that I got such a quick response from AB. I was also glad that I picked all the right choices going through the menu options at tech support (I usually wind up in the wrong department).



I'll try to download the NEW and IMPROVED version of this code when I get it done.



Again, thanks to all for the help and guidance.



thumbsupsmileyanim.gif

This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.