Message string from Compact Logix to Micrologix

Join Date
May 2011
Location
South Carolina
Posts
87
Good afternoon everyone.

I am in need of some guidance. I need to message a string value from a 1769-L30ER to a ML1400. How do you go about doing that since you can't directly message a string data type to ML? I was going to use a STOD conversion and then message it over as a L data type in the ML and then use an AIC instruction in the ML to convert it back to ASCII but that doesn't allow me to use an L data type as the source. Not sure that would do what I needed it to do anyway. Is there an easy way to message this information over to the ML?
 
How long is the data in the String ? Does it always represent an integer value, and how large is that value ?

If it's a String that doesn't always represent an integer number, then you will have to decompose it into an INT[x] array that includes the Length and a transaction sequence number, then re-assemble it out of Integer N-file elements in the MicroLogix.

If it's an integer, then the STOD on the CompactLogix side and AIC (Integer to String) instruction on the MicroLogix side should do the job, but only if it's a 16-bit signed value (-32768 to +32767).
 
Last edited:
The string data size varies between 5 and 20 characters and includes letters and numbers. That is why I am having a problem figuring out how to message the data over to the ML. Honestly, I'm not sure of how to do the transaction sequence number you mentioned or how to reassemble it in the ML.
 
I don't have a MicroLogix handy to examine what happens on the other side.

Here's how the "packaged for sending in an Integer data block to the MicroLogix" tags should look on the CompactLogix side:

String_to_INTx_Data.png
 
I can't be certain the characters come out in the right order on the MicroLogix side, but the principle is to:

1. Detect the change in the TSW so you know new data has arrived
2. Set the Length of the target String data table element
3. Copy the characters out of the N file to the ST.Data file.

String_to_INTx_ML1400.png
 
A thought: I didn't account for the possibility of leftover odd-length characters in the array when the string changes size. Add logic to fill the INT[x] tag in the CompactLogix with zeroes before you copy the string data into it.
 
Ken

Thank you for all of the guidance! I got to work this morning and started working on this again but I am getting an error in Logix 500 when I go to validate the program. See attached screen shot

Invalid Data Type Error.jpg
 
Last edited:
L33er,

What bytes are you talking about swapping?

You would need to swap the bytes within each word of the string data.

As for your program not verifying, I can get it to verify (even with an odd length) in a Micrologix 1400 program I had handy. I am not sure if it would verify for a Micrologix 1100. There are some not so subtle differences in those two seemingly similar models.

Note that the CPW Length (unlike regular copy) is based on 16 bit words, not the data type of the destination.
 
I was digging through some documentation and found the following blurb in reference to the CPW instruction.

"The ST file type is supported in MicroLogix 1400 Series B processors."

Unfortunately, I have a MicroLogix 1400 Series A. Just to test it out, I changed the processor to a Series B and then it validated.

Back to the drawing board I guess.
 
Last edited:

Similar Topics

Hello, I have a question on an OCR application I am doing. I am reading in 16 characters that come from a camera into the plc in its input words...
Replies
4
Views
1,279
Basically, I want a message in Alarm Setup to be string text followed by a DINT. The string text is normal (just like any other text of a...
Replies
9
Views
10,434
Hi, I‘m using a FC to decode a S7 string. Everything is working fine when I enter that string via PLC_SIM, but normally it should come from...
Replies
0
Views
1,932
Hello all. I have a lot of experience with messaging and producing/consuming etc., but I have never messaged a "String" before. Is there...
Replies
10
Views
4,482
In a AOI if you place built in alarm like ALMD or ALMA. How can you pass the message to it when its in alarm. So it will send the message to...
Replies
7
Views
6,509
Back
Top Bottom