Ascii Group Separator in Barcode

This question is somewhat related to the following topic:

I am trying to create a data matrix barcode component of a special format. It must contain Seperators and End of Line characters. Specifically I need Chr(4), Chr(29), and Chr(30) to be inside my expression.

How can I accomplish this?

Apparently this is no problem for a data matrix, you can easily set it in code:

F.e. the code below will add a text with with the code points you asked to a barcode component (which can be configured as datamatrix.

Do note that printing these will give mixed results (f.e. check the difference between printing the string directly, or the representation of the string). So scanning it will also give mixed results.

s = "test codes: \004 \029 \030 "

print s
print repr(s)

event.source.parent.getComponent('Barcode').code = s

Hmmm. That’s a platform bug, between client and gateway I think. Have you considered upgrading to 7.5.13 ?

I am using Ignition 7.9.9 in this case.

When I add the special characters to my barcode and Print it out I can’t figure out how to test to see if the characters will be read in. Because notepad text input would not show the seperators. Is there any software out there I can download that will read a data matrix in character by character so I can verify it works?

If I try the above code, the output is

test codes: 9
'test codes: \x04 \x029 \x18 ’

Why does 30 turn into 18?

You are providing the escape codes in octal, and repr() is delivering them in hexadecimal (\x). However, \029 isn’t valid octal, so it is interpreted as octal \02 and a separate character ‘9’. I suggest you uniformly use hexadecimal so there is no confusion.