Please follow-up with whether you were using the ARL or ARD serial port instructions on an older CompactLogix with a built-in Channel 0 serial port, or if you were using the 1769-ASCII module, which has delimiter configurations in its port setup.
I think you were almost there in a previous post where you had <CR> (the default) as the terminator, but you needed <LF> as the terminator because both characters came at the end of every line.
For fun, you can experiment with the FIND instruction, which will locate a string inside another string. Make a search string that is just a comma, then see what position it tells you the comma is in.
When I use FIND and MID, I usually have to test to be sure I get the offsets versus the indexes correct.
The first character of a string is TagName.Data[0], but it is considered "position" 1.
Ken, As I can see strings are easy for you.
How one can extract several different numbers to array of int with find_int and MID_int?
If we have original string like this +00123.+00345.+00457.+00563 ... +00743
We want extract all number at once to integer.
so array should be like this
123
345
457
563
...
...
743
Find_int (.) finds first character, but for looking other "." Find_int should run several times. But for finding next ones, first finded should be deleted or replaced with different characters or first one is finded allways.
I think that left_int and right int is needed and several diffrent loops or PLC cycles, but I can't get it easily to work.
Last edited: