DataqFile Controls > ReadDataqFile > Methods > GetData

Previous | Next

GetData

Applies to:

READDATAQFILE Active X Control

Description:

This function returns the specified amount of data back in variant form (e.g., in order to plot data in a chart). There are two parameters for this function:

The first parameter sets the number of channel scans to be returned. One scan is defined as one pass through all enabled channels (i.e., one sample per channel). This value must be between 1 and 32,767.

The second parameter defines the format of the data returned. Valid settings are: 0 for 2’s complement binary data (FormatBinary); and 1 for data scaled in engineering units (FormatScaled).

Syntax:

variant=ReadDataqFile1.GetData(count,method) (where count is an Integer between 1 and 32,767 and method is either 0 (FormatBinary) or 1(FormatScaled))

Variables:

Integer

Example:

Dim V As Variant

 

Private Sub Exit_Click()

ReadDataqFile1. Close

End

End Sub

 

Private Sub Form_Load()

ReadDataqFile1. Open

'the following lines of code allow extraction of information from a variant - see How to Extract Information from a Variant

V = ReadDataqFile1.GetData(DQChart1. Xmax, FormatBinary)

cn = UBound (V, 1)

pts = UBound (V, 2)

ReDim Channel1(0, 0 To pts) As Integer

For i = 0 To pts

    Channel1(0, i) - V(0, i)

Next

DQChart1. Chart (Channel1)

DQChart2. Chart (V)

End Sub

 

Private Sub MoveRight_Click()

ReadDataqFile1. MoveTo DQChart1. Xmax, 1

V = ReadDataqFile1.GetData(DQChart1. Xmax, FormatBinary)

cn = UBound (V, 1)

pts = UBound (V, 2)

ReDim Channel1(0, 0 To pts) As Integer

For i = 0 To pts

    Channel1(0, i) - V(0, i)

Next

DQChart1. Chart (Channel1)

DQChart2. Chart (V)

End Sub

 

Private Sub MoveLeft_Click()

ReadDataqFile1. MoveTo -DQChart1. Xmax, 1

V = ReadDataqFile1.GetData(DQChart1. Xmax, FormatBinary)

cn = UBound (V, 1)

pts = UBound (V, 2)

ReDim Channel1(0, 0 To pts) As Integer

For i = 0 To pts

    Channel1(0, i) - V(0, i)

Next

DQChart1. Chart (Channel1)

DQChart2. Chart (V)

End Sub

 

Reference Materials | Top