DataqSerial Control > Properties > SampleRate

Previous | Next

SampleRate

Applies to:

DATAQSERIAL Active X Control

Description:

The sample rate determines how fast the sampled data is reported per channel. When you specify a sample rate, an attempt is made to report data at that sample rate. When this is not possible, the data will be reported at the closest achievable rate to the sample rate you requested. The actual sample rate can then be read.

Syntax:

DataqSerial1.SampleRate=variable (where variable is the attempted sample rate)

Variable:

Double

Example:

Private Sub Start_Click()

'attempt a sample rate of 100 samples per second

DataqSerial1.SampleRate = 100

DataqSerial1. EventLevel = 20

DataqSerial1. Start

'output the actual sample rate

Label1.Caption = DataqSerial1.SampleRate

'since the sample rate is a decimal number that potentially could reach a high amount of decimal places, it makes sense to format the output and limit the value to two decimal places:

'Label1.Caption = Format(DataqSerial1.SampleRate, "0.00")

End Sub

 

Private Sub Stop_Click()

DataqSerial1. Stop

End Sub

 

Private Sub DataqSerial1_ NewData (ByVal Count As Integer)

DQChart1. Chart (DataqSerial1. GetData)

End Sub

 

Reference Materials | Top