Receiving Strings CompactLogix

bernie_carlton

Lifetime Supporting Member + Moderator
Join Date
Apr 2002
Location
Yakima, Washington
Posts
6,412
System - AB CompactLogix with external Ethernet - Serial gateway (RTA) connected to the Ethernet port. The gateway receives a string on its serial port then, when a designated CompactLogix tag is empty (LEN = 0) it writes the received string to the internal tag. it then waits for another string to arrive on the serial port. (It also transmits serial in a similar way but that's just fine.)

In the CompactLogix program, when a string arrives (triggered by String.LEN > 0) I copy it to another then zero out the LEN of the receiving string tag as recommendedd by the gateway manufacturer. This works generally.

Occasionally after a longer string is received, using the method described above, when receiving a shorter string I get a combination of part of the new short string followed by the remaining part of the previous longer string.

Example:

Longer string - "12345678"
Expected following shorter string - "ABCD"
Actual received string - "ABCD5678"

I found that, if I delay slightly (50 milliseconds) after registering that the LEN is back to a non-zero state before doing the copying and zeroing, that I get the correct expected string.

Any comments? It sounds like some weird combination of timing events. A Logix gotach? Maybe I'll just have to live with the 50 ms, which isn't that bad anyway.
 
I have found the exact same thing when working with strings in my visual basic project. I would wrote a longer string than later write a shorter string. Then when I would write the string from the processor to a panelview, it would show a combination of the strings. What I did to fix this was always write a string length of 25 (my maximum string length) and fill from the shorter string to its end with null characters.

For example: "123\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"

Then the logix processor would then correct the string length to the appropiate size in this case 3.
 
I saw that with panelviews. They read the number of characters defined in their internal tag, completely ignoring the LEN data at the start of the string in the PLC.

This is kind of a different one. It would be as if, during the write of the string from the VB project, you could see some strange combination just looking at the PLC.
 
If you are using VB, you could do it like this.

Dim MyString
MyString = "123"
j1 = Mid(MyString, i + 1, 1)
For j1 = i To 25
MyString = MyString & "\0"
Next

WritetoProcessor (MyString, 25)
 

Similar Topics

Dear Gentlemen/Ladies, I have a bit of a nut cracker here. I am using a Koyo DL06 and a D0-DCM (slot 4). I have some issues with the DCM module...
Replies
10
Views
4,788
Hello, We are using a CIP(Clean in Place) system with a powerflex 525 to run its pump. We are able to see the VFD through ethernet, its Enet...
Replies
15
Views
805
I have pi osisoft DNP3 icu communicating with a SEL RTAC. I am receiving multiple messages from the rtac on each register. With analog tags...
Replies
0
Views
679
We have an old modicon bit of kit that receives 48 registers (24 reals) from a PC system via modbus TCP. We're looking to upgrade the PLC to...
Replies
3
Views
1,943
Hi, can my mitsubishi FX 3 receive wireless I/O signal without PC? By the way, I am using WISE 4210 by advantech, a proprietary LPWAN (Sub-G)...
Replies
3
Views
1,367
Back
Top Bottom