HP LaserJet 4100 HP PCL/PJL reference (PCL 5 Printer Language) - Technical Ref - Page 133
Example: Using the PE Command, 100 IF>= 0 THEN F = 2*ABSF ELSE F = 2*ABSF+1
View all HP LaserJet 4100 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 133 highlights
Note EN When using PE (in the default relative mode), the application program does not know the current pen location after printing a label (normally, the current pen location is updated to the end of the label.) If this presents a problem in your program, follow these steps. 1 Create a flag called "lost" in your program. 2 After labeling (or any command which updates the current pen location), set lost to true. 3 If lost = true at the beginning of the PE command, use an absolute flag for the first coordinate pair only (subsequent coordinates are interpreted as relative). 4 Set lost to false. At the beginning of your application program, set lost to true. Then, specify the next coordinate in absolute mode (PA or PE=). When converting and encoding data, note the following. z n DIV 64 = n.shift right.6 bits. You can optimize your application by shifting 6 bits to the right since shifting is faster than division. z n MOD 64 = n.AND.63. The number is logically AND'd with 63. Example: Using the PE Command The following BASIC program converts three relative real coordinates to base 64. ``10 LPRINT CHR$(27);"E"; 'Reset the Printer.'' ``20 LPRINT CHR$(27);"%0B"; 'Enter HP-GL/2 Mode.'' ``30 LPRINT "IN;SC1,20,1,20,1;SP1;PU5,5;";'' ``40 PRINT "Input number of fractional decimal places in data" '' ``50 INPUT F 'In this example, 2 decimal places (line 290).'' ``60 'Calculate Number of Fractional Binary Bits '' ``70 F = F * 3.33 '' ``80 F = INT(F) '' ``90 A = F '' ``100 IF F >= 0 THEN F = 2*ABS(F) ELSE F = 2*ABS(F)+1 '' ``110 F = 191+F '' ``120 LPRINT #1, "PE>"+CHR$(F) '' PE, Polyline Encoded 20-41