home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / CLIPPER / MISC / ADIR2CNC.ZIP / ADI2CNC.LST < prev    next >
Encoding:
File List  |  1990-11-29  |  35.9 KB  |  696 lines

  1.  Thu 11-29-90 15:07:22    i       CONTENTS
  2.                                Page   Line
  3.  
  4. 11-27-90 12:24:02
  5. adi2cnc.bas                       1      1
  6. adi2cnc.bas                       9    494
  7.     11-27-90 12:24:02  adi2cnc.bas                                                                                            Pg   1
  8. Thu 11-29-90 15:07:22                                                                                                         of   9
  9.                                                                                                                                 1-55
  10.  
  11.     1             ' quick basic program to convert apple plotter commands
  12.     2             ' from autocad adi plotter file into G codes for use with
  13.     3             ' CNC milling machine
  14.     4             '
  15.     5             ' written by george mcduffee at allen county community college
  16.     6             ' march 13th, 1990
  17.     7             ' and released to the public domain.
  18.     8             '
  19.     9             ' program recognizes the following however other ADI commands can be added
  20.    10             ' if required.
  21.    11             '
  22.    12             ' 2 = home
  23.    13             ' G90
  24.    14             ' G00/000/000/000
  25.    15             '
  26.    16             ' 3 = move absolute [pen up]
  27.    17             ' G91
  28.    18             ' G01 000/000/0010
  29.    19             ' G90
  30.    20             ' G00 X/Y/Z
  31.    21             ' G91
  32.    22             ' G00 000/000/-010
  33.    23             '
  34.    24             ' 4 = plot absolute [pen down]
  35.    25             ' G91 X/Y/Z
  36.    26             '
  37.    27             ' exact conversion values will depend on how adi plotter selection
  38.    28             ' is set up.  This program assumes 254 points to the inch horz and vert.
  39.    29             '
  40.    30             ' Plot limits assumed to be within CNC limits - 7.87 in [200 m/m] X
  41.    31             ' 3.94 in [100 m/m] for Emco F1-CNC machine.
  42.    32             '
  43.    33             ' -------- start of program -------------
  44.    34
  45.    35             OPTION BASE 1
  46. d                  OPTION BASE  
  47.    36
  48.    37             DEFINT A-Z
  49. d                  DEFINT    
  50.    38
  51.    39             CLS
  52. d                  CLS
  53.    40             LOCATE 10, 10
  54. d                  LOCATE       
  55.    41             PRINT "This program will convert a AutoCadd ADI plotter output file"
  56. d                  PRINT                                                               
  57.    42             LOCATE 11, 10
  58. d                  LOCATE       
  59.    43             PRINT "into CNC G codes.  It assumes plot done at 1[inch] = 1[inch] and"
  60. d                  PRINT                                                                   
  61.    44             LOCATE 12, 10
  62. d                  LOCATE       
  63.    45             PRINT "plot size limited to 7.87 inches in the X direction and 3.94 inches"
  64. d                  PRINT                                                                      
  65.    46             LOCATE 13, 10
  66. d                  LOCATE       
  67.    47             PRINT "in the Y direction and that only ADI commands 2/3/4 [home/move abs/"
  68. d                  PRINT                                                                      
  69.    48             LOCATE 14, 10
  70. d                  LOCATE       
  71.    49             PRINT "plot abs are used.  Output will be written to <INFILE>.CNC"
  72. d                  PRINT                                                             
  73.    50             LOCATE 16, 10
  74. d                  LOCATE       
  75.    51             INPUT "input name of plot file"; plotfile$
  76. d                  INPUT                                     
  77.    52
  78.    53             ' ---------------- OPEN FILES --------------------------
  79.    54             plotfile$ = LTRIM$(RTRIM$(plotfile$))
  80. d                              LTRIM$ RTRIM$            
  81.    55
  82.     11-27-90 12:24:02  adi2cnc.bas                                                                                            Pg   2
  83. Thu 11-29-90 15:07:22                                                                                                         of   9
  84.                                                                                                                               56-110
  85.  
  86.    56             temp = INSTR(plotfile$, ".")
  87. d                         INSTR                
  88.    57
  89.    58          +--IF (temp = 0) THEN
  90. d                  IF            THEN
  91.    59          |       plotfile$ = plotfile$ + ".plt"
  92.    60          +--END IF
  93. d                  END IF
  94.    61
  95.    62             OPEN plotfile$ FOR INPUT ACCESS READ AS #1 LEN = 16284
  96. d                  OPEN           FOR INPUT ACCESS READ AS    LEN        
  97.    63
  98.    64             temp = INSTR(plotfile$, ".")
  99. d                         INSTR                
  100.    65
  101.    66          +--IF temp = 0 THEN
  102. d                  IF          THEN
  103.    67          |       gcodefile$ = plotfile$ + ".cnc"
  104.    68          +--ELSE
  105. d                  ELSE
  106.    69          |       gcodefile$ = LEFT$(plotfile$, (temp - 1))
  107. d                                    LEFT$                       
  108.    70          |       gcodefile$ = gcodefile$ + ".cnc"
  109.    71          +--END IF
  110. d                  END IF
  111.    72
  112.    73             OPEN gcodefile$ FOR OUTPUT ACCESS WRITE AS #2 LEN = 16284
  113. d                  OPEN            FOR OUTPUT ACCESS WRITE AS    LEN        
  114.    74
  115.    75
  116.    76             ' ----------------- DIM VARIABLES -----------------------
  117.    77             DIM comma(4) AS INTEGER
  118. d                  DIM          AS INTEGER
  119.    78             DIM InLineCounter AS INTEGER
  120. d                  DIM               AS INTEGER
  121.    79
  122.    80             ' Emco F1 omits decimal point
  123.    81             ' i.e. "0050" is  0.050
  124.    82             CONST clearence = "   150"
  125. d                  CONST                     
  126.    83
  127.    84             ' feed is in 1/10 inches per min.
  128.    85             ' i.e. "020" = 2 inches per min.
  129.    86             CONST Feed = "  20"
  130. d                  CONST              
  131.    87
  132.    88             ' factor to convert ADI values to CNC values
  133.    89             ' in this case 0.1 M/M to .001 inches
  134.    90             CONST ConversionFactor# = .254
  135. d                  CONST                         
  136.    91
  137.    92             ' emco F1-CNC controller requires information in specific column format
  138.    93
  139.    94             DIM HeaderLine1 AS STRING * 4
  140. d                  DIM             AS STRING    
  141.    95             HeaderLine1 = CHR$(255) + CHR$(255) + CHR$(255) + "%"
  142. d                                CHR$        CHR$        CHR$           
  143.    96
  144.    97             DIM HeaderLine2 AS STRING * 30
  145. d                  DIM             AS STRING     
  146.    98             HeaderLine2 = "    N` G`  X  `  Y `   Z ` F  "
  147.    99
  148.   100             DIM LastLine AS STRING
  149. d                  DIM          AS STRING
  150.   101             LastLine = "  " + CHR$(34) + "I":  'this is >   "I< indicating inch Vertical
  151. d                                    CHR$                                                      
  152.   102             LastLine = LastLine + CHR$(16) + CHR$(16) + CHR$(16) + CHR$(16) + CHR$(16)
  153. d                                        CHR$       CHR$       CHR$       CHR$       CHR$    
  154.   103             LastLine = LastLine + CHR$(16) + CHR$(16) + CHR$(16) + CHR$(16) + CHR$(16)
  155. d                                        CHR$       CHR$       CHR$       CHR$       CHR$    
  156.   104
  157.   105             CONST FeedRate = "  10"
  158. d                  CONST                  
  159.   106
  160.   107             TYPE EmcoLine
  161. d                  TYPE         
  162.   108             filler AS STRING * 3
  163. d                         AS STRING    
  164.   109             BlockNo AS STRING * 3
  165. d                          AS STRING    
  166.   110             Gcode AS STRING * 3
  167. d                        AS STRING    
  168.     11-27-90 12:24:02  adi2cnc.bas                                                                                            Pg   3
  169. Thu 11-29-90 15:07:22                                                                                                         of   9
  170.                                                                                                                              111-165
  171.  
  172.   111             CNCx AS STRING * 6
  173. d                       AS STRING    
  174.   112             CNCy AS STRING * 5
  175. d                       AS STRING    
  176.   113             CNCz AS STRING * 6
  177. d                       AS STRING    
  178.   114             Feed AS STRING * 4
  179. d                       AS STRING    
  180.   115             END TYPE
  181. d                  END TYPE
  182.   116
  183.   117             DIM emco AS EmcoLine
  184. d                  DIM      AS         
  185.   118             emco.filler = "   "
  186.   119             emco.BlockNo = "000"
  187.   120             emco.Gcode = " 21"
  188.   121             emco.CNCx = "    00"
  189.   122             emco.CNCy = "   00"
  190.   123             emco.CNCz = "    00"
  191.   124             emco.Feed = "    "
  192.   125
  193.   126
  194.   127             DIM blankemco AS EmcoLine
  195. d                  DIM           AS         
  196.   128             blankemco.filler = "   "
  197.   129             blankemco.Gcode = "   "
  198.   130             blankemco.CNCx = "      "
  199.   131             blankemco.CNCy = "     "
  200.   132             blankemco.CNCz = "      "
  201.   133             blankemco.Feed = "    "
  202.   134
  203.   135             emco = blankemco
  204.   136
  205.   137             DIM OldCNCx AS STRING * 6
  206. d                  DIM         AS STRING    
  207.   138             OldCNCx = "    00"
  208.   139
  209.   140             DIM OldCNCy AS STRING * 5
  210. d                  DIM         AS STRING    
  211.   141             OldCNCy = "   00"
  212.   142
  213.   143             DIM OldCNCz AS STRING * 6
  214. d                  DIM         AS STRING    
  215.   144             OldCNCz = "    00"
  216.   145
  217.   146             DIM blank6 AS STRING * 6
  218. d                  DIM        AS STRING    
  219.   147             blank6 = "      "
  220.   148             DIM blank5 AS STRING * 5
  221. d                  DIM        AS STRING    
  222.   149             blank5 = "     "
  223.   150             DIM blank4 AS STRING * 4
  224. d                  DIM        AS STRING    
  225.   151             blank4 = "    "
  226.   152             DIM blank3 AS STRING * 3
  227. d                  DIM        AS STRING    
  228.   153             blank3 = "   "
  229.   154
  230.   155             DIM tempd AS DOUBLE
  231. d                  DIM       AS DOUBLE
  232.   156
  233.   157             DIM pc, px, py AS DOUBLE
  234. d                  DIM            AS DOUBLE
  235.   158
  236.   159             TYPE emcostring
  237. d                  TYPE           
  238.   160             es1 AS STRING * 30
  239. d                      AS STRING     
  240.   161             END TYPE
  241. d                  END TYPE
  242.   162
  243.   163             DIM es AS emcostring
  244. d                  DIM    AS           
  245.   164
  246.   165
  247.     11-27-90 12:24:02  adi2cnc.bas                                                                                            Pg   4
  248. Thu 11-29-90 15:07:22                                                                                                         of   9
  249.                                                                                                                              166-220
  250.  
  251.   166             ' ----------------- START OF MAIN -----------------------
  252.   167
  253.   168             ' send header lines to cnc file
  254.   169             PRINT #2, HeaderLine1
  255. d                  PRINT                
  256.   170             PRINT #2, HeaderLine2
  257. d                  PRINT                
  258.   171
  259.   172
  260.   173             linecount = -1
  261.   174
  262.   175             ' set cnc to absolute mode
  263.   176
  264.   177             emco = blankemco
  265.   178
  266.   179             GOSUB MakeNstring
  267. d                  GOSUB            
  268.   180
  269.   181             emco.BlockNo = Nstring$
  270.   182             emco.Gcode = " 90"
  271.   183             PRINT #2, emco.filler; emco.BlockNo; emco.Gcode; emco.CNCx; emco.CNCy; emco.CNCz; emco.Feed
  272. d                  PRINT                                                                                      
  273.   184
  274.   185
  275.   186          +--WHILE NOT (EOF(1))
  276. d                  WHILE NOT  EOF    
  277.   187          |       LINE INPUT #1, PlotterLine$
  278. d                       LINE INPUT                 
  279.   188          |
  280.   189          |       ' for debug
  281.   190          |       ' PRINT PlotterLine$
  282.   191          |
  283.   192          |       GOSUB Convert2CNC
  284. d                       GOSUB            
  285.   193          +--WEND
  286. d                  WEND
  287.   194
  288.   195             ' write M30 as last line of cnc file
  289.   196
  290.   197             GOSUB MakeNstring
  291. d                  GOSUB            
  292.   198             emco = blankemco
  293.   199             emco.BlockNo = Nstring$
  294.   200             emco.Gcode = "M30":  'rapid traverse
  295.   201             emco.CNCx = "      "
  296.   202             emco.CNCy = "     "
  297.   203             emco.CNCz = "      "
  298.   204             PRINT #2, emco.filler; emco.BlockNo; emco.Gcode; emco.CNCx; emco.CNCy; emco.CNCz; emco.Feed
  299. d                  PRINT                                                                                      
  300.   205
  301.   206             ' add lst line
  302.   207             PRINT #2, LastLine
  303. d                  PRINT             
  304.   208             ' PRINT #2, ""
  305.   209
  306.   210
  307.   211             CLOSE
  308. d                  CLOSE
  309.   212
  310.   213             ' display warning if block count greater than F1-CNC limits
  311.   214          +--IF linecount > 221 THEN
  312. d                  IF                 THEN
  313.   215          |       CLS
  314. d                       CLS
  315.   216          |       LOCATE 10, 10
  316. d                       LOCATE       
  317.   217          |       PRINT "WARNING"
  318. d                       PRINT          
  319.   218          |       LOCATE 12, 10
  320. d                       LOCATE       
  321.   219          |       PRINT "Generated program contains "; linecount; " blocks"
  322. d                       PRINT                                                    
  323.   220          |       LOCATE 14, 10
  324. d                       LOCATE       
  325.     11-27-90 12:24:02  adi2cnc.bas                                                                                            Pg   5
  326. Thu 11-29-90 15:07:22                                                                                                         of   9
  327.                                                                                                                              221-275
  328.  
  329.   221          |       PRINT "The limit of the EMCO controller is 221."
  330. d                       PRINT                                           
  331.   222          |       LOCATE 16, 10
  332. d                       LOCATE       
  333.   223          |       PRINT "DATA is usable -- edit and run as two programs"
  334. d                       PRINT                                                 
  335.   224          +--END IF
  336. d                  END IF
  337.   225
  338.   226
  339.   227             END
  340. d                  END
  341.   228
  342.   229             ' -------------------- END OF MAIN -----------------------
  343.   230
  344.   231             ' -----------
  345.   232 Convert2CNC:
  346.   233
  347.   234
  348.   235             ' set px and py [plotter x and plotter y to -1
  349.   236             ' if -1 shows these were not set and error if not 'home'
  350.   237             pc = -1
  351.   238             px = -1
  352.   239             py = -1
  353.   240
  354.   241             ' parse plotter line and check data format
  355.   242             'count the number of commas in plotter line assume 2 max but check for
  356.   243             ' three for error condition
  357.   244             comma(1) = 0
  358.   245             comma(2) = 0
  359.   246             comma(3) = 0
  360.   247
  361.   248             'increment plotter input file line counter for error reporting
  362.   249             InLineCounter = InLineCounter + 1
  363.   250
  364.   251             comma(1) = INSTR(PlotterLine$, ",")
  365. d                             INSTR                   
  366.   252
  367.   253          +--IF comma(1) > 0 THEN
  368. d                  IF              THEN
  369.   254          |       comma(2) = INSTR(comma(1) + 1, PlotterLine$, ",")
  370. d                                  INSTR                                 
  371.   255          +--END IF
  372. d                  END IF
  373.   256
  374.   257          +--IF comma(2) > 0 THEN
  375. d                  IF              THEN
  376.   258          |       comma(3) = INSTR(comma(2) + 1, PlotterLine$, ",")
  377. d                                  INSTR                                 
  378.   259          +--END IF
  379. d                  END IF
  380.   260
  381.   261             ' for debug
  382.   262             ' PRINT "In Line = "; InLineCounter
  383.   263             ' PRINT "comma(1) = "; comma(1)
  384.   264             ' PRINT "comma(2) = "; comma(2)
  385.   265             ' PRINT "comma(3) = "; comma(3)
  386.   266
  387.   267          +--IF comma(3) > 0 THEN
  388. d                  IF              THEN
  389.   268          |       CLS
  390. d                       CLS
  391.   269          |       LOCATE 5, 10
  392. d                       LOCATE      
  393.   270          |       PRINT "error condition in input file at line "; InLineCounter
  394. d                       PRINT                                                        
  395.   271          |       LOCATE 7, 10
  396. d                       LOCATE      
  397.   272          |       PRINT "More than 2 commas found. "
  398. d                       PRINT                             
  399.   273          |       LOCATE 9, 10
  400. d                       LOCATE      
  401.   274          |       PRINT "correct input [plotter] file and rerun.  Press [Enter] key to exit."
  402. d                       PRINT                                                                      
  403.   275          |       INPUT ; "", dummy$
  404. d                       INPUT             
  405.     11-27-90 12:24:02  adi2cnc.bas                                                                                            Pg   6
  406. Thu 11-29-90 15:07:22                                                                                                         of   9
  407.                                                                                                                              276-330
  408.  
  409.   276          |       END
  410. d                       END
  411.   277          +--END IF
  412. d                  END IF
  413.   278
  414.   279          +--IF comma(1) = 0 THEN
  415. d                  IF              THEN
  416.   280          |       pc = VAL(PlotterLine$)
  417. d                            VAL              
  418.   281          +--ELSE
  419. d                  ELSE
  420.   282          |    +--IF comma(2) = 0 THEN
  421. d                       IF              THEN
  422.   283          |    |       'error as line must have no or two commas
  423.   284          |    |       CLS
  424. d                            CLS
  425.   285          |    |       LOCATE 5, 10
  426. d                            LOCATE      
  427.   286          |    |       PRINT "error condition in input file at line "; InLineCounter
  428. d                            PRINT                                                        
  429.   287          |    |       LOCATE 7, 10
  430. d                            LOCATE      
  431.   288          |    |       PRINT "Only 1 comma found. Line must have no or two commas"
  432. d                            PRINT                                                      
  433.   289          |    |       LOCATE 9, 10
  434. d                            LOCATE      
  435.   290          |    |       PRINT "correct input [plotter] file and rerun.  Press [Enter] key to exit."
  436. d                            PRINT                                                                      
  437.   291          |    |       INPUT ; "", dummy$
  438. d                            INPUT             
  439.   292          |    |       END
  440. d                            END
  441.   293          |    +--END IF
  442. d                       END IF
  443.   294          |
  444.   295          |       pc = VAL(PlotterLine$)
  445. d                            VAL              
  446.   296          |       temp$ = MID$(PlotterLine$, comma(1) + 1, (comma(2) - comma(1) - 1))
  447. d                               MID$                                                       
  448.   297          |       px = VAL(temp$)
  449. d                            VAL       
  450.   298          |       temp$ = MID$(PlotterLine$, comma(2) + 1)
  451. d                               MID$                            
  452.   299          |       py = VAL(temp$)
  453. d                            VAL       
  454.   300          +--END IF
  455. d                  END IF
  456.   301
  457.   302             ' debug
  458.   303             ' PRINT "pc ="; pc
  459.   304             ' PRINT "px ="; px
  460.   305             ' PRINT "py ="; py
  461.   306
  462.   307             GOSUB WriteGCode
  463. d                  GOSUB           
  464.   308
  465.   309
  466.   310             RETURN
  467. d                  RETURN
  468.   311             ' -----------
  469.   312
  470.   313             ' -----------
  471.   314 WriteGCode:
  472.   315             ' px and py from plotter file are in .1 M/M
  473.   316
  474.   317             ' save existing CNC x/y/z  values for possible later use to withdraw cutter
  475.   318             ' without setting to relative mode and then back [saves blocks]
  476.   319          +--IF NOT emco.CNCx = "      " THEN
  477. d                  IF NOT                      THEN
  478.   320          |       OldCNCx = emco.CNCx
  479.   321          +--END IF
  480. d                  END IF
  481.   322
  482.   323          +--IF NOT emco.CNCy = "     " THEN
  483. d                  IF NOT                     THEN
  484.   324          |       OldCNCy = emco.CNCy
  485.   325          +--END IF
  486. d                  END IF
  487.   326
  488.   327          +--IF NOT emco.CNCz = "      " THEN
  489. d                  IF NOT                      THEN
  490.   328          |       OldCNCz = emco.CNCz
  491.   329          +--END IF
  492. d                  END IF
  493.   330
  494.     11-27-90 12:24:02  adi2cnc.bas                                                                                            Pg   7
  495. Thu 11-29-90 15:07:22                                                                                                         of   9
  496.                                                                                                                              331-385
  497.  
  498.   331
  499.   332             ' move absolute pen up
  500.   333             IF (pc = 3) THEN GOSUB MoveCutterUp
  501. d                  IF          THEN GOSUB             
  502.   334
  503.   335             'move absolute pen down
  504.   336             IF pc = 4 THEN GOSUB MillLine
  505. d                  IF        THEN GOSUB         
  506.   337
  507.   338             ' home
  508.   339             IF (pc = 2 AND px = -1 AND py = -1) THEN GOSUB Home
  509. d                  IF         AND         AND          THEN GOSUB     
  510.   340
  511.   341             RETURN
  512. d                  RETURN
  513.   342             ' --------------
  514.   343
  515.   344             ' -------------
  516.   345 MakeNstring:
  517.   346
  518.   347             linecount = linecount + 1
  519.   348
  520.   349             n$ = STR$(linecount)
  521. d                       STR$           
  522.   350             n$ = RTRIM$(LTRIM$(n$))
  523. d                       RTRIM$ LTRIM$     
  524.   351         ++--SELECT CASE LEN(n$)
  525. d                  SELECT CASE LEN    
  526.   352         |+-------CASE IS = 1
  527. d                       CASE IS    
  528.   353         ||            Nstring$ = "00" + n$
  529.   354         |+-------CASE IS = 2
  530. d                       CASE IS    
  531.   355         ||            Nstring$ = "0" + n$
  532.   356         |+-------CASE IS = 3
  533. d                       CASE IS    
  534.   357         ||            Nstring$ = n$
  535.   358         |+-------CASE ELSE
  536. d                       CASE ELSE
  537.   359         ++--END SELECT
  538. d                  END SELECT
  539.   360
  540.   361             RETURN
  541. d                  RETURN
  542.   362             ' ----------
  543.   363
  544.   364             ' ---------- homes the head
  545.   365   Home:
  546.   366
  547.   367             'withdraw cutter under rapid traverse
  548.   368             GOSUB MakeNstring
  549. d                  GOSUB            
  550.   369             emco = blankemco
  551.   370             emco.BlockNo = Nstring$
  552.   371             emco.Gcode = " 00":  'rapid traverse
  553.   372             emco.CNCx = OldCNCx
  554.   373             emco.CNCy = OldCNCy
  555.   374             emco.CNCz = "    00"
  556.   375             PRINT #2, emco.filler; emco.BlockNo; emco.Gcode; emco.CNCx; emco.CNCy; emco.CNCz; emco.Feed
  557. d                  PRINT                                                                                      
  558.   376
  559.   377             ' move to home under rapid traverse
  560.   378             GOSUB MakeNstring
  561. d                  GOSUB            
  562.   379             emco = blankemco
  563.   380             emco.BlockNo = Nstring$
  564.   381             emco.Gcode = " 00":  'rapid traverse
  565.   382             emco.CNCx = "    00"
  566.   383             emco.CNCy = "   00"
  567.   384             emco.CNCz = "    00"
  568.   385             PRINT #2, emco.filler; emco.BlockNo; emco.Gcode; emco.CNCx; emco.CNCy; emco.CNCz; emco.Feed
  569. d                  PRINT                                                                                      
  570.     11-27-90 12:24:02  adi2cnc.bas                                                                                            Pg   8
  571. Thu 11-29-90 15:07:22                                                                                                         of   9
  572.                                                                                                                              386-440
  573.  
  574.   386
  575.   387
  576.   388             RETURN
  577. d                  RETURN
  578.   389             ' -----------
  579.   390
  580.   391             ' ----------
  581.   392 MoveCutterUp:
  582.   393
  583.   394             ' withdraw cutter at rapid traverse
  584.   395             GOSUB MakeNstring
  585. d                  GOSUB            
  586.   396             emco = blankemco
  587.   397             emco.BlockNo = Nstring$
  588.   398             emco.Gcode = " 00":  'rapid traverse
  589.   399             emco.CNCx = OldCNCx
  590.   400             emco.CNCy = OldCNCy
  591.   401             emco.CNCz = "    00"
  592.   402             PRINT #2, emco.filler; emco.BlockNo; emco.Gcode; emco.CNCx; emco.CNCy; emco.CNCz; emco.Feed
  593. d                  PRINT                                                                                      
  594.   403
  595.   404
  596.   405             ' move to new location at rapid traverse
  597.   406             GOSUB MakeNstring
  598. d                  GOSUB            
  599.   407             emco = blankemco
  600.   408             GOSUB ConvertP2G
  601. d                  GOSUB           
  602.   409             emco.BlockNo = Nstring$
  603.   410             emco.Gcode = " 00":  'rapid traverse
  604.   411             emco.CNCz = "    00"
  605.   412             PRINT #2, emco.filler; emco.BlockNo; emco.Gcode; emco.CNCx; emco.CNCy; emco.CNCz; emco.Feed
  606. d                  PRINT                                                                                      
  607.   413
  608.   414
  609.   415             ' bring cutter down at proper feed rate at new location
  610.   416             GOSUB MakeNstring
  611. d                  GOSUB            
  612.   417             emco.BlockNo = Nstring$
  613.   418             emco.Gcode = " 01":  'linear interpolation
  614.   419             emco.CNCz = clearence
  615.   420             emco.Feed = FeedRate
  616.   421             MID$(emco.CNCz, 1) = "-": '- to feed down
  617. d                  MID$                                     
  618.   422             PRINT #2, emco.filler; emco.BlockNo; emco.Gcode; emco.CNCx; emco.CNCy; emco.CNCz; emco.Feed
  619. d                  PRINT                                                                                      
  620.   423
  621.   424
  622.   425
  623.   426
  624.   427             RETURN
  625. d                  RETURN
  626.   428             ' ----------
  627.   429
  628.   430             ' ----------
  629.   431 MillLine:
  630.   432             ' mill line
  631.   433             GOSUB MakeNstring
  632. d                  GOSUB            
  633.   434             emco = blankemco
  634.   435             GOSUB ConvertP2G
  635. d                  GOSUB           
  636.   436             emco.CNCz = clearence
  637.   437             MID$(emco.CNCz, 1, 1) = "-"
  638. d                  MID$                       
  639.   438             emco.BlockNo = Nstring$
  640.   439             emco.Gcode = " 01":  'linear interp
  641.   440             emco.Feed = FeedRate
  642.     11-27-90 12:24:02  adi2cnc.bas                                                                                            Pg   9
  643. Thu 11-29-90 15:07:22                                                                                                         of   9
  644.                                                                                                                              441-494
  645.  
  646.   441             PRINT #2, emco.filler; emco.BlockNo; emco.Gcode; emco.CNCx; emco.CNCy; emco.CNCz; emco.Feed
  647. d                  PRINT                                                                                      
  648.   442
  649.   443
  650.   444
  651.   445             RETURN
  652. d                  RETURN
  653.   446             ' ----------
  654.   447
  655.   448 ConvertP2G:
  656.   449             ' converts adi plotter values to 1000's of inch for F1 controller
  657.   450
  658.   451             OldCNCx = emco.CNCx
  659.   452             OldCNCy = emco.CNCy
  660.   453
  661.   454
  662.   455             tempd = (px / ConversionFactor)
  663.   456             tempI = INT(tempd)
  664. d                          INT       
  665.   457             temp$ = ""
  666.   458             temp$ = STR$(tempI)
  667. d                          STR$       
  668.   459             temp$ = RTRIM$(LTRIM$(temp$))
  669. d                          RTRIM$ LTRIM$        
  670.   460         ++--SELECT CASE LEN(temp$)
  671. d                  SELECT CASE LEN       
  672.   461         |+-------CASE IS = 1
  673. d                       CASE IS    
  674.   462         ||            temp$ = "     " + temp$
  675.   463         |+-------CASE IS = 2
  676. d                       CASE IS    
  677.   464         ||            temp$ = "    " + temp$
  678.   465         |+-------CASE IS = 3
  679. d                       CASE IS    
  680.   466         ||            temp$ = "   " + temp$
  681.   467         |+-------CASE 4
  682. d                       CASE  
  683.   468         ||            temp$ = "  " + temp$
  684.   469         |+-------CASE ELSE
  685. d                       CASE ELSE
  686.   470         ||            temp$ = "~~~~~~"
  687.   471         ++--END SELECT
  688. d                  END SELECT
  689.   472             emco.CNCx = temp$
  690.   473
  691.   474             tempd = (py / ConversionFactor)
  692.   475             tempI = INT(tempd)
  693. d                          INT       
  694.   476             temp$ = ""
  695.   477             temp$ = STR$(tempI)
  696. d                          STR$       
  697.   478             temp$ = RTRIM$(LTRIM$(temp$))
  698. d                          RTRIM$ LTRIM$        
  699.   479         ++--SELECT CASE LEN(temp$)
  700. d                  SELECT CASE LEN       
  701.   480         |+-------CASE IS = 1
  702. d                       CASE IS    
  703.   481         ||            temp$ = "    " + temp$
  704.   482         |+-------CASE IS = 2
  705. d                       CASE IS    
  706.   483         ||            temp$ = "   " + temp$
  707.   484         |+-------CASE IS = 3
  708. d                       CASE IS    
  709.   485         ||            temp$ = "  " + temp$
  710.   486         |+-------CASE 4
  711. d                       CASE  
  712.   487         ||            temp$ = " " + temp$
  713.   488         |+-------CASE ELSE
  714. d                       CASE ELSE
  715.   489         ||            temp$ = "~~~~~"
  716.   490         ++--END SELECT
  717. d                  END SELECT
  718.   491             emco.CNCy = temp$
  719.   492
  720.   493             RETURN
  721. d                  RETURN
  722.   494
  723.  
  724. Thu 11-29-90 15:07:22   INDEX/Cross Reference
  725.  
  726. Format:   Page.Line
  727. Category: All identifiers
  728.  
  729.   1 11-27-90 12:24:02  adi2cnc.bas              
  730.  
  731.  
  732. #1          2=62      4=187  
  733.  
  734. #2          2.73      4.169     4.170     4.183     4.204     4.207     7.375     7.385     8.402     8.412     8.422     9.441  
  735.  
  736. .254        2.90   
  737.  
  738. blankemco             3.127     3.135     4.177     4.198     7.369     7.379     8.396     8.407     8.434  
  739.  
  740. blankemco.CNCx        3=130  
  741.  
  742. blankemco.CNCy        3=131  
  743.  
  744. blankemco.CNCz        3=132  
  745.  
  746. blankemco.Feed        3=133  
  747.  
  748. blankemco.filler      3=128  
  749.  
  750. blankemco.Gcode       3=129  
  751.  
  752. blank3      3.152     3=153  
  753.  
  754. blank4      3.150     3=151  
  755.  
  756. blank5      3.148     3=149  
  757.  
  758. blank6      3.146     3=147  
  759.  
  760. BlockNo     2.109  
  761.  
  762. clearence             2.82      8.419     8.436  
  763.  
  764. CNCx        3.111  
  765.  
  766. CNCy        3.112  
  767.  
  768. CNCz        3.113  
  769.  
  770. comma       2.77      5.244     5.245     5.246     5.251     5.253     5.254     5.257     5.258     5.267     6.279     6.282  
  771.             6.296     6.298  
  772.  
  773. ConversionFactor      9.455     9.474  
  774.  
  775. ConversionFactor#     2.90   
  776.  
  777. ConvertP2G           <9.448     8.408     8.435  
  778.  
  779. Convert2CNC          <5.232     4.192  
  780.  
  781. Thu 11-29-90 15:07:22   INDEX/Cross Reference
  782.  
  783. Format:   Page.Line
  784. Category: All identifiers
  785.  
  786.  
  787. dummy$      5=275     6=291  
  788.  
  789. emco        3.117     3=135     4=177     4=198     7=369     7=379     8=396     8=407     8=434  
  790.  
  791. emco.BlockNo          3=119     4=181     4.183     4=199     4.204     7=370     7.375     7=380     7.385     8=397     8.402  
  792.                       8=409     8.412     8=417     8.422     8=438     9.441  
  793.  
  794. emco.CNCx             3=121     4.183     4=201     4.204     6.319     6.320     7=372     7.375     7=382     7.385     8=399  
  795.                       8.402     8.412     8.422     9.441     9.451     9=472  
  796.  
  797. emco.CNCy             3=122     4.183     4=202     4.204     6.323     6.324     7=373     7.375     7=383     7.385     8=400  
  798.                       8.402     8.412     8.422     9.441     9.452     9=491  
  799.  
  800. emco.CNCz             3=123     4.183     4=203     4.204     6.327     6.328     7=374     7.375     7=384     7.385     8=401  
  801.                       8.402     8=411     8.412     8=419     8p421     8.422     8=436     8p437     9.441  
  802.  
  803. emco.Feed             3=124     4.183     4.204     7.375     7.385     8.402     8.412     8=420     8.422     8=440     9.441  
  804.  
  805. emco.filler           3=118     4.183     4.204     7.375     7.385     8.402     8.412     8.422     9.441  
  806.  
  807. emco.Gcode            3=120     4=182     4.183     4=200     4.204     7=371     7.375     7=381     7.385     8=398     8.402  
  808.                       8=410     8.412     8=418     8.422     8=439     9.441  
  809.  
  810. EmcoLine    2.107     3.117     3.127  
  811.  
  812. emcostring            3.159     3.163  
  813.  
  814. es          3.163  
  815.  
  816. es1         3.160  
  817.  
  818. Feed        2.86      3.114  
  819.  
  820. FeedRate    2.105     8.420     8.440  
  821.  
  822. filler      2.108  
  823.  
  824. Gcode       2.110  
  825.  
  826. gcodefile$            2=67      2=69      2=70      2.73   
  827.  
  828. HeaderLine1           2.94      2=95      4.169  
  829.  
  830. HeaderLine2           2.97      2=98      4.170  
  831.  
  832. Home       <7.365     7.339  
  833.  
  834. InLineCounter         2.78      5=249     5.270     6.286  
  835.  
  836. LastLine    2.100     2=101     2=102     2=103     4.207  
  837.  
  838. Thu 11-29-90 15:07:22   INDEX/Cross Reference
  839.  
  840. Format:   Page.Line
  841. Category: All identifiers
  842.  
  843.  
  844. linecount             4=173     4.214     4.219     7=347     7p349  
  845.  
  846. MakeNstring          <7.345     4.179     4.197     7.368     7.378     8.395     8.406     8.416     8.433  
  847.  
  848. MillLine   <8.431     7.336  
  849.  
  850. MoveCutterUp         <8.392     7.333  
  851.  
  852. n$          7=349     7=350     7p351     7.353     7.355     7.357  
  853.  
  854. Nstring$    4.181     4.199     7=353     7=355     7=357     7.370     7.380     8.397     8.409     8.417     8.438  
  855.  
  856. OldCNCx     3.137     3=138     6=320     7.372     8.399     9=451  
  857.  
  858. OldCNCy     3.140     3=141     6=324     7.373     8.400     9=452  
  859.  
  860. OldCNCz     3.143     3=144     6=328  
  861.  
  862. pc          3.157     5=237     6=280     6=295     7.333     7.336     7.339  
  863.  
  864. plotfile$             1=51      1=54      2p56      2=59      2.62      2p64      2.67      2p69   
  865.  
  866. PlotterLine$          4=187     5p251     5p254     5p258     6p280     6p295     6p296     6p298  
  867.  
  868. px          3.157     5=238     6=297     7.339     9.455  
  869.  
  870. py          3.157     5=239     6=299     7.339     9.474  
  871.  
  872. temp        2=56      2.58      2=64      2.66      2.69   
  873.  
  874. temp$       6=296     6p297     6=298     6p299     9=457     9=458     9=459     9p460     9=462     9=464     9=466     9=468  
  875.             9=470     9.472     9=476     9=477     9=478     9p479     9=481     9=483     9=485     9=487     9=489     9.491  
  876.  
  877. tempd       3.155     9=455     9p456     9=474     9p475  
  878.  
  879. tempI       9=456     9p458     9=475     9p477  
  880.  
  881. WriteGCode           <6.314     6.307  
  882.