2.5.9 EvenSampling


Description

Sample rate of the column

Syntax

VB: Property Get EvenSampling As String
C++: LPCSTR EvenSampling
C#: string EvenSampling

Parameters

Remark

Examples

VBA

Connect to the running Origin. Set the interval of samples in Column(0) as 20ms, and send data to the column. You can see the result in Origin. Then, Get the sample rate of the column and output it.

Public Sub SetEvenSampling()
    Dim app As Origin.ApplicationSI
    Dim Wks As Origin.Worksheet
    Dim Data(1 To 100) As Double
    Dim ii As Integer
    For ii = 1 To 100
        Data(ii) = ii * 0.12 + 3.75
    Next
 
    Set app = New Origin.ApplicationSI
    Set Wks = app.FindWorksheet("")
 
    'Set a time line, which unit is ms, starting from 0 and sample interval is 20 ms, and display format is default
    ii = Wks.Columns(0).SetEvenSampling(0, 20, "ms", "Time", "")
 
    'Send data to the column
    Wks.Columns(0).SetData (Data)
 
    'Get the sample rate of the column, and output it to the Excel sheet
    Range("A1") = Wks.Columns(0).EvenSampling
 
End Sub

C#

Using Origin;
static void SetEvenSampling()
{
    double[] Data = new double[100];
    for (int ii = 0; ii < 100; ii++)
    {
        Data[ii] = ii * 0.12 + 3.75;
    }

    Origin.ApplicationSI app = new Origin.ApplicationSI();
    Worksheet wks = app.FindWorksheet("");

    //Set a time line, which unit is ms, starting from 0 and sample interval is 20 ms, and display format is default
    wks.Columns[0].SetEvenSampling(0, 20, "ms", "Time", "");

    //Send data to the column
    wks.Columns[0].SetData(Data, 0);

    //Get the sample rate of the column, and output it to console
    Console.WriteLine(wks.Columns[0].EvenSampling);

    Console.ReadLine();

}

Version Information

8.0SR2

See Also

SetEvenSampling | SetData