08-09-2007 08:58 AM
DAQmxErrChk (DAQmxCreateAIVoltageChan(taskHandle,"Dev1/ai0","RPM",DAQmx_Val_RSE ,0,32000,DAQmx_Val_FromCustomScale,UnitsArray[1])); // Assuming am trying to read RPM channel for RSE, RPM ranges from 0 to 32000//
DAQmxErrChk (DAQmxCreateAIVoltageChan(taskHandle,"Dev1/ai1","Pressure",DAQmx_Val_RSE ,2000,50000,DAQmx_Val_FromCustomScale,UnitsArray[2]));
and so on....
Thank you very much for your help.
08-09-2007 12:31 PM
Also, I failed to mention that i am using an encoder for the RPM. I want to be able to measure RPM, degrees, pressure...etc. This makes me think that I should be configuring a counter channel instead of voltage channel. I think measuring positions should give me an insight about the degrees situation... Let me know what you think of how I might configure the channels /
Thanks again
08-10-2007 03:32 PM
08-10-2007 08:02 PM
08-15-2007 11:08 AM
Hello Matt,
I still can't seem to read the data in the data array with all the examples in the C directory. It doesn't matter what example I do, counter, freq, pulse, voltage, I do read the number of samples, but not the data array itself. I get 0 for data array, I did make sure I am using correct format %d, %f...etc. The freq counter examples seem to hang on waiting forever, and I have to reboot to get out of it. Even though when I create a task using the MAX tool, I can't get it to display measured values. However, the test panel works, it does count up fine, so I know the transdeucer and encoder are hooked up right. Could it be the version am using? (NIDAQmx 8.5 on Vista Ultimate)
Thanks
08-16-2007 10:41 AM
NewBe,
If you have a support contract, you may call in and talk to one on the application engineers. We all have the same knowledge and will be able to help you with the issue.
As for not being able to read in the data, DAQmx 8.5 should be fine, as this is aCan you please tell me which shipping example you are using?
I will take a look at it on a
08-16-2007 10:53 AM
Hi Dave,
I am using 16E-4 card. Could you tell me how can i get the VC++ examples, everytime I download the drivers, it comes with the ANSI C examples, not the C++ ones. What's the trick to getting the C++ examples? During Installation, I tried installing Measuremant and atuomation C++2005, it said that I have to have Measurmeant and studio 2005 installed already.
As for the edge count example, i am still having problem getting that example to work. I can get the #of samples, but when I look inside the data array, its zeros.
Thanks
08-16-2007 11:27 AM
08-16-2007 05:44 PM
NewBe,
The error is correct, in that you need Measurement Studio 8.0 or later to have these support and examples installed. I would refer back to Matt’s original post. Can you please post the part of code you are using to read the counter, and the code which is used to print out the array?
08-17-2007 08:27 AM
Hello Dave,
I can live with C examples. The problem I am having is getting the counters to work. In my application, I need to measure RPM of spinning encoder, so I think I need to have a counter with PFI7 (sample clk) as a time base and counter with (PFI4) to count once per revolution. I have to count for 2 stroke (360) and 4 stroke(720). I also need to measure degrees. I am not too sure as of yet of how to accomplish that, but I figured by getting the counters to work. I was able to read voltage fine. The counter examples provided in C, spit out the # of samples read, but shouldn't I be able to look at the data count. Also, if you could provide an explanation of how you might accomplish the above would be greatly appreciated. Angular position calls are not supported in my card. One of the examples I can't get to workk is:
DAQmxErrChk (DAQmxCreateCICountEdgesChan(taskHandle1,"Dev1/ctr0","",DAQmx_Val_Falling,0,DAQmx_Val_CountUp));
DAQmxErrChk (DAQmxCfgSampClkTiming(taskH1andle,"/Dev1/PFI4",1000,DAQmx_Val_Falling,DAQmx_Val_ContSamps,1000));
DAQmxErrChk (DAQmxStartTask(taskHandle1));
while(1)
DAQmxErrChk (DAQmxReadCounterU32(taskHandle1,1000,10,data,1000,&read,NULL));
printf("Samples=%d",read); // this gives me 1000 samples when encoder is spining
for(int i=0;i<read;i++)
{
printf("%u or %f,data[i]); // this data is zero
fflush(stdout);
}
Shouldn't the data array be holding the data count, so I can i use it as a time reference or latch the data according to the count?
Thanks