DataqFile Controls > ReadDataqFile > Methods > MoveTo

Previous | Next

MoveTo

Applies to:

READDATAQFILE Active X Control

Description:

Moves the file pointer within a WinDaq file. The pointer moves on a scan-by-scan basis where scan is defined as one pass through all enabled channels. The pointer is located at the leftmost position on the chart. There are two parameters for this function:

The first parameter is the offset and is limited by the number of scans in the file. If the offset is a positive number, the pointer will move forward in time. If the offset is negative, the pointer will move backward.

The second parameter is the reference (i.e., point of origin, where to offset the pointer from). A value of 0 would offset from the beginning of the file. A value other than 0 offsets from the current position.

If you wish to see a visual representation you must also re-plot the data every time you move the pointer.

To convert to seconds, use the SampleRate. For example, if the SampleRate is 1000 samples per second and you would like to move 2 seconds into the file use 2000 as the offset and 0 as the origin.

Syntax:

ReadDataqFile.MoveTo(offset,origin) (where offset is where to move in data points to and origin is where to move from in data points)

Variables:

Offset is long and origin is short

Example:

Private Sub CloseFile_Click()

ReadDataqFile1. Close

End

End Sub

 

Private Sub Form_Load()

ReadDataqFile1. Open

DQChart1. Chart (ReadDataqFile1. GetData(DQChart1. Xmax, FormatBinary))

End Sub

Private Sub Move10Backward_Click()

'this moves 10 to the left from the current position

ReadDataqFile1.MoveTo -10, 1

plot

End Sub

 

Private Sub Move10Forward_Click()

'this moves 10 to the right from the current position

ReadDataqFile1.MoveTo 10, 1

plot

End Sub

 

Private Sub MoveHalfChartWidthForward_Click()

'this moves one-half chart-width to the right from the current position

ReadDataqFile1.MoveTo (0.5 * DQChart1. Xmax), 1

plot

End Sub

 

Private Sub MoveHalfChartWidthBackward_Click()

'this moves one-half chart-width to the left from the current position

ReadDataqFile1.MoveTo (0.5 * -DQChart1. Xmax), 1

plot

End Sub

 

Private Sub MoveChartWidthForward_Click()

'this moves one chart-width to the right from the current position

ReadDataqFile1.MoveTo DQChart1. Xmax, 1

plot

End Sub

 

Private Sub MoveChartWidthBackward_Click()

'this moves one chart-width to the left from the current position

ReadDataqFile1.MoveTo -DQChart1. Xmax, 1

plot

End Sub

 

Private Sub MoveToBeginning_Click()

'this moves to the beginning of the file

ReadDataqFile1.MoveTo 0, 0

plot

End Sub

 

Private Sub MoveToEnd_Click()

'this moves one chart-width from the end of the file (i.e., the rightmost point on the chart is the last point in the file)

ReadDataqFile1.MoveTo ReadDataqFile1. TotalDataPoints - DQChart1.Xmax, 0

plot

End Sub

 

Private Sub plot()

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

DQChart1. Chart (v)

Label1.Caption = ReadDataqFile1. CurrentLocation

End Sub

 

Reference Materials | Top