bernie_carlton
Lifetime Supporting Member + Moderator
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.
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.