我这有份程序在机器上测试时不显示当前真空度,请大家看看
DECLARE SUB rotation1 (position!, whichstep!)
DECLARE SUB SS1 (position!, timech!, vacum!, current!, stdfreq!, bias!, whichstep!, wtrota!, bias1!, curr1!, bias2!, curr2!, statec)
DECLARE SUB SS ()
DECLARE SUB adjust ()
DECLARE SUB dzkdmea ()
DECLARE SUB nzkdmea (vacum!, kh$, to$, va4!)
DECLARE SUB menu ()
DECLARE SUB fangqi ()
DECLARE SUB guanji ()
DECLARE SUB calstep1 (band&, stdfreq!, steps!)
DECLARE SUB calstep2 (band&, stdfreq!, steps!)
DECLARE SUB cgo (stdfreq!, position!, current!, bias!, statec)
DECLARE SUB hand (statec)
DECLARE SUB plcj (statec!)
DECLARE SUB measure (position!, stdfreq!, bias!, powerlevel!, stdres!, whichstep!)
DECLARE SUB sstep (position!, stdfreq!, bias!, stdres!, whichstep!)
DECLARE SUB cimsetup (stdfreq!, powerlevel!)
DECLARE SUB autorun (position!, timech!, vacum!, current!, stdfreq!, bias!, whichstep!, wtrota!, bias1!, curr1!, bias2!, curr2!, statec)
DECLARE SUB yuzh (stdfreq!, bias!, timech!, vacum!, current!, position!, powerlevel!, wtrota!, bias1!, curr1!, bias2!, curr2!, stdres!)
DECLARE SUB paraset (position!, timech!, vacum!, current!, stdfreq!, bias!, powerlevel!, wtrota!, bias1!, curr1!, bias2!, curr2!, stdres!)
DECLARE SUB rtpre (wtrota!, bias1!, curr1!, bias2!, curr2!)
DECLARE SUB freqmea (stdfreq!, bia, position!, whichstep!, cur, ke1$, f0!, quan!, kh$)
DECLARE SUB freqmea2 (stdfreq!, bia, position!, whichstep!, cur, ke1$, f0!, quan!, kh$)
DECLARE SUB freqmea1 (stdfreq!, bia, position!, whichstep!, cur, ke1$, f0!, quan!, kh$)
DECLARE SUB motorstep (whichstep!)
DECLARE SUB dif (statec!)
DECLARE SUB dzkf (statec!)
DECLARE SUB gzkf (statec!)
DECLARE SUB db (statec!)
DECLARE SUB zkfqf (statec!)
DECLARE SUB zkmea (statec!)
DECLARE SUB qjf (statec!)
DECLARE SUB countff (res#, freQ#)
DECLARE SUB countff1 (res#, freQ#)
DECLARE SUB countff2 (res#, freQ#)
DECLARE SUB rotation (position!, whichstep!)
DECLARE SUB cimdsetup (stdfreq!, powerlevel!)
DECLARE SUB frepre (stdfreq!, bias!, powerlevel!, stdres!)
DECLARE SUB countf (res#, freQ#)
DECLARE SUB calstep (band&, reffreq!, steps!)
DECLARE SUB DELAY40 (timech)
DECLARE SUB zkdmea (vacum, kh$, go$)
DECLARE SUB timepre (timech!)
DECLARE SUB zkdpre (vacum!)
DECLARE SUB dlpre (current!)
DECLARE SUB gwpre (position!)
DECLARE SUB delay ()
DECLARE SUB new (position)

COMMON SHARED portA8255, portB8255, portC8255, addr8255, statec, current, bias
COMMON SHARED portA, portb, portc, addr82552, addr0832, vacum, cur, bia, wtrota
COMMON SHARED ch08253, ch18253, ch28253, addr8253, state164, bias1, curr1
COMMON SHARED ch082532, ch182532, ch282532, addr82532, bias2, curr2
CLS
portA8255 = &H260
portB8255 = &H261
portC8255 = &H262
addr8255 = &H263

portA = &H26C    'The second 8255 address
portb = &H26D
portc = &H26E
addr82552 = &H26F

addr0832 = &H268

ch08253 = &H264    'The first 8253 address
ch18253 = &H265
ch28253 = &H266
addr8253 = &H267

ch082532 = &H270    'the second 8253 address
ch182532 = &H271
ch282532 = &H272
addr82532 = &H273
OUT addr82532, &H32    'mode 0
OUT addr82532, &H74    'mode 2
OUT addr82532, &HB2    'mode 1 PWM
OUT addr8253, &H30    'initialize 8253 channel 0
OUT addr8253, &H70    'initialize 8253 channel 1
OUT addr8253, &HB0    'initialize 8253 channel 2
bias1 = 100
curr1 = 2
stdres = 30
wtrota = 1   '微调圈数
position = 72   '工位数
timech = 40   '抽低真空时间(秒)
vacum = 1   '低真空度(X10-2)
current = 1   '蒸发电流
stdfreq = 1200000    '标称频率(HZ)
bias = 10   '偏差(PPM)
bias2 = 80
curr2 = 2
ON ERROR GOTO Handler
OPEN "wwtj.dat" FOR INPUT AS #1
INPUT #1, position, timech, vacum, current, stdfreq, bias, powerlevel, wtrota, bias1, curr1, bias2, curr2, stdres
CLOSE #1
nofile:      '

OUT addr82552, &H90    'initialize 82552: port A as input, B. C as output
OUT addr8255, &H92

OUT portC8255, &HFF
OUT portb, &HF0
statec = &HFF
OUT portc, statec

CLS
LOCATE 20, 30
PRINT "Please waiting......"
statec = &HFE
OUT portc, statec  '除前级阀外,为关断
whichstep = 1   '电机为A相
COLOR 14, 1

menu1:      '
      CLS
      LOCATE 3, 20
      PRINT "微调机操作主菜单"
      LOCATE 7, 23
      PRINT "1----标称频率设置"
      LOCATE 8, 23
      PRINT "2----震荡器标晶频率校正"
      LOCATE 9, 23
      PRINT "3----自动工作"
      LOCATE 10, 23
      PRINT "4----测头工位调整"
      LOCATE 11, 23
      PRINT "5----晶体测量"
      LOCATE 12, 23
      PRINT "6----放气"
      LOCATE 13, 23
      PRINT "7----手动测频"
      LOCATE 14, 23
      PRINT "8----手动清洗"
      LOCATE 15, 23
      PRINT "9----请按操作规程关机"
      LOCATE 18, 20
      PRINT "请输入选择(1-9):"
             
       DO
      statec = &HFE
      OUT portc, statec
      'CALL SS1(position!, timech!, vacum!, current!, stdfreq!, bias!, whichstep!, wtrota!, bias1!, curr1!, bias2!, curr2!, statec)
      portA = &H26C
      portb = &H26D
      portc = &H26E
      addr82552 = &H26F
 
   DIM sa AS INTEGER
   sa = 0
   sa = INP(portA)

      func$ = INKEY$
    'portb = &H26D
    'portc = &H26E
    'addr82552 = &H26F
      IF func$ = "0" THEN
      FOR i = 1 TO 360 * 8 / position * 8
      FOR j = 0 TO 900
      s = 0
      NEXT j
      OUT portb, &H1
      FOR k = 1 TO 900
      s = 0
      NEXT k
      NEXT i
      END IF
    
      LOOP UNTIL func$ <> "" OR sa = 13        '27 is the ASCII code for Esc.
      cansh1 = VAL(func$)
      'IF func$ = "0" OR func$ = CHR$(27) THEN GOTO exit1
      IF cansh1 = 5 THEN CALL measure(position, stdfreq, bias, powerlevel, stdres, whichstep)
      IF cansh1 = 1 THEN CALL paraset(position, timech, vacum, current, stdfreq, bias, powerlevel, wtrota, bias1, curr1, bias2, curr2, stdres)
      IF cansh1 = 4 THEN CALL motorstep(whichstep)
      IF cansh1 = 6 THEN CALL fangqi
      IF cansh1 = 9 THEN CALL guanji
      IF cansh1 = 8 THEN CALL new(position)
      IF cansh1 = 2 THEN CALL adjust
      IF cansh1 = 7 THEN CALL sstep(position, stdfreq, bias, stdres, whichstep)
      IF cansh1 = 3 THEN
      CLS
      LOCATE 23, 15
      INPUT "确认要进行自动操作,请按(*)键 "; fu$
      IF fu$ = "*" THEN CALL autorun(position, timech, vacum, current, stdfreq, bias, whichstep, wtrota, bias1, curr1, bias2, curr2, stdres)
      IF sa = 13 THEN CALL autorun(position, timech, vacum, current, stdfreq, bias, whichstep, wtrota, bias1, curr1, bias2, curr2, stdres)
      END IF
     GOTO menu1
END

Handler:
     SELECT CASE ERR
      CASE 53
      RESUME NEXT
      CASE ELSE
      RESUME
    END SELECT