Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

What format is the variable ScaledData?

Is it possible to convert the ScaledData variable to an integer or double? How does it contain the actual data voltage (array/type). How do I "extract" a number (which is the current voltage) out of ScaledData? Thanks!
0 Kudos
Message 1 of 2
(3,366 Views)
Alok,

I'm not sure which function you are referring to. But the AcquiredData function returns the ScaledData parameter. This parameter is an array of doubles, but it is returned as a Variant. A short example of this function follows:

Private Sub RunAcquisition_Click()
Dim Voltages As Varinat
Dim BinaryCodes As Variant

CWAI1.Configure
'Set timeout to 5 seconds
CWAI1.AcquireData Voltages, BinaryCodes, 5
CWGraph1.PlotY Voltages
End Sub

As you can see, Voltages is a Variant, but when AcquiredData is called, it returns all the numbers that were acquired into the Voltages Variant (really, an array of doubles). To extract a number you just type
Voltages(index) and that should give the number you need.


Best Regards,

Azucena Perez
Product Support Engineer
Nat
ional Instruments
0 Kudos
Message 2 of 2
(3,366 Views)