LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DMA FIFO FPGA in CVI or LabVIEW

FPGA Target FIFO is configured for 8197 elements


                NiFpga_MergeStatus(&iFpgaStatus, NiFpga_Open(FPGABitFileName,
                                                             NiFpga_RseriesRIO_Signature,
                                                             Address,
                                                             0,
                                                             &hSession));

               
                NiFpga_MergeStatus(&iFpgaStatus,NiFpga_ConfigureFifo(hSession,
                                        NiFpga_RseriesRIO_HostToTargetFifoU8_DMAFIFO,
                                        3000000));
       
               
NiFpga_WriteFifoU8(hSession,NiFpga_RseriesRIO_HostToTargetFifoU8_DMAFIFO,
  uArray,
  20000,NiFpga_InfiniteTimeout,
  &uEmptyElementsRemaining);


uEmptyElementsRemaining  is 2980000   <----------After above call

NiFpga_WriteFifoU8(hSession,
              NiFpga_RseriesRIO_HostToTargetFifoU8_DMAFIFO,
  uArray,
  20000,NiFpga_InfiniteTimeout,
  &uEmptyElementsRemaining);

               uEmptyElementsRemaining  is 2968197   <----------After above call

 

[Was expecting 2960000 elements remaining in DMA FIFO after second call]

 

When the same steps are executed on LABVIEW [with labview equivalents of above functions], it produced different result. i.e. When executed with Labview [with same FPGA FIFO size and DMA fifo size] ,

 

uEmptyElementsRemaining  was 2980000 and 2960080 after first and second write method.

 

Also when Labview VI was run continuously, uEmptyElementsRemaining   was changing after the second write method but was correct [2980000] after first write method.

0 Kudos
Message 1 of 2
(2,175 Views)

Hi SchamWow,

 

Are you calling the NiFpga_StartFifo in the same order in your LabVIEW and CVI code?

 

NiFpga_StartFifo

NiFpga_Status NiFpga_StartFifo(NiFpga_Session session, uint32_t fifo)

Starts a FIFO.

Parameters

NameTypeDescription
session NiFpga_Session handle to a currently open session
fifo uint32_t the FIFO to start

 

0 Kudos
Message 2 of 2
(2,151 Views)