Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

c# measurement

Hello,

 

I use following timer counter analyzer.

Brand: Pendulum
Model: CNT-90 Incl. Option 30 Built in.
Firmware revision: V1.28

 

I develop c#.net application for communication with cnt-90 device.You can see below an example part of c# code for measurement.

        [DllImport("visa32.dll")]
        static extern int viOpenDefaultRM(out int rm);
        [DllImport("visa32.dll")]
        static extern int viOpen(int rm, string ResourceName, int viAccessMode, int TimeOut, out int vi);
        [DllImport("visa32.dll")]
        static extern int viClose(int vi);
        [DllImport("visa32.dll")]
        static extern int viRead(int vi, byte[] buffer, int count, out int retCount);
        [DllImport("visa32.dll")]
        static extern int viWrite(int vi, string buffer, int count, out int retCount);

public Measure_Frequency()
{
            byte[] Buffer = new byte[255];
            string Command = ":MEASure:FREQuency?";

            int status;

            status = viWrite(vi, Command, Command.Length, out RetCout);
            if (status != 0)
            {
                error = "viWrite error!";
                return;
            }

            status = viRead(vi, Buffer, 255, out RetCout);
            if (status != 0)
            {
                error = "viRead error!";
                return;          
            }
          
    // received Buffer assessment procedures
.
.
.
.

}

I communicate with usb port for measurement with cnt-90.When I take a single measurement with our above Measure_Frequency function, there is no problem.But whenI take consecutive six sample measurement with our above Measure_Frequency function some values coming out of bounds.

I receive measurement data from the device with the above example.This is a correct method?
What are your suggestions in this regard?
Thanks in advance.

0 Kudos
Message 1 of 2
(6,371 Views)

Hi Liptolip

 

What is exactly what you want to do measure continuously or measure the frequency on the call of the function?

 

Have you check the C# examples that you should have in your PC when you install the DAQmx drivers here is a link with more information.

 

Text Based NI-DAQmx Data Acquisition Examples

 

 

Regards

Esteban R.

0 Kudos
Message 2 of 2
(6,340 Views)