From 11:00 PM CDT Friday, May 10 – 02:30 PM CDT Saturday, May 11 (04:00 AM UTC – 07:30 PM UTC), ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From 11:00 PM CDT Friday, May 10 – 02:30 PM CDT Saturday, May 11 (04:00 AM UTC – 07:30 PM UTC), ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
|
LabVIEW 8.5.x,DMA FIFO 只支持unsigned 32-bit 数据类型, 对于target 和VI-scoped FIFO、以及memory并不支持定点数据类型。如果将定点数据类型直接传入 FIFO 或者memory, the fractional 分数部分将在强制转换成整形的过程中被截断。
为了保留数据中的小数部分,将定点数据转换成和整形数据一样比特数的类型,其比特数和定点的数据比特数长度一致。
为了实现上述要求,需要将传入FIFO或者memory 的定点数据以二进制表示。下面的步骤详细的说明了将一个定点数据通过DMA FIFO传入host的方法,其中使用了U32的数据类型。
注意:Target 、VI-scoped FIFO 和memory可以传递多种数据类型。可以通过舍入或者凑整将FIFO 和memory的长度和定点数的数据长度相符。举例来说,如果希望传递一个长度为20的定点数据,使用一个unsigned 32 bit 的FIFO。
FPGA 转换
Host 转换
5. 将定点数据类型通过自动索引连接出。
注意: 需要知道在FPGA中定点数据的设置以在host 端转换数据类型。
将定点数据转化完成之后,在host 端就可以根据需要使用数字类型转换将数据转换成任意一种数据格式。
注意:需要使用Binary Array to Number 并且废除VI的输出类型属性。仅仅使用使用Binary Array to Number,To FXP VI还是会截断数据的分数部分。
|