Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

PWM measurement with NI 9411 is never zero

Hi folks,

 

I am using the NI9411 DI module on a cRIO 9074 to measure a 1 kHz PWM signal.

I created an empty project, set the mode of the module to "counter" "pulse width measurement" "High pulse" and "disabled" input filter.

For taking a first look at the measured values i used the NI distributed system manager.

At the beginning the measured values seem right, they are somehow multiplied with 10 but i can easily correct that with a normal division by ten.

The problem is, if i pull the plug which connects the NI9411 to the pwm generator, the duty cycle never goes to zero but stays somewhere between.

For example if the duty cycle is 510 (that is supposed to be 51) and i pull the plug it goes to 230 and stays there. If i repeat the step of plug-in and out, the duty cycle sometimes drops to 1.25 and sometimes to 70.

The values seem random and the counter stays at this value the whole time until i plug it back in.

For my application the module has to see the "missing" pwm if the plug is removed.

 

How can this be and how can i solve this problem?

 

Thanks

 

0 Kudos
Message 1 of 8
(7,411 Views)

Sorry for the zombie thread, but I recently purchased the NI 9411 module, and when reading a PWM signal, I am having the same problem: When a signal is abruptly removed from the measuremnt channel, the reading does not return to zero. Rather, it remains constant at the last value before the signal was lost. When the signal is not present, I need the card to read 0. Please advise.

0 Kudos
Message 2 of 8
(4,970 Views)

Hi b3nton,

 

Could you provide the VI so that I can further understand the problem that you've encountered?

 

Thank you.

 

Regards,

Ong Ee Lim



See that button on the left side of this post...

If you feel my post is helpful, all you need is just (at most) 2 seconds to click that button, to show your appreciation. Thank you~~



0 Kudos
Message 3 of 8
(4,942 Views)

I've attached my VIs. My program is running on a cRIO, and the data is passed to a host computer, which then logs the data. Let me know if you have further questions.

Download All
0 Kudos
Message 4 of 8
(4,938 Views)

Hi b3nton,

 

Thank you for proviing the code. Unfortunately, there isn't much information that I can find or relate to the PWM measurement.

May I know if its possible for you to provide the own LabVIEW project with the VIs (Place into one zip file).

 

Also, by looking at the code, there are some confusions on how PWM measurement is done and how it is calculated.

Could you help explained which variables and which part of the code are used for PWM calculation?

 

Thank you.

 

Regards,

Ong Ee Lim



See that button on the left side of this post...

If you feel my post is helpful, all you need is just (at most) 2 seconds to click that button, to show your appreciation. Thank you~~



0 Kudos
Message 5 of 8
(4,925 Views)

PWM measurement is taken using the NI 9411 card in PWM read mode. I've attached  my project, including all VIs and controls.

0 Kudos
Message 6 of 8
(4,915 Views)

Hi b3nton,

 

Thank you for sending the code.

I've tried reproducing the code, and it seems that it is expected behavior that the last value of the pulse width measurement will be retained if the signal is being removed from NI-9411.

 

If you want to reset to 0 if the signal is removed from NI-9411, one way is to check if the pulse width value remains constant for a given timeout.

 

Let me know if you're okay with this approach.

 

Thank you.

 

Regards,

Ong Ee Lim



See that button on the left side of this post...

If you feel my post is helpful, all you need is just (at most) 2 seconds to click that button, to show your appreciation. Thank you~~



0 Kudos
Message 7 of 8
(4,899 Views)

Thank you for looking at this with me, I greatly appreciate it Smiley Happy! I have considered your approach to pull the PWM signal to 0 programmatically, but there are instances where my PWM signals are constant when the signal is actually present. It might be difficult to separate a true constant PWM signal from a false constant PWM signal.

0 Kudos
Message 8 of 8
(4,890 Views)