Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Generating Frequency Specific Digital Pulses

Hello All,

 

I'm using a myRIO with Labview 2014 to control some stepper motors. I have both the drivers in single step mode, where a single digital high signal will result in a single step. I'm planning on controlling the overall motor speed by controlling the frequency of digital high signals. My first thought was to use the PWM express VI however I am unsure as to the duration that this VI runs, in other words if I had the express VI and nothing else on the block diagram and I input a frequency of 40 Hz, for how long will it generate the 40 Hz pulse? One period or continuously until the VI is stopped?

 

My second question is I've read that the lower limit of frequency able to be generated by the PWM express VI is 40 Hz, but I may need to go as low as 10-20 Hz in some cases. What would be the best way to create a square wave digital signal with frequency as an input and wire it to a digital output? The standard digital output express VI on the myRIO accepts boolean true/false for digital high and low so could I do this with a conversion? I'm quite new to labview so any pointers would be much appreciated!

 

Cheers,

Ben Sia

0 Kudos
Message 1 of 4
(5,114 Views)

bsia5466,

 

This example seems like it performs what you are wanting. I would recommend trying this example and seeing how it performs. http://www.ni.com/example/26726/en/ 

Matt P.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 4
(5,029 Views)

I just checked out the example VI and it seems to reference a cRIO as the hardware however I'm using a myRIO. I'm also having trouble seeing where the pulses are being generation from on the block diagram?

0 Kudos
Message 3 of 4
(4,997 Views)

This should work for the myRIO as well. You will have to change your target to be the myRIO. The pulses are actually generated in the code for the target. Try looking in that code it should make things more clear.

Matt P.
Applications Engineer
National Instruments
0 Kudos
Message 4 of 4
(4,888 Views)