CompactLogix Message to Server

tclark500

Member
Join Date
Oct 2012
Location
Kentucky
Posts
11
I'm using a 1769-L33ER v20. I need to send a message to a data server with package information (barcode, weight, etc)

I've got the MSG set up with the server IP and port number but keep getting an error code:
16#001 extended error code 16#0000_0204

Can someone tell me what I'm doing wrong?

Message.PNG
 
Last edited:
Welcome to the PLCTalk forum community !

What sort of software is running on the server ?

MSG instructions are only for sending Tag read/write or other Rockwell Control and Information Protocol (CIP) service and object commands to other ControlLogix-family controllers.

To send a general purpose string or set of bytes to an arbitrary TCP port, you need to implement the "raw sockets" function. The 1769-L33ER controller does support those, and the programming manual is online:

https://literature.rockwellautomation.com/idc/groups/literature/documents/at/enet-at002_-en-p.pdf
 
Welcome to the PLCTalk forum community !

What sort of software is running on the server ?

MSG instructions are only for sending Tag read/write or other Rockwell Control and Information Protocol (CIP) service and object commands to other ControlLogix-family controllers.

To send a general purpose string or set of bytes to an arbitrary TCP port, you need to implement the "raw sockets" function. The 1769-L33ER controller does support those, and the programming manual is online:

https://literature.rockwellautomation.com/idc/groups/literature/documents/at/enet-at002_-en-p.pdf

Thanks Ken.

The server is running NodeJS. Never heard of that.

I have seen messages to a server like that at a previous job I had.

I'll try programming the raw sockets function. You would think Rockwell support would have told me that when I called them. He just kept saying something was wrong with my path.
 
Strictly speaking there *is* something wrong with your path, because you've added a TCP port number to the IP address. CIP Paths just don't have that; the Port is always 44818.

You might have previously seen MSG instructions aimed at instances of "Unsolicited Topics" in RSLinx Classic. In the PLC-5E you would see the destination IP address just entered as "CLIENT".

Is your Node.js implementation running in conjunction with Node-Red, or by itself ?

There are a handful of libraries that can poll the ControlLogix tagnames, but I'm unaware of any that attempt to implement an emulation of a Logix tag that you can read or write externally.
 
I'm not sure if the Node.js is running by itself, our Dev team is working from home and not real easy to get a hold of right now.

I'm working on the raw socket connections. I've got the SocketCreate and OpenConnection working but the AcceptConnection keeps timing out. Thanks for your response.

I also ordered an external gateway from rtautomation in case I can't get this working I'm going to try it with that.
 
Based on what you described, you need to use Create-Open-Read/Write.
Accept and Open are two opposite functions - you should use one or another but never both.
I would recommend to get Sockets AOI from the knowledge base - it will save you time.
 
Yep, the AOI works great as a client or server.

Node red has node-red-contrib-pccc that does SLC style tag access. You can map an array to a SLC style memory block in logix5000.
 
Last edited:
I got the AOI and got it setup. The socket is enabled and listening but will not open and I am not getting any errors

From what I can see it is waiting on a response from the server. I'm trying to reach our Dev team to see if they can send a response/ack but they're not responding right now.

Am I right in assuming this?
 
You are using wrong AOI, server will not talk to server.
If you want PLC to talk to a server you need to use Client AOI.
It's always Client-Server pair.
 
Background info


Almost all network applications use the client-server paradigm: to initiate a dialog, a client "connects" to a server that is "listening."


A quick trip to The Google yielded the flow diagram image* below, from this link, that shows the different paths that the client and server take.


For PLCs and ladder logic, the individual blocks in this flow diagram are all under the hood of the instructions used, but the main point I am trying to make is that, although there is some overlap (calls to socket(), write(), read(), and close() routines) a client and a server take different, independent, asynchronous paths, especially at the beginning for setup: socket()/bind()/listen()/accept() for the server; socket()/connect() for the client.


yyy.png


* I knew The Google would find essentially that exact flow diagram, but only because I have been there i.e. writing a client/server application from scratch in C; it is ironic that someone who needs, but does not know, this information will probably not have an obvious way to bootstrap their way to this understanding. I guess that is why there are fora.
 
Well I have an open connection but when I try to write the data I get the 16#0015 Configuration data size too large error

I have tried multiple things to correct this. The AOI already adds 16 to the buffer length before it enables the write msg.

My buffer length can be 20-22 depending on sequence ID and the weight of the package.

I cannot figure out how to make this thing happy.
 
Post your ACD file: execute AOI then upload in faulted state.
I think you are populating data into a wrong string.
 
Post your ACD file: execute AOI then upload in faulted state.
I think you are populating data into a wrong string.

I'm having issues attaching the file so here is a snip of the error and of the rung that copies my string. The DATA_OUT string is a STR_480 data type, same as what the message is using. I tried using the DATA_OUT string as the source element in the message but it would give a Configuration size too short error.

Write Error.PNG



Write Rung.PNG
 

Similar Topics

Hello, I'm wanting to read Modbus registers from a Centurion controller back into the 1769-L32E CompactLogix Controller using the "Message" Data...
Replies
12
Views
3,821
I have a compactlogix 1769-L32E, PV600+ and 3 Lenze drives (each drive fitted with a Ethernet IP module) Both the compactlogix PLC and the...
Replies
2
Views
2,025
Hi All, I have a quick programming question I thought you guys might be able to help with. I have a compactlogix controller with 4 powerflex 40p...
Replies
3
Views
2,881
Can Send or recive anything other then intergers when communicating between a micrologix and compactlogix over an ethernet connection
Replies
25
Views
19,303
Hi, we've worked to figure out the CIP protocol for a few days. We intended to write a 2 way communication program using socket between Linux and...
Replies
23
Views
13,598
Back
Top Bottom