DataqSdk Control > Properties > SampleRate

Previous | Next

SampleRate

Applies to:

DATAQSDK 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.

This property is over written whenBurstCounter and ADCounter are set. When it is absolutely necessary to achieve a specific sample rate you must use BurstCounter and ADCounter properties. SampleRate must be less than MaxBurstRate divided by the number of channels. Default is 1000. When SampleRate and MaxBurstRate are set in your program, DataqSdk sets ADCounter and BurstCounter. If you set ADCounter and BurstCounter, it overwrites SampleRate based on the formula as displayed in BurstCounter. Use either SampleRate and MaxBurstRate OR, for devices other than the DI-1100, DI-1110, DI-1120, DI-2008, DI-245, DI-2108, DI-2108-P, DI-4108, DI-4208, and DI-4718B ADCounter and BurstCounter.

Note: ADChannelCount and ADChannelList must be called before changing SampleRate for DI-1100, DI-1110, DI-1120, DI-2008, DI-245, DI-2108, DI-2108-P, DI-4108, DI-4208, and DI-4718B instruments.

Syntax:      

DataqSdk1.SampleRate=variable (where variable is a number between 1 and MaxBurstRate)

Variable:

Double

Example:

Private Sub DataqSdk1_ NewData(ByVal Count As Integer)

DQChart1. Chart (DataqSdk1. GetData)

End Sub

 

Private Sub Start_Click()

DataqSdk1. EventPoint = 20

'sample rate is set to 2000 - try to sample data at that rate

DataqSdk1.SampleRate = 2000

DataqSdk1. Start

'outputs the actual sample rate which could be different than SampleRate

Label1.Caption = Format(DataqSdk1.SampleRate, "0.00")

End Sub

 

Private Sub Stop_Click()

DataqSdk1. Stop

End Sub

 

Reference Materials | Top