LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

fixed point conversion with DMA transfer

Hello,

I have a problem of conversion with fixed point. I want to transfer data from a NI 9215 analog input to a target using a DMA. I have followed the guideline "How Can I Transfer My Fixed-Point Data Using a FIFO or Memory in LabVIEW 8.5.x?"


The problem is that if I try to acquire a signal more than 1 V of amplitude I have a problem. I have attached a copy of the signal I acquire.

I don't understand why, I however follow point to point the tutorial. In the fpga VI, I first convert the fixed-point value (fixed point <+/-,20,5>[-1.600000E+1,1.599999E+1]:3.051758E-5]) to an array of Booleans. Then convert this array to an unsigned 32-bit unsigned integer using the Boolean Array to Numeric VI (I let activated the "case adapt to source").
Then in the RT VI, I do the inverse process as described in the tutorial.

First I have discovered that if in the Boolean Array to Numeric VI, I set the conversion from word of 32 bit to integer of 16 bit (as in the tutorial) the signal is totally wrong reconstruct  So I set conversion from word of 16 bit to integer of 16 bit. This is strange because the DMA use 32 bit integer...
I have also attached the result with the 2 above configuration.


But why is my values over 1 V false recreate?

Thank you already for your answer
0 Kudos
Message 1 of 6
(3,933 Views)
Here are also my fpga VI and my RT VI
Download All
0 Kudos
Message 2 of 6
(3,931 Views)
If it can helps somebody else, the problem was with the conversion at the output of the FIFO in the RT VI. I had fixed point of size 20 coming out the fpga (then transfering in the DMA under the form of U32), so in the RT VI, I had to convert word of size 20 (with integer word length of 5).
0 Kudos
Message 3 of 6
(3,883 Views)
Hello,

You are right, as we saw yesterday, when you use fixed point in the DMA FIFO to transfer data from the FPGA to the Host.
You muss preserve the fractional part of the data on both side (FPGA and FIFO)

For example, if you are passing a fixed point number with a word lenght of 20 ( Integer word lenght of 5), on the other side (Host),
you must convert the data with the same properties

Best regards,
Nick_CH
0 Kudos
Message 4 of 6
(3,864 Views)
Thanks you Nick_CH for your help yesterday!

The acquisition works weel but I test this morning the ouptut and I still have a problem with the amplitude of the white noise generator. The white noise generator need an amplitude in U16.
Amplitude—Specifies the amplitude of the uniform white noise. The default is 32768, so the white noise out output is uniformly distributed between –32768 and 32767. You can set Amplitude to any value from 0–32768. This option only appears if you select Uniform as the White Noise Type

So because I want an amplitude of 1V and the range of the output on the NI 9263 is +/- 20V, I set an amplitude of 1V/(20/2^16)=3277. The output of the noise generator gives an I16. So I convert it to fixed point using the "To fixed point VI" in the range output of the NI 9263 (word of 20 bits with word lenght integer of 5). But I always have a signal of +/- 10 V at the output.

Have you any idea why?

I attached my fpga VI.
0 Kudos
Message 5 of 6
(3,854 Views)
Hello,
 
As mentionned in the KB How Can I Transfer My Fixed-Point Data Using a FIFO or Memory in LabVIEW 8.5.x?, it is important to preserve the fractional part of the data, type cast the integer number as the fixed-point number with the same number of bit as the word length of the integer or fixed-point.
 
 
Best regards,
Nick_CH


Message Edited by Nick_CH on 04-29-2008 03:03 PM
Download All
0 Kudos
Message 6 of 6
(3,785 Views)