Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

digital pulse

I am using a CRIO 9074, with NI 9411, NI 9263, and (3) Ni 9474. I am trying to generate a pulse train from 0 to 10 kHz(variable) and uto 80% duty cycle. I have the Scan Engine set to 1ms. I was told this was easily possible with the hardware selected. I am unable to get ubove 200Hz with 1 DO channel, and the processor is at 99%. is there an easy way to generate a pulse train upto 10khz?

0 Kudos
Message 1 of 7
(4,408 Views)

Are you completely set on using the Scan Engine or can you do a little bit of FPGA programming?  If you are OK using FPGA, you can quickly write an application that will simply flip the value of the DO line in a loop.  By using two timers with controls wired to them, you can control the frequency and duty cycle of the pulse train.

 

If you need to use Scan Engine, you can right-click the module in your project and select Properties.  If you then select Specialty Digital Configuration on the left, you will have the option to set the Specialyt Mode to Pulse-Width Modulation where you can then control the frequency.  However, there is not an option to set the duty cycle and I don't believe you can programmatically update the frequency, only in configuration mode.

 

Hope this helps.

Alex Person
NI-RIO Product Support Engineer
National Instruments
0 Kudos
Message 2 of 7
(4,308 Views)
I think the io variables for the module when set to pwm mode are now used to control the duty cycle at run time. But yes, you cannot change the frequency at run time
Stephen B
0 Kudos
Message 3 of 7
(4,298 Views)

After further investigation, you can programmatically control both frequency and duty cycle.  To set duty cycle, change the module to PWM mode through the module properties and then the value you wire into the IO node (0-100) determines the duty cycle.  See the example PWM - cRIO IO Scan.lvproj in the NI Example Finder for an example of this.  To set the frequency, use a variable IO property node to change the frequency for each channel.  See the attached image for an example.

 

adjust frequency.png

Alex Person
NI-RIO Product Support Engineer
National Instruments
Message 4 of 7
(4,283 Views)

All,

 

Thank you for taking the time to help me. I ended up using the FPGA to be able to get to the 10kHz (1 Hz step) requirement. Having never used the FPGA module before, this was REALLY easy. Using the FPGA also kept the processor usage low.

0 Kudos
Message 5 of 7
(4,281 Views)

Glad to hear you got it working, especially since this reply came a little late...sorry about that.  Hopefully the information will help someone else looking for it anyway.

Alex Person
NI-RIO Product Support Engineer
National Instruments
0 Kudos
Message 6 of 7
(4,278 Views)

I had some amazing help from Daniel Herrington at NI......took me longer to figure out I needed the FPGA than it did to program it! This platform is being used to simulate the signals from a diesel engine and simulate our CVT in order to advance the shift control system.  

 

Thanks Again to all who replied,Daniel Herrington, and the rest of the NI staff!

0 Kudos
Message 7 of 7
(4,276 Views)