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 (Camera:I.Data[38] thru [45]). I copy them into a string and then want to compare them to a "golden" 13 character string to see if they match and that there aren't any extra characters.
I am having trouble finding out if there are any extra characters. I could use FIND and look for the location of the first null character ($00), delete from there on using DEL, and compare the resulting string (whatever its length) to the "golden" string using EQU, but then if all 16 characters are full (not null) the FIND will return a zero and through things off.
I also was thinking I could copy everything after 13 characters to a "remainder" string using MID and then compare the first 13 characters string to the "golden" string and "remainder" to a string of nulls ($00), but then I guess I would have to make that "null string" is the correct number of null characters. Would I just hard code a 3 character null string? This seemed like the wrong way to do this.
Any suggestions on checking that I have the correct message with nothing extra?
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 (Camera:I.Data[38] thru [45]). I copy them into a string and then want to compare them to a "golden" 13 character string to see if they match and that there aren't any extra characters.
I am having trouble finding out if there are any extra characters. I could use FIND and look for the location of the first null character ($00), delete from there on using DEL, and compare the resulting string (whatever its length) to the "golden" string using EQU, but then if all 16 characters are full (not null) the FIND will return a zero and through things off.
I also was thinking I could copy everything after 13 characters to a "remainder" string using MID and then compare the first 13 characters string to the "golden" string and "remainder" to a string of nulls ($00), but then I guess I would have to make that "null string" is the correct number of null characters. Would I just hard code a 3 character null string? This seemed like the wrong way to do this.
Any suggestions on checking that I have the correct message with nothing extra?