Academic Hardware Products (myDAQ, myRIO)

cancel
Showing results for 
Search instead for 
Did you mean: 

Match real life frequency with LabVIEW's frequency in a square wave

Solved!
Go to solution

I'm trying to output a square wave (Amplitude from 0 to 1) to my myRio through a digital output, and I tried the different square wave blocks (Square Wave, Square Waveform, Pulse Pattern and Simulate Signal VI's), but the frequency in LabVIEW never matches the  frequency measured on my oscilloscope in real life. I was curious whether there are any alternative options to output a square wave onto the myRio where the virtual and real life frequencies match?

 

I've attached my VI of my attempt to make the Square Wave PtByPt work.

0 Kudos
Message 1 of 2
(3,529 Views)
Solution
Accepted by topic author DRWardell

You may get better results by doing an N sample digital output. To switch this setting in the Express VI you first have to change the FPGA personality to High Throughput mode. Do this by right-clicking the myRIO in your project explorer and select “Switch FPGA Personality”. After you do that the I/O mode parameter will be available when you configure the Digital Output Express VI.

 

Additionally, you could generate the square wave manually on the FPGA. Just pass your signal between loop iterations with a shift register and invert the value after a specific number of iterations to get the period.

 

Another option would be to use the Square Wave Generator Express VI in a FPGA VI.

0 Kudos
Message 2 of 2
(3,510 Views)