Siemens S7 - Cyrillic text in a DB

J

Thread Starter

JarnoQ

I want to print Russian (Cyrillic) text with Siemens S7 and a CP340 to a Zebra printer. The text is fixed, and has to be written into a DB (ARRAY with type CHAR).

Now it is not possible to just copy a Cyrillic character, from for example Word, into a DB position on it's actual value.

I catch the string which is send to the printer, and noticed that 1 Cyrillic character consists out of 2 bytes! So now i understand that I just can't copy it into a CHAR position in the DB.

ц results into ц, and this is D1 86

I think I just have to convert every Cyrillic character into 2 bytes and then write them from the PLC-code into the DB.

Does somebody have a better idea?
 
M

Michael Griffin

I don't know which Zebra printer model you are using, but Zebra mentions that some models at least are "Unicode compliant". The size of a Unicode character is 2 bytes. Unicode is the modern standard for characters, and has replaced older single byte encoding schemes (such as ASCII) in many applications (we are still in the transition period at this time). If the Siemens S7 can't work with Unicode, that is a problem with the S7, not a problem with Zebra.

You could go through the printer manual for the particular model you are using (whatever that is) to see if there is a way to select a different single byte character encoding set. That might be supported on some models as a means for compatibility with older applications. I've used Zebra printers, but only with ASCII characters so I haven't had to do this myself.
 
Top