Sensoray 421 Manual do Utilizador Página 24

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 27
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 23
Page 22 Sensoray Model 421 Instruction Manual
A/D Interface Procedure
FUNCTION Digitize% (Chan%)
‘****************************************************************************
‘ Digitize one 421 analog input channel.
‘ Imports:
Chan% = A/D input channel in the range 0:7.
‘ Exports:
Digitize% = digitized value in the range 0:4095.
‘****************************************************************************
CONST BZ = 2 ‘ Status register mask: “A/D busy” flag
OUT CHCTRL, Chan% AND 7 ‘ Select analog input channel
‘ NOTE: you may need to insert a settling time delay here, depending on your programming
‘ language and processor speed.
OUT ADSTART, 0 ‘ Digitize the input
DO: LOOP WHILE INP(STATUSPORT) AND BZ ‘ Wait for A/D to finish
loResult% = INP(ADLSB) ‘ Read the digitized result
hiResult% = INP(ADMSB)
Digitize% = loResult% + 256 * (hiResult% AND &HF) ‘ Package result for function return
END FUNCTION
Board Reset Procedure
SUB reset421 ()
‘****************************************************************************
‘ Invoke 421 soft reset.
‘****************************************************************************
OUT RESETPORT, 0 ‘ Reset 421 board
chctrlImage% = 0 ‘ Initialize CHCTRL output port image
For i% = 0 To 2 ‘ Initialize relay images
relay%(i%) = 0
Next i%
END SUB
Vista de página 23
1 2 ... 19 20 21 22 23 24 25 26 27

Comentários a estes Manuais

Sem comentários