
Documentation Number UD128A8D4602 Manual Chapter 5 49
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
Dim Ain0 As BDaq.BBIoPoint
Set Ain0 = Device1.IOPoints(AD_0)
Now any property or method that used to be addressed by
Device1.IOPoints(AD_0) can be directly addressed by ain0.
Dim Reading as Long
Reading = Ain0.Value
This would produce the same result as:
Dim Reading as Long
Reading = Device1.IOPoints(AD_0).Value
Hardware Timed Reading of Analog Inputs
Any number of Analog Input I/O Points can be read based on a
single sampling period. To configure a Device to do timed sampling:
‘ \ 1. Set each Analog Input I/O Point for Single-Ended or Differential
as needed through it’s Configuration property.
Device1.IOPoints(AD_0).Configuration = AD_12BIT_SE
‘ \ 2. Add the I/O Point to the list of sampled I/O Points by setting its
SamplingEnabled property to True.
Device1.IOPoints(AD_0).SamplingEnabled = True
‘ \ 3. Set the time between samples by setting the Device’s
SamplingInterval property. The SamplingInterval property is in
seconds
.
Device1.SamplingInterval = 0.006
‘ \ This sets sampling all enabled channels every 6 milliseconds.
‘ \ 4. Start the sampling by setting the Device’s SamplingEnabled
property to True. Stop sampling when needed by setting to False
Device1.SamplingEnabled = True
Device1.SamplingEnabled = False
‘ \ 5. Wait for the Device’s OnDataAvailable event.
Private Sub Device1_OnDataAvailable()
‘\ get the data here
End Sub
When the OnDataAvailable event occurs, get the data. Do this using
the GetSamples method for the Device.
Kommentare zu diesen Handbüchern