Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

multi counter PCI 6602 daqmx semi period measurement

Solved!
Go to solution

PS: I looked at your VI that you created called Cal Frequency and duty Cycle1.vi and I thought that was a really cool VI. I think that is very clever and I think other poeple could benefit from that as well. I would really encourage you to post that as an example program on our community site, so everyone can utilize your tricks. To post your code, all you have to do is to go to ni.com/community and make sure you're logged in. Then at the top of the page you can select "New>>Document" and then select "Example Program" when the menu comes up. It's extremely easy and would help everyone out. 

 

Just thought I'd mention it. Thanks.
0 Kudos
Message 21 of 26
(2,277 Views)

Hi Chris,

 

First thanks for you spent a lot of time helping me out. The reason, I have so many tasks because my project is 20 channels PWM signal. I started 2 channels because I want to see it works or not.

 

Thank you so much again!

 

Johnny

0 Kudos
Message 22 of 26
(2,255 Views)

Hello,

I've following project: Read 2 counters with PCI 6602 and daqmx and make period measurement. I think its very similar to this topic. But I need c# code.

Can anybody help me?

 

Thanks André

0 Kudos
Message 23 of 26
(2,217 Views)

You can follow the same basic form of the LabVIEW code that we have been passing back and forth. You'll simply have to use the DAQmx C Reference Help to translate the VIs to C functions. They map 1 to 1. You can find your C reference help if you go to Start>>Programs>>National Instruments>>NI-DAQ>>Documentation>>NI-DAQmx C Reference Help. Have fun!

 

Chris

0 Kudos
Message 24 of 26
(2,214 Views)

Thank you for your Reply.

I'm understanding right: The buffer is configured that it can hold 1000 samples. And the there are 100 reading operations with 10 samples each ?

My Question is: How can realize the coresponding callback function in C#? 

Something like that:

 

myCounter.BeginReadMultiSampleDouble(10,Callback,null)

Callback()

{

  data= .myCounter.EndReadMultisampleDouble() //Saving data

 myCounter.BeginReadMultiSampleDouble(10,Callback,null);

}

 

Thanks

andré

0 Kudos
Message 25 of 26
(2,194 Views)

Hi Andre,

 

This type of callback is realized in the following example: "Meas2EdgeSeparation_BufCont"

 

You can find this C# example in the following folder location, if you have NI-DAQmx installed with support for .NET.

 

C:\Documents and Settings\All Users\Documents\National Instruments\NI-DAQ\Examples\DotNET<X.X>\Counter\Measure 2 Edge Separation\Meas2EdgeSeparation_BufCont\cs

 

This example uses an asynchronous callback function to retrieve the data and display it on the UI. You can modify the code to save the data to a file or anything else you'd like to do in that callback. I hope this helps.

 

Chris W

0 Kudos
Message 26 of 26
(2,154 Views)