06-27-2018 10:58 AM
What do you have for the number of samples to read from the DMA? Hopefully that is not 0 (though, your error description tells me it is set to 0).
06-27-2018 11:28 AM
Hi I have number of samples as 1000. Please find the images of my VI and waveform chart. I expect a 4Vpp sine wave of 1Khz frequency
06-27-2018 11:50 AM
At least we have the right general shape now. Your FPGA can sample at up to 1MS/s. So with a 1000 samples and one full cycle captured, you are getting 1kHz. And the amplitude looks correct.
You might want to add a wait inside of your FPGA to have a more consistent and known sample rate. I am thinking a 10us wait should be good, giving you a 100kHz sample rate.
What are you using to generate the waveform? What sample rate is it using? I am eye balling a sample rate of ~10kHz.
06-27-2018 12:40 PM
Yes we have the proper amplitude and wave. I have added the wait in my FPGA, but that didn't seem to improve my output. How do I get a smoother sine wave? I also wanted to increase the range of x axis to get a clearer waveform. How do we do that?
I am using a sine wave generator AFG 3021B with sample rate 250MS/s.
06-27-2018 02:13 PM
@pratikpade wrote:
I also wanted to increase the range of x axis to get a clearer waveform. How do we do that?
Increase the history of your chart. Right-click on the chart and choose "Chart History Length". The default is 1024 samples.
06-27-2018 02:26 PM
@pratikpade wrote:
How do I get a smoother sine wave?
Please attach your entire project. I am talking the project file, target VI, and host VI. I cannot debug anymore with pictures. I need actual code and environment.
My latest observation is that the read waveform only has integer values. So I think you have a really bad FXP configuration for your DMA FIFO, which is causing the decimal places to be truncated/rounded off. More evidence of this shows up in the Target VI since there is a coercion dot going into the DMA Write node.
06-27-2018 03:27 PM
I tried changing the FIFO data type to u32 which gave me a square wave. Also I tried using the "Get number of elements" method but I was not able to place it correctly.
Please find the attached project as well as the VIs.
Please refer to Vis:
Host: test_6_22_part2(HOST).vi
Target:test_6_22.vi
Thank You
P.S: I would like to apologize in advance for the excess VIs in the project and bad designing of VIs.
06-27-2018 05:54 PM
@pratikpade wrote:
I tried changing the FIFO data type to u32 which gave me a square wave.
Yeah, that is definitely not going to work. The data type of the DMA should match exactly the FXP configuration of the AI node or a SGL.
I am away from the office, but I can look at your code in the morning.
06-27-2018 06:03 PM
Thank You for your efforts. By that time I will keep trying and let you know if I can get something.
06-28-2018 06:21 AM
Yep, I just confirmed what I thought was happening. The FXP settings for your DMA currently has a resolution of 1. So any decimal places are going to get truncated or rounded. My suggestion is to just make the DMA data type be a SGL, which is a floating type that is now supported by LabVIEW FPGA. This is also a data type that can be wired straight into your chart.