Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

DMA FIFO (target to host)

Solved!
Go to solution

Hi,

 

I have the following FPGA vi and RT vi (attached). I am simply trying to transfer the data from the FPGA to the RT vi (using Target to Host DMA FIFO) and then to plot the data in the  RT vi.The signal that I take as analog input  is a 10 Hz, 1 V amplitude sine wave though 9215 module. 

 

However, in the RT vi , I get only a fluctuating output, with only values 0 or 1. Also I see no timeout happening with the RT vi settings as: "TimeOut = -1" and "Count(uC) = 25"

 

Why could this be happaning?

 

Thanks in advance..

 

-Mandar

Download All
0 Kudos
Message 1 of 8
(4,289 Views)

I am also attacing the VIs for convenience...

 

 

Download All
0 Kudos
Message 2 of 8
(4,288 Views)

Hi Mandar,

 

Have a look at the data type of your FPGA and RT code.The FIFO that you have setup needs to have it's datatype changed to a Fixed point. You can do this by navigating to the properties of the FIFO and changing the datatype to FXP. Then, make the appropriate changes in the RT side as well so it exposes FXP instead of an unsigned 32-bit integer.

Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
0 Kudos
Message 3 of 8
(4,274 Views)

Dear Adnan,

 

DMA FIFO supports only U32 data type. It is given here:

http://zone.ni.com/reference/en-XX/help/371599C-01/lvfpgaconcepts/pfi_data_transfer/

 

I tried converting the FXP data from the 9215 module to U32 before sending it through the FIFO (screen shot of this block dig is attached), but this is not helping and I am getting a similar output (as earlier) on the RT vi viz. fluctuations between 0 and 1. 

 

However, I am able to transfer the data from the FPGA vi to the RT vi by  Programatic Front Panel Communication (which happens in FXP data type only)....

 

I am attaching the output on front panel if the RT vi. In this the chart on the right shows almost the same signal that I am giving through the 9215 module, but the graph on the left, which has data plotted directly obtained from the  FIFO, which is a horizontal line 😞

 

Can you suggest what else I could do?

 

Thanks,

 

Mandar

Download All
0 Kudos
Message 4 of 8
(4,272 Views)
Solution
Accepted by topic author Mandar_K

Hi Mandar,

 

Not with 8.6. You have pointed me the documentation of 8.5 (I didn't realize you were using that version). Have a look at the following article; it should solve the issue you are facing:

How Can I Transfer My Fixed-Point Data Using a FIFO In LabVIEW?

Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
0 Kudos
Message 5 of 8
(4,268 Views)

Hi Adnan,

 

Thanks for that link... I am now able to get the data in the RT vi using FIFO...

 

However, I am not able to understand the time stamps when I plot the data on the waveform chart and waveform graph... hence I am not able to check if the signal that I plot is of the same frequency that I input or is different

 

I am attaching the screenshots of front panel and block dig of RTCode

 

Thanks,

 

Mandar

Download All
0 Kudos
Message 6 of 8
(4,265 Views)

You need to understand what the difference is between a graph and a chart. The following link and the examples will help you understand them:

Types of Graphs and Charts

 

Have a look at the examples:

labview\examples\general\graphs\gengraph.llb

labview\examples\general\graphs\charts.llb

Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
0 Kudos
Message 7 of 8
(4,260 Views)

I have read the Help and now I use Build Waveform vi to generate the waveform before plotting it on a waveform graph.

 

(1)  In this, I put the value of dt same as the "Count (usec)" control which sets the loop rate for my FPGA vi. Eg: If I set "Count (usec) = 500", I put "dt = 0.0005"

Is this correct?  Does it mean that the FPGA while loop and the while loop in my RT code run at the same rate?

 

(2) For   " t0 " , I use the Get Date/Time in Seconds vi , however, it is giving correct date, but wrong time. However, the "Create Waveform example VI: labview\examples\Waveform\Operations.llb "  shows the correct date and time. Where can I be wrong?

 

Thanks,

 

Mandar

0 Kudos
Message 8 of 8
(4,236 Views)