CompactLogix communications

wperriman

Member
Join Date
Nov 2012
Location
Ontario
Posts
25
I have been given a communication problem that is out of my scope, I am hoping that someone will be able to help me with some insight.
I have a conveyor system controlled by a CompactLogix L69-L30ER (5330)v20.12. Currently connected to HMI and VFDs through a Stratix switch.
The customer is adding a Marel Checkweighing Hopper to the system and I need to communicate with it. I have some hardware and messaging questions that I cannot find the answers to. The following is the information I got from the manufacturer on the communication format and message style.
"For communication between systems (Marel M2200 and PLC), we will use port 52212 on the M2200 and the M2200 is always a Server (PLC will therefore have to be Client).
The PLC will thus need to send its messages to the IP address of the M2200 on port 52212 and listen for messages coming from the M2200.
We use standard Ethernet!
There basically would be no "timing" for these messages, they are simply sent upon their respective events (f.ex. your distribution conveyor is started -> you send me <STX>55<HT>11<HT>1<ETX>).
Regarding the gateway, we always provide Marel-made network switches in our cabinets, and there should be one of those in the hopper cabinet. I am guessing a network (RJ45) cable goes from that switch into your system for communication, but is should be noted that our M2200 controllers use a 10Mbit/s half-duplex protocol."
Is there anyone that can tell me if a Prosoft card added to the CompactLogix rack will be the best way to accomplish this?
 
The second half of my problem is the message compostion.
Generating a string value for him is easy but the Message_ID and Field_ID I haven't seen before.
"The M2200 needs to receive a keep-alive message on the port and I think the max interval is 15 seconds, if it doesn't receive this message within these 15 sec, it will close the port. So I propose that you send the following keep-alive message every 10 seconds (just to be on the safe side):
<STX>66<HT>17<HT>"5"<HT>18<HT>"1"<ETX> - NB: the "5" and "1" are sent as strings (I do not need the quotes) and this message HAS to look like this.
When the M2200 receives this message, it will send back the following message:
<STX>5<HT>21<HT>"DEVICE_ID"<HT>22<HT>"DEVICE_TYPE"<HT>23<HT>"DEVICE_PROGRAM"<ETX>
Here, "DEVICE_ID", "DEVICE_TYPE" and "DEVICE_PROGRAM" are string values generated by the controller's firmware.


<STX>MSG_ID<HT>FIELD_1<HT>VAL_1<HT>...FIELD_N<HT>VAL_N<ETX> where MSG_ID is a (header) number, FIELD_X are number identifiers for field IDs and VAL_X are the values corresponding to the respective field IDs

I propose using the same message ID (55) but just with different field IDs and values, so for example every time your gate conveyor starts you would send me the following message:
<STX>55<HT>11<HT>1<ETX>
And whenever that conveyor stops, you could send:
<STX>55<HT>11<HT>0<ETX>
Then, for the infeed conveyor to the hoppers, I would send you the following message (for different speeds):
<STX>55<HT>102<HT>0<ETX> (request for the infeed to stop)
<STX>55<HT>102<HT>1<ETX> (request for infeed coarse/fast speed)
<STX>55<HT>102<HT>2<ETX> (request for infeed fine/slow speed)"

Has anyone seen this type of comms before and have any suggestions how I generate those signals in the logic?
 
I'm no Expert on these, but...

I've found this manual which may be of use?...

User Guide - M2200 P02 & M02 Packing Scale Marel hf.

Communication

The following communication options are available for the M2200 scale:
• CAN. The M2200 is specially designed to operate in a networked
environment (CANopen). When the scale is connected to this type of
network, the network can supply the power.

• RS-232. The M2200 can communicate with external equipment
using RS-232 (serial connections). Weighing results can be printed
on an external label printer or the data can be transmitted to a PC for
storing and further processing.

Ethernet. Application programs in the scale can communicate with
a computer network via Ethernet network.


It appears to use "Lua" programming...

Programming

The M2200-P02 firmware accepts application software written in the Lua programming language.
Lua is a powerful light-weight programming language designed for extending applications.
Lua is also frequently used as a general-purpose, stand-alone language.
Lua combines simple procedural syntax with powerful data description constructs based on associative arrays and extensible semantics.
Lua is dynamically typed, interpreted from byte codes, and has automatic memory management with garbage collection, making it ideal for configuration, scripting, and rapid prototyping.

For more information on Lua see www.lua.org.

Model

The Model is a linear array of the parameters and system values built into the M2200-P02 firmware.
Each value is stored with its own checksum and attributes.
Some values are also stored in backup storage.
Some model values are readable and writable, some are read only.
Some model values are also protected by an audit trail using the CAL and CON event counters.
In some cases the names of model values can be changed, for example to support translation of the front panel interface.
The model can be accessed with dot commands through the command port TCP 52200.
The dot commands use two dimensions: the first is the model ID, the second is “1” for the name of the model entry, “2” for the value of the model entry, and “3” for the mode of the entry.

The Lua application has access to the Model with an API.

TCP Server Ports

The following is a list of TCP ports that can be used to communicate with the P02 firmware or the Lua application.
A small web server is also available on port 80.
The dot commands on port 52200 use the standard Marel dot command syntax and may be used to read or write all Model values.
• 52200 dot commands
• 52202 download Lua source, if allowed
• 52203 upload Lua source
• 52210 Lua standard output, for example using Lua print()
• 52211 message port “comm4” in Lua, persistent output queue
52212 terminal port “comm5” in Lua
• 52213 remote host port “comm6” in Lua

Included in Manual...

Programmer’s Guide – instructions for software programmers on how to create Lua scripts for the M2200

Registered Lua Functions

These functions can be called from the Lua code.
Some are for handling the display while others deal with the scale or the digital inputs and
outputs.
In addition to these functions most of the standard Lua functions are also available.

Communication Port Functions

CommStr(comm-x, string)

CommFlush(comm-x) - Flush input buffers

CommActive(comm-x) - Say if port is active e.g. TCP port has been
opened

PQueueFree() - Get free space on persistent record queue

PQueueUsed() - Get used space on persistent record queue

Acceptable values for comm-x:

1 - RS232-0
2 - RS232-1
3 - RS232-2
4 - Message port TCP 52211
5 - Terminal port TCP 52212
6 - Remote host port TCP 52213

Digital Input Functions

DICfgMode(n, mode) Mode: “low”, “high”, “direct”, “invert”, “count falling”, “count rising”, “count both”, “toggle on fall”, “toggle on rise”

DIGet(n) get status of input

DICrl(n) clear edge counter

Digital Output Functions

DOCfgMode(n, mode, inv) Mode: “low”, “high”, “direct”

DOSet(n, state) Set output

DOGet(n) Get status of output

...and so on.

No examples of syntax to use for interfacing, although they are just using simple ASCII Code <STX> Start-of-Text, <ETX> End-of-Text, <HT> Horizontal Tab, etc.

Seeing as your controller's Ethernet port is already in use, I'd imagine you could stick in a ProSoft Generic ASCII Ethernet Interface Module (MVI69-GEC), which is a 1769 module, and communicate ASCII from the L30ER over the backplane and out to the checkweigher? Interfacing with weighers is one of the top application uses for the MVI69-GEC...

Generic ASCII Ethernet Interface Module - MVI69-GEC

There is also an AOP and Sample Ladder Logic under the Downloads tab.

The timing (or lack of?) of the data exchange/handshaking might be the tricky part here? You might have to figure that out more on the controller side, but should be doable.

That's just a quick assessment of the information that you/they have provided.

Regards,
George
 
Last edited:

Similar Topics

Hi there, I have 3x SLC 5/04 processors communicating with each other over DH+. Some external equipment is being replaced and a new packaged...
Replies
4
Views
2,250
I made an application using FTView 8.1 and library PlantPax 3.5. PLC is a CompactLogix, and we have some I/O modules in the rack. Communication...
Replies
2
Views
1,779
OS: Windows 7 Logix5000: 19.01 I have a CompactLogix L32E controller with associated I/O at work that I use to test various programming...
Replies
10
Views
3,985
Hi there, I need to exchange about 100 Words of data In/Out from my CompactLogix L33ER and an S7-1500. We are connected physically via a Siemens...
Replies
5
Views
3,624
Is it possible to have a MicroLogix 1400 read information from a CompactLogix address? I've done it the other way many times. Reading the data...
Replies
6
Views
3,388
Back
Top Bottom