Bar Codes -- WinBar

WindowBar V4 software can be called from GUI applications to print bar code labels. The following description applies to Windows clients and should be used with the WindowBar manual to configure the bar code software.

Installation :

Label Design: Labels are formatted in the WindowBar designer program and files for each design are stored in c:\Winbar4x\Labels\directory. Walter Reed currently uses three labels which are discribed below. The code for these files are included at the end of this document.
  1. bn1make.lab: This label is used on new samples being registered into the CIS and is generated by pushing the [BarCode] action button on the Accession Sample Application.
  2. wrbship2.lab: This label is used on bottles for shipments to Test Systems and is generated by pushing the [BarCode] action button on the Ship Samples Application.
  3. address?.lab: This label is used to print address labels for packages and is generated by pushing the [Label] action on the Address Application.
Batch files are used to select the label program and pass it parameters (See WindowBar User's Manual Version 4.1, pp. 1-4, 5-11/12). Batch files are created in the GUI application triggers associated with the [Bar Code] or [Label] Action Buttons. After creating the batch files, they are written to c:\winbar4X\batch\. Currently the CIS writes three batch files:
  1. The [Bar Code] Button in the Accession Sample Application executes the following trigger to write a batch file called new_bn.bat. When run, this batch file calls the bn1make.lab program and passes it a Bottle Number as a parameter.
    {
    list barcode;
    
    if (!to_int(g.bar_code))        /* g.bar_code is environ var set in wrcis.ini */
      error("Bar Code program is not installed on this computer.");
    else if (!p.bn_d)               /* BN must be displayed to print a bar code   */
      error("Enter BN field before printing bar code");
    else{
      barcode= list_open("80",9,"Ship BarCode list");
      list_mod(barcode,1,"[LABEL]");
      list_mod(barcode,1,"Label=C:\WINBAR3X\LABELS\BN1MAKE.LAB");
      list_mod(barcode,1,"Port=COM3:");
      list_mod(barcode,1,"Quantity=1");
      list_mod(barcode,1,"P-BN="^^p.bn_d);
      list_mod(barcode,1,"P-NAME=WindowBar AutoPrint");
      list_file(barcode,"gui!c:\winbar4X\batch\new_bn.bat","a");
      status("Created file c:\winbar4X\batch\new_bn.bat");
      }
    }
  2. The [Bar Code] Button in the Ship Sample Application executes the following trigger to write a batch file called ship_bn.bat. When run, this batch file calls the wrbship2.lab program and passes it three parameters, Bottle Number, Test System, and Milligrams.
    {
    list barcode;
    
    if (!to_int(g.bar_code))        /* g.bar_code is environ var set in wrcis.ini */
      error("Bar Code program is not installed on this computer.");
    else if (!p.bn_d)               /* BN must be displayed to print a bar code   */
      error("Enter BN field before printing bar code");
    else{
      barcode= list_open("80",9,"Ship BarCode list");
      list_mod(barcode,1,"[LABEL]");
      list_mod(barcode,1,"Label=C:\WINBAR3X\LABELS\WRBSHIP2.LAB");
      list_mod(barcode,1,"Port=COM3:");
      list_mod(barcode,1,"Quantity=1");
      list_mod(barcode,1,"P-BN="^^p.bn_d);
      list_mod(barcode,1,"P-TS="^^p.test_d);
      list_mod(barcode,1,"P-MG="^^p.ship_qty_d^^" M");
      list_mod(barcode,1,"P-NAME=WindowBar AutoPrint");
      list_file(barcode,"c:\winbar4X\batch\ship_bn.bat","a");
      status("Created file c:\winbar4X\batch\new_bn.bat");
      }
    }
    
  3. The [Label] Button on the Address Application executes the following trigger to write a batch file called ?????.bat. When run, this batch file calls the ?????.lab program and passes it the Name, Institute, Address1, Address2, and Address3.
    int i,x;
    list barcode;
    
    if (!G.bar_code){
      status("Bar code system not installed on this computer.");
      break;
      }
    
    if (!to_int(g.bar_code)) /* g.barcode is environ var set in wrcis.ini, parm.0 */
      error("Bar Code software not installed.");
    if (p.wl == NULL)
      error("Select an address before printing bar code");
    if (G.bar_code == 1){
      barcode= list_open("80",9,"Ship BarCode list");
      list_mod(barcode,1,"[LABEL]");
      list_mod(barcode,1,"Label=C:\WINBAR3X\LABELS\WRADD2.LAB");
      list_mod(barcode,1,"Port=COM3:");
      list_mod(barcode,1,"Quantity=1");
      list_mod(barcode,1,"P-institu="^^p.institute_d);
      list_mod(barcode,1,"P-add1="^^p.address1_d);
      list_mod(barcode,1,"P-add2="^^p.address2_d);
      list_mod(barcode,1,"P-add3="^^p.address3_d);
      list_mod(barcode,1,"P-name="^^p.name_d);
    
      list_file(barcode,"gui!c:\winbar4X\batch\ship_bn.bat","a");  ?????
      status("Created file c:\winbar4X\batch\ship_bn.bat");    ?????
      }
    
AutoPrint is a WindowBar utility that runs as a background process and controls label printing (WindowBar User's Manual Version 4.1, Chapter 5). Start Autoprint by pressing the WBatch.exe icon and open Setup from the Menu Bar. Use the manual as a guide to configure Program Setup, Batch Setup and Port Setup. Batch Setup is used to enter the names of the batch files to be read, the interval to look for new batch files, and the path to the log directory.

Running WindowBar V4.1:

  • How It Works: The action trigger associated with the [Bar Code] button in the GUI Application reads the parameters from the GUI display (i.e. bottle number etc) and writes a batch file called c:\winbar4x\batch\*.bat.
  • AutoPrint looks in C:\Winbar4x\Batch for new batch files at frequent intervals set by the user. If found, the batch file is opened and read.
  • AutoPrint performs four actions:
  • bn1make.lab: program to print a bar code label for a new sample to be stored in the repository. This program was designed with prompts for the user to enter data. I think that the '[PROMPT]' and 'STATEMENT= ' commands need be removed to run this label program from a batch file.
    [PARAMETER]
    PGM_UNITS=INCHES
    CLASS=ZEBRA
    PRINTER=Zebra 105
    ORG=0,0
    DB_CLASS=Vista
    DB_PATH=
    DENSITY=8 dots/mm
    DOTS_MMX=8.00000
    DOTS_MMY=8.00000
    DOTS_INCHX=203.20000
    DOTS_INCHY=203.20000
    DESC=PRINTS ONE BOTTLE LABEL
    LABELSIZE=305,114
    SIZE=305,114
    EXTENT=305,114
    LABEL_OFFSET=0,6
    CUTTER_ENABLE=N
    CUTTER_QTY=0
    DARKNESS=60
    CUTTER_PAUSE_OVERRIDE=N
    PRINTSPEED= 51 mm/sec
    MODE=Tear Off
    LABEL_ROTATION=0   degrees
    CLEAR_PRINTER=N
    MIRROR=N
    REVERSE=N
    BACKFEED=N
    DIRECT_THERMAL=N
    CONTINUOUS=N
    SEQREPEAT_QTY=2
    SLEW_DOTS=0
    STOCK=C:\WINBAR3X\STOCKS\BTLB2UP.STK
    MAX_BITMAPS=6
    DB_EXT=
    [BARCODE]
    ORG=35,11
    SYMBOLOGY=CODE 39
    RATIO=2:1
    HEIGHT=69
    OBJ_ROTATION=0   degrees
    XDEM=2
    GUIDE=Y
    INTERP_SIZE=12,17
    INTERP_OFFSET=5
    INTERP_STARTSTOP=Y
    BC_X_OFFBEF=0
    BC_X_OFFAFT=0
    INTERPRETATION=BELOW
    PACK=
    CHECKSUM=0
    START_CHAR=
    STOP_CHAR=
    SERIALIZED=N
    LEADING_ZEROS=N
    INC/DEC=INC
    STEP=1
    VARIABLE_NAME=P-BN
    DATA=BN12345
    EXTENT=232,89
    [END_OBJS]
    [PROMPT]
    STATEMENT=Enter Bottle Number to Print
    NAME=P-BN
    MAX_LENGTH=7
    DATA_TYPE=STRING
    [END_VARS]
    

    Wrbship2.lab: program to print a bar code label for a sample to be shipped to a test system. This program was designed with prompts for the user to enter data. I think that the three '[PROMPT]' and 'STATEMENT= ' commands need be removed to run this label program from a batch file.

    [PARAMETER]
    PGM_UNITS=INCHES
    CLASS=ZEBRA
    PRINTER=Zebra 105
    ORG=0,0
    DB_CLASS=Vista
    DB_PATH=c:\winbar3x\data
    DENSITY=8 dots/mm
    DOTS_MMX=8.00000
    DOTS_MMY=8.00000
    DOTS_INCHX=203.20000
    DOTS_INCHY=203.20000
    DESC=
    LABELSIZE=256,272
    SIZE=256,272
    EXTENT=256,272
    LABEL_OFFSET=0,16
    CUTTER_ENABLE=N
    CUTTER_QTY=0
    CUTTER_PAUSE_OVERRIDE=N
    PRINTSPEED= 76 mm/sec
    LABEL_ROTATION=0   degrees
    CLEAR_PRINTER=N
    MIRROR=N
    REVERSE=N
    BACKFEED=N
    CONTINUOUS=N
    SEQREPEAT_QTY=0
    SLEW_DOTS=0
    STOCK=
    MAX_BITMAPS=6
    DARKNESS=30
    MODE=Tear Off
    DIRECT_THERMAL=N
    [BARCODE]
    ORG=5,35
    SYMBOLOGY=CODE 39
    RATIO=2:1
    HEIGHT=51
    OBJ_ROTATION=90  degrees
    XDEM=2
    GUIDE=Y
    INTERP_SIZE=12,17
    INTERP_OFFSET=5
    INTERP_STARTSTOP=Y
    BC_X_OFFBEF=0
    BC_X_OFFAFT=0
    INTERPRETATION=ABOVE
    PACK=
    CHECKSUM=0
    START_CHAR=
    STOP_CHAR=
    SERIALIZED=N
    LEADING_ZEROS=N
    INC/DEC=INC
    STEP=1
    VARIABLE_NAME=P-BN
    DATA=BM12345
    EXTENT=232,71
    [BARCODE]
    ORG=181,46
    SYMBOLOGY=CODE 39
    RATIO=2:1
    HEIGHT=51
    OBJ_ROTATION=270 degrees
    XDEM=2
    GUIDE=Y
    INTERP_SIZE=12,17
    INTERP_OFFSET=5
    INTERP_STARTSTOP=Y
    BC_X_OFFBEF=0
    BC_X_OFFAFT=0
    INTERPRETATION=ABOVE
    PACK=
    CHECKSUM=0
    START_CHAR=
    STOP_CHAR=
    SERIALIZED=N
    LEADING_ZEROS=N
    INC/DEC=INC
    STEP=1
    VARIABLE_NAME=P-MG
    DATA=1234M
    EXTENT=180,71
    GROUPED=
    [TEXT]
    ORG=39,4
    FONT=Smooth Font
    FONT_SIZE=21,26
    FONT_MULT=1,1
    OBJ_ROTATION=0   degrees
    OBJ_CHARSET=USA - 1
    REVERSE=N
    SERIALIZED=N
    LEADING_ZEROS=N
    INC/DEC=INC
    STEP=1
    VARIABLE_NAME=CONST Field
    DATA=WRAIR
    EXTENT=57,26
    [TEXT]
    ORG=67,242
    FONT=Smooth Font
    FONT_SIZE=19,26
    FONT_MULT=1,1
    OBJ_ROTATION=0   degrees
    OBJ_CHARSET=USA - 1
    REVERSE=N
    SERIALIZED=N
    LEADING_ZEROS=N
    INC/DEC=INC
    STEP=1
    VARIABLE_NAME=CONST Field
    DATA=Test System:
    EXTENT=95,26
    GROUPED=
    [TEXT]
    ORG=176,243
    FONT=Smooth Font
    FONT_SIZE=19,26
    FONT_MULT=1,1
    OBJ_ROTATION=0   degrees
    OBJ_CHARSET=USA - 1
    REVERSE=N
    SERIALIZED=N
    LEADING_ZEROS=N
    INC/DEC=INC
    STEP=1
    VARIABLE_NAME=P-TS
    DATA=TS
    EXTENT=19,26
    GROUPED=
    [TEXT]
    ORG=158,3
    FONT=Smooth Font
    FONT_SIZE=14,26
    FONT_MULT=1,1
    OBJ_ROTATION=0   degrees
    OBJ_CHARSET=USA - 1
    REVERSE=N
    SERIALIZED=N
    LEADING_ZEROS=N
    INC/DEC=INC
    STEP=1
    VARIABLE_NAME=F-MONTH
    DATA=October 10. 1994
    EXTENT=89,26
    GROUPED=
    [TEXT]
    ORG=100,27
    FONT=Smooth Font
    FONT_SIZE=17,22
    FONT_MULT=1,1
    OBJ_ROTATION=270 degrees
    OBJ_CHARSET=USA - 1
    REVERSE=N
    SERIALIZED=N
    LEADING_ZEROS=N
    INC/DEC=INC
    STEP=1
    VARIABLE_NAME=CONST Field
    DATA=JOHN_NOTSCH@WRSMTP-
    EXTENT=178,22
    GROUPED=
    [TEXT]
    ORG=136,67
    FONT=Smooth Font
    FONT_SIZE=17,22
    FONT_MULT=1,1
    OBJ_ROTATION=270 degrees
    OBJ_CHARSET=USA - 1
    REVERSE=N
    SERIALIZED=N
    LEADING_ZEROS=N
    INC/DEC=INC
    STEP=1
    VARIABLE_NAME=CONST Field
    DATA=CCMAIL.ARMY.MIL
    EXTENT=123,22
    GROUPED=
    [END_OBJS]
    [PROMPT]
    STATEMENT=Enter Bottle Number:
    NAME=P-BN
    MAX_LENGTH=7
    DATA_TYPE=STRING
    [PROMPT]
    STATEMENT=Enter Test System:
    NAME=P-TS
    MAX_LENGTH=2
    DATA_TYPE=STRING
    [PROMPT]
    STATEMENT=Enter Sample Weight
    NAME=P-MG
    MAX_LENGTH=7
    DATA_TYPE=STRING
    [FORMAT]
    STATEMENT=<S-Month(1:* s)
    MAX_LENGTH=9
    NAME=F-DATE
    DATA_TYPE=STRING
    [FORMAT]
    STATEMENT=<S-Month(1:* s)" "<S-DD(1:* s)", "<S-YYYY(1:* s)
    MAX_LENGTH=18
    NAME=F-MONTH
    DATA_TYPE=STRING
    [END_VARS]