7 Replies Latest reply on Oct 3, 2017 8:56 AM by Steven Si

    How to add RS, GS, EOT to QRcode

    善军 包

      ! 0 200 200 240 1

      PW 480

      TONE 50

      SPEED 2

      SETFF 0 5

      ON-FEED FEED

      NO-PACE

      GAP-SENSE

      B QR 330 30 M 2 U 2

      HA,RS GS 109100857 GS 10287360 GS R1707061 GS 170706 GS 180705 GS 10120501 GS 20 GS GS GS EOT

      ENDQR

      PRINT

       

      I can't do this in this way.

      HM,B001E,AQRcode,B001D0123456789012345,A,B0004

       

      With ZPL, I know it's done, but CPCL doesn't know how to achieve this effect.

       

       

      Data: qrcode

      The {data} field presentation:

      LM,AQRcode,N0123456789012345,AQRCODE,B0006qrcode

       

      The above example:The special character is a space, in the example, B 0006

      The ASCII of the space is 32, and the BCD is: 00110010, how do you get 0006?

       

        • Re: How to add RS, GS, EOT to QRcode
          善军 包

          Please reply as soon as possible, three days before the post, I do not know whether the reason is not Chinese, no reply, now paste it as English, please reply

          • Re: How to add RS, GS, EOT to QRcode
            Steven Si

            For sure, we can use CPCL to encode these printable special characters listed on the ASCII table. To do so, the Data Input Mode has to be in manual mode. Then the special character (the printable special characters, such as ~ _@^()[]{}, including white space) can be encoded with B. For example, the following CPCL encode the "123456789123456789AABCDEFGHIJKLM ~ _@^()[]{}abcdefg" string in QR code

             

            ! 0 200 200 240 1
            PW 480
            TONE 50
            SPEED 2
            SETFF 0 5
            ON-FEED FEED
            NO-PACE
            GAP-SENSE
            B QR 330 30 M 2 U 5
            LM,N123456789123456789,AABCDEFGHIJKLM,B0019 ~ _@^()[]{}abcdefg
            ENDQR
            PRINT
            

             

            If we want to encode "B 0006" in QR code as you've asked, we can use the following CPCL. Please pay attention to "B0001 ," (with a space in between).

            ! 0 200 200 240 1
            PW 480
            TONE 50
            SPEED 2
            SETFF 0 5
            ON-FEED FEED
            NO-PACE
            GAP-SENSE
            B QR 330 30 M 2 U 5
            LM,AB,B0001 ,N0006
            ENDQR
            PRINT
            

             

            Hope this helps.

              • Re: How to add RS, GS, EOT to QRcode
                善军 包

                Hi,   I want to know how the string in ascii, the RS, the GS, the EOT, the EOT。

                This is a of character.

                 

                      bin                   oct             Dec            Hex                 String      

                0001 1101

                35

                29

                1D

                GS (group separator)

                 

                0001 1110

                36

                30

                1E

                RS (record separator)

                 

                0000 0100

                4

                4

                04

                EOT (end of transmission)

                 

                  Dim RS,GS,EOT As String

                  RS="B0019," & Chr(30)

                  GS="," & Chr(29)

                  EOT="," &Chr(4)

                  Dim data As String=EditTextS.Text

                  Dim data_str As String=RS & GS &"  109100857" & GS & " 10287360 " & GS & "R1707061  170706 1" & GS & "80705 10120501 20   " & GS & GS & EOT

                 

                In this way, the above of the above QR code can not be reached.

              • Re: How to add RS, GS, EOT to QRcode
                善军 包

                HI Steven Si:

                    Based on your help, I wrote this.

                "ABCDEF,B0001" & Chr(29) & ",AHIJKLMN" & "B0001" & Chr(29) & "AOPQRSTUVWXYZ"

                 

                Generated code, sweep out is:ABCDEF HIJKLMNB0002AOPQRSTUVWXYZBOMQ

                 

                Why would it? "B0002"?   and The second Chr(29) Turn into string?  data There are four more letters at the end “BOMQ”????

                 

                 

                I want suburban fruit :ABCDEF HIJKLMN OPQRSTUVWXYZ

                 

                  • Re: How to add RS, GS, EOT to QRcode
                    Steven Si

                    We are still trying to find out how to encode non-printable (or control) ASCII characters in CPCL.

                     

                    One thing to remember is that we need to have a comma (,) immediately before A, B and N when changing the encoding (Binary, Automatic and Numerical encoding)  from one to another in QR code. For example, if we want to encode the string of "ABC & 123 & DEF & 456" (with white space as separator), we can use the following code. As we can see, we have the encoding transitions from A to B to N to B to A to B to N. There is a comma (,) at each transition.

                     

                    ! 0 200 200 240 1
                    PW 480
                    TONE 50
                    SPEED 2
                    SETFF 0 5
                    ON-FEED FEED
                    NO-PACE
                    GAP-SENSE
                    B QR 330 30 M 2 U 5
                    LM,AABC,B0003 & ,N123,B0003 & ,ADEF,B0003 & ,N456
                    ENDQR
                    PRINT
                    
                    • Re: How to add RS, GS, EOT to QRcode
                      Steven Si

                      The control characters (non-printable characters) in the ASCII table is encoded in the same as those printable characters. Since the control characters are non-printable, we will have to use the text-editor that we can type in the control characters to compose the CPCL, such as the Notepad++, by holding down the ALT key with pressing the 3 digit of the ASCII number. We type in <RS> (Record Separator), for example, by holding down ALT key and typing 030 (ALT + 029) in Notepad++. We can do this either in Binary encoding or in Automatic encoding. Attached image shows how to encode the control character in QR code in two ways in CPCL. The first way is the Binary encoding, while the 2nd is the Automatic. The highlighted are the non-printable control characters.

                      ControlCharacterQREncoding.JPG

                      Both encoding generate the same QR code as shown below.

                      ControlCharacterQRCode.JPG

                      Hope this helps.