Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Measuring a PWM waveform with a USB-6501

A NI applications engineer that I spoke with before purchasing the USB-6501 told me that I would be able to measure the pulse width of an incoming signal from a US Digital Encoder with a pulse width modulated output. I am having trouble figuring out how to go about doing this. My current setup is as follows:

 

Software:

LabView 8.0 Student Edition with Math Script

NI-DAQmx Version 8.6

 

Hardware:

US Digital MA3 12 Bit PWM output encoder

  • PWM Frequency
    • 244Hz typ.
  • Minimum Pulse Width
    • 1.00µS typ.
  • Maximum Pulse Width
    • 4097µS typ.

 

Hardware Configuration:

US Digital encoder to USB-6501 Wiring

  • Pin 1 Ground
  • Pin 2 +5V
  • Pin 9 PWM input

 

I don't have any VI's to post due to the fact that I am not sure that the data I am pulling in through my tests is  usable for what I am trying to do.  I have tried to configure the USB-6501 for a counter input and a digital line input. For the counter input I get counts that increase at the output frequency of then encoder which is not affected by shaft position. For the digital line input I get a Boolean output that does seem to differ with shaft position.

 

Is there a way to measure the time that the digital line input is in one state or another?

 

Any help is greatly appreciated.

0 Kudos
Message 1 of 2
(3,551 Views)

The USB-6501 is only able to count the number of pulses (events) when you are using the counter input pin 9.  So, you will not be able to use any of the shipped examples that measure this directly.  I would recommend checking out the M series devices instead because they will come with counters with a gate, source, output, etc.

 

M Series Data Acquisition

http://www.ni.com/dataacquisition/mseries.htm

 

One thing you could try is to count the number of pulses seen and specify with a time stamp when the counter task starts and stops.  Then you will know the start and stop time (roughly, there will be some processing time) and the number of pulses counted in that amount of time.  From this, in software you can then determine the period of the input frequency by dividing the time by the number of pulses.  This measurement will be the average frequency or period in the amount of time the digital events were being acquired.  However, this will not measure the pulse width.

 

Regards,
Jordan F
National Instruments
0 Kudos
Message 2 of 2
(3,513 Views)