[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference noted::hackers_v1

Title:-={ H A C K E R S }=-
Notice:Write locked - see NOTED::HACKERS
Moderator:DIEHRD::MORRIS
Created:Thu Feb 20 1986
Last Modified:Mon Aug 03 1992
Last Successful Update:Fri Jun 06 1997
Number of topics:680
Total number of notes:5456

266.0. "Any BAR CODE printing program?" by HKOV01::TSANG () Tue Jun 24 1986 12:21

We are searching for software that can be used to print bar-code
  label from the LA type printer. Please advice where can find
  the software or how to write the program.
  
  Thanks and regards,
  KC Tsang
  
T.RTitleUserPersonal
Name
DateLines
266.1Bar code in COBOLSHOGUN::BLUEJAYDo not attempt to adjust your set...Tue Jun 24 1986 12:374
    Look at SHOGUN""::BAR.COB for a little COBOL routine that generates
    SIXEL sequences for CODE-39 bar code.
    
    						- Bluejay Adametz, CFII
266.2HKOV01::TSANGWed Jun 25 1986 06:045
  Thanks, I will play with it.
  
  Regards,
  KC
  
266.3LA50 output cann't be readHKOV01::TSANGWed Jun 25 1986 09:0110
The bar code reader seems not very happy with the output from the
  LA50. It should be a resolution problem, I guess. Is there any way to cure
  it? Suggestion to bar code reader model is appreciated.
  
  I know it is another question and should be posted some other
  notes file. Please forgive me!
  
  Regards,
  KC Tsang
  
266.4Code 39 with a RainbowASGMKA::TOMASJoeWed Jun 25 1986 12:4987
    You didn't indicate whether the bar code application needed to run
    from a Vax, so I'll put this info here for you anyway.  Below are
    notes extracted from my DBASE notes file (ASGMKA::DBASE).  I hope
    this helps.
    
    Joe Tomas

    
        
                   <<< DISK07:[NOTES$LIBRARY]DBASE.NOTE;1 >>>
                           -<  *** dBASE II/III *** >-
================================================================================
Note 112.0               Code39 Bar Code Labels /dBASE                   1 reply
ASGMKD::TOMAS                                        39 lines  10-JAN-1986 13:11
--------------------------------------------------------------------------------

About a year ago I wrote a dBASE II application that would print CODE39 bar
code labels on the LA50 printer.  Since then, several people have asked for
a copy of the program.  If anyone has a desire for the program, let me know
and I'll make it available.

-Joe-

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
                                                                           
PROGRAM DESCRIPTION:

dBASE II version -
 
BCODE.PRG was written for a specific project and is designed to print only
3 character (0-9, A-Z) labels, although it may be modified to accept up to
4 characters.  The reason for this limitation is that all data is stored
in 27 character memory variables and any more than 4 characters times 27
exceeds dBASE II's memory variable limitation of 128 characters.  
 
You are also asked whether you want large or small (default) labels.  Some
bar code scanners may have difficulty reading the small resolution labels,
so if you request large, the program goes out to another PRG file to reload
the memory variables with the proper data.

Yes, the program is somewhat crude and certainly can be improved upon. Please
be my guest.


dBASE III version -

This version has the data for large and small aspects stored in two DBF files,
both with the same index file.  Because dBASE III allows up to 255 characters
for variable names, the label can now print up to 9 alphanumeric characters
(still limited to 0-9, A-Z).  Again, with some modifications, I'm certain
that even this limitation can be overcome.


ENJOY!

================================================================================
Note 112.1               Code39 Bar Code Labels /dBASE                    1 of 1
ASGMKD::TOMAS                                        27 lines  13-JAN-1986 10:30
--------------------------------------------------------------------------------

OK...OK.  I should have known better that someone would ask for them.

The files are now available in my public account as follows:

The dBASE II version (either CP/M or MS-DOS) is at:

ASGMKD::DUA0:[TOMAS.PUBLIC.CPM] BCODE.PRG
                                TABLE3_1.PRG  <- 3:1 aspect ratio 

                                                                   
The dBASE III version is in:

ASGMKD::DUA0:[TOMAS.PUBLIC.MSDOS] BCODE.PRG
                                  CODE39S.DBF <- data file for 2.5:1 aspect
                                  CODE39L.DBF <- data file for 3:1 aspect
                                  CHAR.NDX    <- index file for both .DBFs


These files were uploaded using LCTerm (Kermit protocol), so be sure to set
the SEND PACKET_LENGTH 90 and SET FIL TY BIN on the VAX end if you're down-
loading the DBF and NDX files.  The PRG files are ASCII files.

Enjoy.

-Joe-

    
266.5or, in DCL...FROST::PIPERbill piperWed Jul 02 1986 20:42153
Well, I can't figure out COBOL, nor how to pass parameters to BAR.COB,
so I threw together this command file.  Thanks to Bluejay Adametz for
the required bit patterns.

-piper

$	echo = 'f$verify (0)'
$!++
$! X01.00
$!
$! Bar codes.  In DCL?  Sure, why not...
$!
$! Output is to SYS$OUTPUT.  For files, use @foo/OUTPUT=bar or
$! equivalent.  The output is intended for an LA100, but a VT125 or
$! VT240 will do if you ignore the non-wide text output.  Looks real
$! nice on an LN03, too. 
$!
$! GOSUB is too useful, so this needs VMS V4.4 or later.
$!
$! The array CHAR_SET defines those characters known to CODE39.  The
$! corresponding patterns are encoded into the array MASK_SET. 
$! MASK_SET is a collection of hex numbers, with wide elements coded as
$! "1" and narrow as "0".  Given the wide/narrow order of CODE39, we
$! toggle the bar/space automatically. 
$!
$! Thanks to Bluejay Adametz for the bit settings.
$!
$! -piper 2-Jul-1986
$!--
$	esc[0,8] = 27				! <escape> character
$	sixel_on = esc + "P0q"			! LA100 sixel-on command
$	sixel_off = esc + "\"			!  and off command
$
$!++
$! Two bits for a narrow and twice that for a wide seems to work.  And
$! this width goes nicely with 5 char/inch text.
$!--
$	bar = "~~"				! Tilde fires six print heads
$	space = "??"				! Question fires none
$	HEIGHT = 3				! Do it this many times
$
$	five_per = esc + "[5w"			! Wider text
$	ten_per = esc + "[0w"			! Normal again
$!++
$! Here's the characters CODE39 knows
$!--
$	char_set = "*0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%"
$	max_char_index = f$length (char_set) - 1
$!++
$! And an array of integers (using only 9 bits) that define wide (1)
$! and narrow (0) entities.  The order of these entities is always
$! bar-space-bar-space-bar-space-bar-space-bar.
$!--
$	mask_set = 	      "094,034,121,061,160,"	! *0123
$	mask_set = mask_set + "031,130,070,025,124,"	! 45678
$	mask_set = mask_set + "064,109,049,148,019,"	! 9ABCD
$	mask_set = mask_set + "118,058,00D,10C,04C,"	! EFGHI
$	mask_set = mask_set + "01C,103,043,142,013,"	! JKLMN
$	mask_set = mask_set + "112,052,007,106,046,"	! OPQRS
$	mask_set = mask_set + "016,181,0C1,1C0,091,"	! TUVWX
$	mask_set = mask_set + "190,0D0,085,184,0C4,"	! YZ-.<space>
$	mask_set = mask_set + "0A8,0A2,08A,02A"		! $/+%
$
$ 10:
$	read /end=99 sys$command string /prompt="Input string: "
$
$	gosub generate_code			! Do some real work
$	if .not. $status then goto 10		! Quietly do nothing
$
$	gosub write_it_out			! Write some bytes out
$
$	goto 10
$ 99:
$	exit 1 + 0*f$verify(echo)

$ generate_code:
$!++
$! Change those characters into strings of Sixel stuff.  The output
$! is in the "array" CODE(i).
$!--
$	string = f$edit (string, "upcase,trim")	! Tweak it
$	string = "*" + string + "*"		! Pad the ends with stars
$	position = 0				! Init this pointer
$	length = f$length (string)		! How long is this
$
$	code = ""				! Start the output rolling
$ gc_10:
$	char = f$extract (position, 1, string)	! Grab a character
$	index = f$locate (char, char_set)	! Where in the set?
$	index = f$integer (index)		! Number, please
$	if index .gt. max_char_index then -	! OK?
		return %x10000000		! No, barf
$
$	mask = f$element (index, ",", mask_set)	! What hex digits?
$	mask = "%x" + mask			! Make it hex
$	mask = f$integer (mask)			! Then an integer
$!++
$! OK, we have the mask for this character.  Now play bar-space-bar...
$! on it.  Each time the mask has a bit set, output a wide {bar|space};
$! bit clear, output narrow.
$!
$! The loop counter (nine iterations, 8..0) serves as the bar/space flag.
$! And we run the loop backwards, since it's easier to IF MASK this way.
$!--
$	n = 8
$	this_code = ""
$!++
$! Add an inter-character gap, two spaces wide, but not on the front
$!--
$	if code .nes. "" then code = code + space + space
$
$ gc_20:
$	thing = bar				! Assume a bar
$	if n then thing = space			! Or a space
$	if mask then thing = thing + thing	! Two of 'em for wide
$	this_code = thing + this_code		! Add it on the left
$	mask = mask / 2				! Shift right
$	n = n - 1				! Count down
$	if n .ge. 0 then goto gc_20		! Loop
$
$	code'position' = this_code		! Store in 'array'
$
$	position = position + 1			! Next character
$	if position .lt. length then goto gc_10	! Loop, maybe
$	return					! Finished

$ write_it_out:
$!++
$! OK, we've got an array CODE(i), i=0,length (or so).  Write out this
$! thing HEIGHT times (six bits high per go-around).
$!--
$	write sys$output sixel_on		! Into graphics
$	w_i = 0					! Height loop
$ w_10:
$	w_p = 0					! Character-code loop
$ w_20:
$	write sys$output code'w_p'		! One character
$	write sys$output space, space		! Inter-char gap
$	w_p = w_p + 1
$	if w_p .lt. length then goto w_20
$
$	write sys$output "-"			! Graphics newline
$
$	w_i = w_i + 1				! Bump height count
$	if w_i .lt. HEIGHT then goto w_10	! However many times
$
$	write sys$output f$fao ("!AS!/!AS!AS!AS!/", -
			sixel_off, -		! Kill graphics
			five_per, -		! Wider text
			string, -		! For this string
			ten_per )		! Back to normal text
$
$	return					! All done
266.6Barcode printer/applierDSSDEV::ALDENKen AldenThu Jul 03 1986 13:199
    I know this isn't really the place for this but hey.
    
    I've got a friend in Polaroid who is looking for a DEC solution
    to print barcodes and have them (the barcodes) applied to some passing
    piece of inventory. Do we have such a gismo or does anyone have
    an idea of what notes file I might try looking in?
    
    Thanks,
    -Ken Alden
266.7Some places to look for barcode solutionsGALLO::AMARTINAlan H. MartinThu Jul 10 1986 18:4614
Re .6:

1.  Every book in the MR1 library has a barcode strip attached, and
the librarians check out a book via a barcode reader hooked on the back
of a VT100 logged in to a VMS system (I think it is a 100 and not a 180 or
something).  I suspect that other corporate libraries use the same system.
Send mail to Joan O'Brien (OBRIEN@RABBIT) to find out who did the work.

2.  See NMGV07::PRODUCTIVITY_FORUM (q.v.), particularly notes 2.1, 9.*
and 29.0.

None of these success stories are necessarily allowed to be mentioned
to customers.
				/AHM
266.8dumping barcode to attatched la50SNO78A::BRAHAMPete BrahamWed Jul 30 1986 01:404
    That barcode dcl prog is very nice!! (but..) I can't get the screen
    image to dump onto my attached la50 unless I have the printer set to
    controller mode in set up (& then everything goes straight to the
    printer & bypasses my vt) - any ideas?
266.9SHIFT-PRINT SCREEN15749::GORDONDoug Gordon, Striving for RealityWed Jul 30 1986 12:304
    If you're talking about a VT200 - use SHIFT-PRINT_SCREEN to get
    it to do a bit-map copy of the screen to the LA50.
    
    					--Doug
266.10<esc>[iFROST::PIPERbill piperWed Jul 30 1986 14:4313
re: .8

Right after

	$	gosub write_it_out			! Write some bytes out

throw in

	$	write sys$output esc, "[i"		! Print the screen

which, according to this VT220 guide here, "prints the screen display".

-piper
266.11SNO78A::BRAHAMPete BrahamThu Jul 31 1986 03:348
    Thanks - I got the manual method (use SHIFT print_screen) to work.
    The trick seems to be to not have rotate print in the graphics set
    up (to avoid lots of spurious line feeds which made me think
    something had gone wrong), and not to have the 'reset from sixel
    mode' command (the last write sys$output). I couldn't get the
    write sys$output CSI,"i" (after the gosub write_it_out) to work
    though!