'========== A-626 Example program -1 ============
'             Uipolar mode +/-10 V
'             Write by Richard Chaen
'             Date: 10.30.1996
'================================================

CLS
bas = &H2C0                            ' set I/O address

INPUT " Select D/A Channel (0-5):"; ch
INPUT " Output Voltage (+/-10V):"; VO    ' Input a Value

VODATA = (VO * 2058 / 10) + 2048             ' Conversion 12 Bit Data

msb = FIX(VODATA / 256)
lsb = FIX(VODATA - (msb * 256))

OUT bas + ch * 2, msb                  ' output data to D/A Channel
OUT bas + ch * 2 + 1, lsb              ' MSB Data First then LSB

END



