02-15-2007 03:59 AM
02-22-2007 03:57 AM
Hi Gzen,
First one, it seems you are not working with LabVIEW. Which program are you working with? Measurement Studio for VB, C#, C++, .NET ?
Second one, it seems that you are not giving a timing inside your program. Am I correct? And the problem you mentionned above could appear! Let's me explain : If you are not providing time in your programmation. The program will execute your code as fast as possible un-regarding of your User Interface refresh ! Most of the CPU will be taken by the execution of your code and when your CPU has the possibility, it updates/refreshes the User Interface.
Third one, for the value multiply by two, I don't know what happens to your program... ![]()
Regards,
02-22-2007 05:07 AM
Dear Julien,
Thanks for your reply.
Sorry I forget to give much information. It’s programmed in VB6 and I’m using the DAQmx API. The card is a DAQPAd 6015.
The code for the frequency channel is the following:
-DAQmxErrChk DAQmxCreateTask("", taskhandle2)
-DAQmxErrChk DAQmxCreateCIFreqChan(taskhandle2, "DEV1/ctr0", "", 2, 50000, DAQmx_Val_FrequencyUnits3_Hz, DAQmx_Val_Edge1_Rising, DAQmx_Val_CounterFrequencyMethod_LowFreq1Ctr, 0.05, 4, "")
In a timer (at 0.05s) I use the following:
-DAQmxErrChk DAQmxReadCounterScalarF64(taskhandle2, 0.01, dataF, ByVal 0&)
In the same time I have a second task using the analog channel configured like this:
- DAQmxErrChk DAQmxCreateAIVoltageChan(taskHandle, "Dev1/ai0", "", _DAQmx_Val_Cfg_Default, 0, 10, DAQmx_Val_VoltageUnits1_Volts, "")
- DAQmxErrChk DAQmxCfgSampClkTiming(taskHandle, "OnboardClock", 20, DAQmx_Val_Rising, DAQmx_Val_AcquisitionType_ContSamps, 1)
And I do the following items in a loop :
- DAQmxReadAnalogF64 taskHandle, numSampsPerChannel, 10#, fillMode, data(0), arraySizeInSamps, sampsPerChanRead, ByVal 0&
- Doevents (to allow the timer to refresh the frequency value)
- I save the value of the analog channel and frequency channel into memory.
When test is finished (max 10sec), I save the values from the memory to a file. For the analog channel there are no problems, just for the frequency channel, I get the value change only every three data.
Best regards,
Greg