LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

PWM measurements using the 6071E

Hi,
 
I am trying to measure both frequency and duty cycle of a signal using one of the PCI 6071E counters. I am using the semiperiod measurements and I already got an array of values but cannot determine which of those is the hi values and which is the low. I read I can set the DAQmx_CI_SemiPeriod_StartingEdge property to DAQmx_Val_Rising, but is not working. I am getting the following message "DAQmx_CI_SemiPeriod_StartingEdge is not supported on your device". However, in the Register Programming Manual for the 6071E is clearly stated that is possible to select the polarity of the channel.
 
This is my code:
 
 DAQmxErrChk (DAQmxCreateTask("", TaskHandlePtr));
 DAQmxErrChk (DAQmxCreateCISemiPeriodChan(*TaskHandlePtr, Channel, "", MinVal, MaxVal, DAQmx_Val_Seconds, ""));
 DAQmxErrChk (DAQmxCfgImplicitTiming(*TaskHandlePtr,DAQmx_Val_ContSamps,2));
 DAQmxErrChk (DAQmxSetChanAttribute(*TaskHandlePtr,"",DAQmx_CI_SemiPeriod_StartingEdge,DAQmx_Val_Rising));
 
Any ideas ?
 
 
0 Kudos
Message 1 of 3
(3,068 Views)
Hello PacSoft,

The NI-DAQmx driver does not support setting the DAQmx_CI_SemiPeriod_StartingEdge property for E-Series devices.  Where in the Register Level Programming (RLP) manual did you see that you could set the starting edge for a semi-period measurement?  I am not very familiar with the capabilities of the E-Series devices using RLP.  RLP is supported on the DDK forum, you could post your question there and I'm sure someone could help you further.

Regards,
Micaela N
National Instruments
0 Kudos
Message 2 of 3
(3,052 Views)

Hi Micaela N,

I read it in Chapter 4 "Programming", section "General-Purpose Counter/Timer", Example 2. There in step 2), you will find a line that says "G0_source_Polarity=0; (rising edges)". That is why I am assuming I can set the polarity of that terminal. I read it in the PCI E Series Register-Level Programmer Manual. I will post this question to the DDK Forum.

Thanks.

0 Kudos
Message 3 of 3
(3,041 Views)