Can anyone help me get around this? Thanks.
Works, same type and value?
when you do the tag read, are you sure its “134” and not "134 " (with a space)?
Yeah, it might be interesting to print the
len(raw) you get in the version that fails.
Is it always going to have a x02 prefix and x03 suffix?
Yes, its STX and ETX in the message.
raw = system.tag.read("[EtikettTag]SICK/2112/Message").value
raw = raw.strip()
raw = raw[1:]
raw = raw[:-1]
If this is true you can use
Else you probably will want to use a regex pattern
import re raw = re.sub("[^0-9]",'',raw)
raw[1:-1] would work too.