7 Replies Latest reply on Aug 12, 2015 8:46 AM by cachilli

    Scanhandler

    arunsrma Rookie

      I have 32 digit barcode like below.

       

       

      9015 4893911944954 0200 0000 980881 1

       

       

      9015 4893911944954 1000 0000 980881 1

       

       

      9015 4893911944954 0010 0000 980881 1

       

       

      9015 4893911944954 0200 0000 980881 1

       

       

       

       

       

       

       

       

      Now I want skip starting 4 character and append auto enter after this.Then next 4 character (but if starting with zero then remove zero) and append auto enter.

       

       

       

       

       

       

       

       

      Like : 4893911944954 <<CR>> 200 <<CR>>

        • 1. Re: Scanhandler
          cachilli SupportEmployee

          Hello,

           

          you can try using this script.. it removes the first 5 characters, spaces are included as a place holder, from there it will count over 13 and keep that data, it will then print that to the screen, submit a CR then a 200 then another CR.. this will only work on a barcode that is 37 characters long ( spaces are counted also..

           

          barcode scanned:

          9015 4893911944954 0200 0000 980881 1

           

          ScreenShot of the script working with 37  length barcode

           

          script working with a barcode length of 36

           

           

          Script( ScanStrip )

          String( sScanData )

          String( sLength )

          String( sDec )

          String( sScan )

          String( sEnd )

          Number( nScan )

          Number( nLength )

          Activate( On_Input, sScanData, nScan )

           

           

              sScan = Get_Scan_Type_Name( nScan )

              nLength = String_Length( sScanData )

              sDec = Number_To_String_Decimal( nLength )

              sLength = String_Combine( "", sDec )

           

              If( String_Equal( sLength, "37", 0, TRUE ) )

                  sEnd = String_Right( sScanData, 32 )

                  sScanData = String_Left( sEnd, 13 )

           

                  Scan_String( sScanData, 0 )

           

                  Keypress_Key( "5250", "Field Exit" )

                  Keypress_String( "200" )

                  Keypress_Key( "5250", "Field Exit" )

           

           

              Else

                  Scan_String( sScanData, 0 )

              End_If

              Return

          • 2. Re: Scanhandler
            arunsrma Rookie

            Hi Cachilli,

             

            Thanks for your reply!!!

             

            This barcode has fixed 32 digit length and no spaces in it. And I want remove zero if 18-20 character contains zero either send all 4 character after 17 character.

            Example like below:

            90154893911944954020000009808811------------ Output Data should like this: 4893911944954<<Auto Enter>>200<<Auto Enter>>

            90154893911944954100000009808811------------Output Data should like this: 4893911944954<<Auto Enter>>1000<<Auto Enter>>

            90154893911944954001000009808811------------Output Data should like this: 4893911944954<<Auto Enter>>10<<Auto Enter>>

            90154893911944954000100009808811------------Output Data should like this: 4893911944954<<Auto Enter>>1<<Auto Enter>>

            • 3. Re: Scanhandler
              cachilli SupportEmployee

              Arunsrma,

               

              I understand now what it is you need to do now, thanks for the clarification.. Unfortunately this type of script will take a bit of time to complete.. You should contact your Wavelink sales rep regarding this.

              • 4. Re: Scanhandler
                cachilli SupportEmployee

                arunsrma,

                 

                I thought I would give this a shot, though very time consuming, I was able to get you a template that you can work from.. The below script will work with the second position, or your fist example noted above..

                90154893911944954020000009808811------------ Output Data should like this: 4893911944954<<Auto Enter>>200<<Auto Enter>>

                 

                No matter the value that second digit is,020000009808811,  the script will fire off.. If that value is 0 then it prints the entire barcode.. So hopefully, with this template you can complete the rest of what you need..Happy scripting!

                 

                Script( PositionalScan )

                String( sScanData )

                String( sScan )

                String( sScan2 )

                String( sCount2 )

                String( sLength )

                String( sDec )

                Number( nLength )

                Number( nScan )

                Number( nCount )

                Activate( On_Input, sScanData, nLength )

                 

                    sScan = Get_Scan_Type_Name( nScan )

                    nLength = String_Length( sScanData )

                    sDec = Number_To_String_Decimal( nLength )

                    sLength = String_Combine( "", sDec )

                 

                 

                    If( String_Equal( sLength, "32", 0, TRUE ) )

                        sCount2 = String_Middle( sScanData, 18, 1 )

                        nCount = String_To_Number_Decimal( sCount2 )

                 

                        If( Number_Greater_Than_Or_Equal( nCount, 1 ) )

                 

                            sScan2 = String_Right( sScanData, 15 )

                 

                            sScan2 = String_Middle( sScan2, 1, 3 )

                            sCount2 = String_Left( sScanData, 17 )

                            sCount2 = String_Right( sCount2, 13 )

                            Scan_String( sCount2, 0 )

                            Delay( 3000 )

                            Keypress_Key( "5250", "Enter/Send" )

                            Delay( 3000 )

                            Scan_String( sScan2, 0 )

                            Delay( 3000 )

                            Keypress_Key( "5250", "Enter/Send" )

                        Else

                            Scan_String( sScanData, 0 )

                        End_If

                    End_If

                    Return

                • 5. Re: Scanhandler
                  cachilli SupportEmployee

                  ok so adding the remaining bit of the script didn't take as long as i though it would. try the below script and see how it works for you

                   

                  Script( PositionalScan )

                  String( sScanData )

                  String( sScan )

                  String( sScan2 )

                  String( sCount2 )

                  String( sLength )

                  String( sDec )

                  Number( nLength )

                  Number( nScan )

                  Number( nCount )

                  Activate( On_Input, sScanData, nLength )

                   

                      sScan = Get_Scan_Type_Name( nScan )

                      nLength = String_Length( sScanData )

                      sDec = Number_To_String_Decimal( nLength )

                      sLength = String_Combine( "", sDec )

                   

                   

                      If( String_Equal( sLength, "32", 0, TRUE ) )

                          sCount2 = String_Middle( sScanData, 18, 1 )

                          nCount = String_To_Number_Decimal( sCount2 )

                   

                          If( Number_Greater_Than_Or_Equal( nCount, 1 ) )

                   

                              sScan2 = String_Right( sScanData, 15 )

                   

                              sScan2 = String_Middle( sScan2, 1, 3 )

                              sCount2 = String_Left( sScanData, 17 )

                              sCount2 = String_Right( sCount2, 13 )

                              Scan_String( sCount2, 0 )

                              Delay( 3000 )

                              Keypress_Key( "5250", "Enter/Send" )

                              Delay( 3000 )

                              Scan_String( sScan2, 0 )

                              Delay( 3000 )

                              Keypress_Key( "5250", "Enter/Send" )

                          Else

                              If( String_Equal( sLength, "32", 0, TRUE ) )

                                  sCount2 = String_Middle( sScanData, 17, 1 )

                                  nCount = String_To_Number_Decimal( sCount2 )

                   

                                  If( Number_Greater_Than_Or_Equal( nCount, 1 ) )

                   

                                      sScan2 = String_Right( sScanData, 15 )

                   

                                      sScan2 = String_Middle( sScan2, 0, 4 )

                                      sCount2 = String_Left( sScanData, 17 )

                                      sCount2 = String_Right( sCount2, 13 )

                                      Scan_String( sCount2, 0 )

                                      Delay( 3000 )

                                      Keypress_Key( "5250", "Enter/Send" )

                                      Delay( 3000 )

                                      Scan_String( sScan2, 0 )

                                      Delay( 3000 )

                                      Keypress_Key( "5250", "Enter/Send" )

                                  Else

                                      If( String_Equal( sLength, "32", 0, TRUE ) )

                                          sCount2 = String_Middle( sScanData, 19, 1 )

                                          nCount = String_To_Number_Decimal( sCount2 )

                   

                                          If( Number_Greater_Than_Or_Equal( nCount, 1 ) )

                   

                                              sScan2 = String_Right( sScanData, 15 )

                   

                                              sScan2 = String_Middle( sScan2, 2, 2 )

                                              sCount2 = String_Left( sScanData, 17 )

                                              sCount2 = String_Right( sCount2, 13 )

                                              Scan_String( sCount2, 0 )

                                              Delay( 3000 )

                                              Keypress_Key( "5250", "Enter/Send" )

                                              Delay( 3000 )

                                              Scan_String( sScan2, 0 )

                                              Delay( 3000 )

                                              Keypress_Key( "5250", "Enter/Send" )

                                          Else

                                              If( String_Equal( sLength, "32", 0, TRUE ) )

                                                  sCount2 = String_Middle( sScanData, 20, 1 )

                                                  nCount = String_To_Number_Decimal( sCount2 )

                   

                                                  If( Number_Greater_Than_Or_Equal( nCount, 1 ) )

                   

                                                      sScan2 = String_Right( sScanData, 15 )

                   

                                                      sScan2 = String_Middle( sScan2, 3, 1 )

                                                      sCount2 = String_Left( sScanData, 17 )

                                                      sCount2 = String_Right( sCount2, 13 )

                                                      Scan_String( sCount2, 0 )

                                                      Delay( 3000 )

                                                      Keypress_Key( "5250", "Enter/Send" )

                                                      Delay( 3000 )

                                                      Scan_String( sScan2, 0 )

                                                      Delay( 3000 )

                                                      Keypress_Key( "5250", "Enter/Send" )

                   

                                                  Else

                                                      Scan_String( sScanData, 0 )

                                                  End_If

                                              End_If

                                          End_If

                                      End_If

                                  End_If

                              End_If

                          End_If

                      End_If

                      Return

                  • 6. Re: Scanhandler
                    arunsrma Rookie

                    Hi,

                     

                    Greetings!!!

                     

                    Thanks for your reply.....

                     

                    This helps me little.

                     

                    But when data are non-zero inbetween 18-21 digit, it giving only 3 character after scanning.

                    For Example: 90154893911944954111100009808811----output data is 4893911944954<<Auto Enter>>111<<Auto Enter>>

                     

                    Please note that all digits of the barcode are variables not constant.

                     

                     

                    Regards,

                    Arun

                    • 7. Re: Scanhandler
                      cachilli SupportEmployee

                      My apologies.. it was the order in which i built the script.. it was first looking 0200 and not 2000 so it ran in the wrong order.. below should resolve that for you..if you look at the below script I moved the first set of if actions down a spot.. it should now look for in this order

                       

                      1000

                      0100

                      0010

                      0001

                       

                      also you can change the delays in the script, these are in milliseconds..Delay( 3000 ) you can change this to what works for you. i made the delays high so i can watch the data parse out on the screen

                       

                      Script( PositionalScan )

                      String( sScanData )

                      String( sScan )

                      String( sScan2 )

                      String( sCount2 )

                      String( sLength )

                      String( sDec )

                      Number( nLength )

                      Number( nScan )

                      Number( nCount )

                      Activate( On_Input, sScanData, nLength )

                       

                          sScan = Get_Scan_Type_Name( nScan )

                          nLength = String_Length( sScanData )

                          sDec = Number_To_String_Decimal( nLength )

                          sLength = String_Combine( "", sDec )

                       

                       

                          If( String_Equal( sLength, "32", 0, TRUE ) )

                              sCount2 = String_Middle( sScanData, 17, 1 )

                              nCount = String_To_Number_Decimal( sCount2 )

                       

                              If( Number_Greater_Than_Or_Equal( nCount, 1 ) )

                       

                                  sScan2 = String_Right( sScanData, 15 )

                       

                                  sScan2 = String_Middle( sScan2, 0, 4 )

                                  sCount2 = String_Left( sScanData, 17 )

                                  sCount2 = String_Right( sCount2, 13 )

                                  Scan_String( sCount2, 0 )

                                  Delay( 3000 )

                                  Keypress_Key( "5250", "Enter/Send" )

                                  Delay( 3000 )

                                  Scan_String( sScan2, 0 )

                                  Delay( 3000 )

                                  Keypress_Key( "5250", "Enter/Send" )

                       

                              Else

                       

                                  If( String_Equal( sLength, "32", 0, TRUE ) )

                                      sCount2 = String_Middle( sScanData, 18, 1 )

                                      nCount = String_To_Number_Decimal( sCount2 )

                       

                                      If( Number_Greater_Than_Or_Equal( nCount, 1 ) )

                       

                                          sScan2 = String_Right( sScanData, 15 )

                       

                                          sScan2 = String_Middle( sScan2, 1, 3 )

                                          sCount2 = String_Left( sScanData, 17 )

                                          sCount2 = String_Right( sCount2, 13 )

                                          Scan_String( sCount2, 0 )

                                          Delay( 3000 )

                                          Keypress_Key( "5250", "Enter/Send" )

                                          Delay( 3000 )

                                          Scan_String( sScan2, 0 )

                                          Delay( 3000 )

                                          Keypress_Key( "5250", "Enter/Send" )

                       

                                      Else

                       

                                          If( String_Equal( sLength, "32", 0, TRUE ) )

                                              sCount2 = String_Middle( sScanData, 19, 1 )

                                              nCount = String_To_Number_Decimal( sCount2 )

                       

                                              If( Number_Greater_Than_Or_Equal( nCount, 1 ) )

                       

                                                  sScan2 = String_Right( sScanData, 15 )

                       

                                                  sScan2 = String_Middle( sScan2, 2, 2 )

                                                  sCount2 = String_Left( sScanData, 17 )

                                                  sCount2 = String_Right( sCount2, 13 )

                                                  Scan_String( sCount2, 0 )

                                                  Delay( 3000 )

                                                  Keypress_Key( "5250", "Enter/Send" )

                                                  Delay( 3000 )

                                                  Scan_String( sScan2, 0 )

                                                  Delay( 3000 )

                                                  Keypress_Key( "5250", "Enter/Send" )

                       

                                              Else

                       

                                                  If( String_Equal( sLength, "32", 0, TRUE ) )

                                                      sCount2 = String_Middle( sScanData, 20, 1 )

                                                      nCount = String_To_Number_Decimal( sCount2 )

                       

                                                      If( Number_Greater_Than_Or_Equal( nCount, 1 ) )

                       

                                                          sScan2 = String_Right( sScanData, 15 )

                       

                                                          sScan2 = String_Middle( sScan2, 3, 1 )

                                                          sCount2 = String_Left( sScanData, 17 )

                                                          sCount2 = String_Right( sCount2, 13 )

                                                          Scan_String( sCount2, 0 )

                                                          Delay( 3000 )

                                                          Keypress_Key( "5250", "Enter/Send" )

                                                          Delay( 3000 )

                                                          Scan_String( sScan2, 0 )

                                                          Delay( 3000 )

                                                          Keypress_Key( "5250", "Enter/Send" )

                       

                                                      Else

                       

                                                          Scan_String( sScanData, 0 )

                                                      End_If

                                                  End_If

                                              End_If

                                          End_If

                                      End_If

                                  End_If

                              End_If

                          End_If

                          Return