
44 Chapter 5 Documentation Number UD128A8D4602 Manual
B&B Electronics Mfg Co – 707 Dayton Rd - PO Box 1040 - Ottawa IL 61350 - Ph 815-433-5100 - Fax 815-433-5104
B&B Electronics Ltd – Westlink Comm. Pk. – Oranmore, Galway, Ireland – Ph 353-91-792444 – Fax 353-91-792445
Analog Input Configuration
Device1.IoPoints(AD_0).Configuration = AD_12BIT_SE
‘ \ Set AD0 to a single-ended input.
Device1.IoPoints(AD_0).Configuration _ =
AD_12BIT_DIFF
‘ \ Set AD0 and AD1 differential input + and - respectively.
For X = 0 To 7
‘ \ Set all inputs to Single Ended inputs
Device1.IoPoints(AD_0 + X).Configuration _
= AD_12BIT_SE
Next X
Analog Output Configuration
Device1.IoPoints(DA_0).Configuration = DA_10BIT
For X = 0 To 3
‘ \ Enable all D/A Outputs
Device1.IoPoints(DA_0 + X).Configuration _
= DA_10BIT
Next X
Reading Analog I/O Points
Reading or Setting an I/O point uses the Value property.
The A/D channel Value property is Read Only and returns the
reading in counts.
Dim Reading as Long
Reading = Device1.IOPoints(AD_0).Value
‘ \ Reading is a count from 0 to 4095. Value is +Vref/4096
With a 12-bit A/D there are 4096 possible values compared to the
reference voltage. The value of each step depends on the reference
voltage, the normal preset is 5 volts. Volts per step is 5.000/4096, or
5000mV/4096, about 1.2207mV, this value was adjusted and used
with rounding for 0 volts at counts of 0 and 5 volts at 4095.
Commenti su questo manuale