Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

measure PWM input to NI using labwindows

Hello,

 

i want to measure PWM came out of controller. i use labwindows to develop this task.

but when iam searching example of DQAMX inside counter examples i had found that i can measure pulse width OR i can measure period

 

iam asking now i need to detect PWM (pulse width and period ) and i couldn't create the two handels on the same task......

 

So please tell me what i can do to measure the twice at the same time

 

thanks in advance

0 Kudos
Message 1 of 5
(6,132 Views)

Hello,

 

Characterizing the frequency and duty of a PWM signal will require 2 separate tasks. A task for pulse width measurement and frequency/period will need to be created. Each of the 2 tasks will require separate hardware counters to do this measurement; you will have to wire the PWM signal into both sets of counters for the 2 measurements to occur simultaneously.

 

Eric 

Eric Liauw
Senior AE Specialist - Automated Test | CLD | CTA
National Instruments
0 Kudos
Message 2 of 5
(6,117 Views)

you mean that i have in my NI two counters CTR0 and CTR1 and i will apply the signal on both pins and start to detect task by task then handel the both tasks to return the width and period ........but in this case i will not be able to make pwm output from bench and input at the same time as i have two counter only ...IS IT right ?? 

 

if yes .....that is the only way to implement the pwm measure  but what semiperiod function means ???? i C it can detect the both levels periods but it will draw them not get them as values....???

 

thanks alot for your help 

and waiting your reply 

0 Kudos
Message 3 of 5
(6,113 Views)

Hello,

 

Since you only have 2 counters, you can only perform 2 counter tasks at a time. If the PWM signal is not quickly changing, you can measure the pulse width, close the task, and then use the same counter to measure the frequency. I am unsure of your measurement requirements, but this is a possibility.

 

Eric

Eric Liauw
Senior AE Specialist - Automated Test | CLD | CTA
National Instruments
0 Kudos
Message 4 of 5
(6,107 Views)

Hello

 

thanks alot for your help .....

0 Kudos
Message 5 of 5
(6,095 Views)