Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

I want to know how can i Transfer Fixed-point Data using a FIFO

I want to transfer Fixed-point from NI 9217 I try to following by link
 
I don't know why I messure from FPGA is correct value but the value from Host is wrong
Do you have any idea for help me
0 Kudos
Message 1 of 4
(3,414 Views)
0 Kudos
Message 2 of 4
(3,408 Views)
Hi KNAI,

I think that your problem is in the host code.  Converting the U32 from the DMA to the FXP you might have missed an important step.
In the boolean array to number you need to specify what type of representation you require, or supply a data example in FPGA.

You will need to right click on the boolean array to number and select properties, then set the output configuration to the type of FXP that was generated by the FPGA.
In your case this is (deselect adapt to source) and set the FXP to unsigned 24 bits word and 10 bits integer.  The VI will then be able to convert the U32 into the correct type of FXP.

Beware that when the FXP value crosses the X-axis there is a discontinuity in the U32 representation and you should beware of this if you use averaging on a U32 with integer maths, for straightforward conversion this is not a problem.  You just have to remeber that when converting U32 to FXP you have to set up the output conversion in the boolean array to number properties.

Hope this is of some help.

Cheers
Stephen
0 Kudos
Message 3 of 4
(3,397 Views)
Hi KNAI,

The settings that I gave you above are not correct.  For the 9217 the FXP is SIGNED, 24 Bits Word Length, 10 bits Integer Length.
You can always check what the FXP format is by looking at the properties of an indicator created from whatever is generating fixed point data.
Fixed point maths seems to be full of pitfalls for the inexperienced, and can cause lots of head scratching.

The example from the knowledge base does not make it clear enough that you HAVE TO MATCH THE FXP FORMAT for the boolean array to number to work,  you seem to have copied the sample code verbatim rather than adapting the key properties to suit your application.


Cheers
Stephen

0 Kudos
Message 4 of 4
(3,391 Views)