04-13-2016
04:31 AM
- last edited on
12-13-2024
02:17 PM
by
Content Cleaner
Hello,
NI FPGA Interface C API allows to share integer values between CPU and FPGA on CompactRIO.
Why fixed-point and floating-point types are not supported ? (see https://www.ni.com/docs/en-US/bundle/fpga-interface-c-api-ref/page/capi/overview.html)
Despite that, is there a tip to share fixed-point and floating-point types ?
Will NI FPGA Interface C API support one day this feature ?
Thank you in advance for your answer.
FloG.
04-13-2016
10:09 AM
- last edited on
12-13-2024
02:18 PM
by
Content Cleaner
FloG, welcome!
While I can't speak to the future plans of the FPGA C API, I can tell you that you can cast/reinterpret the datatype into a supported type on the FPGA side and undo the operation on the C side.
See: http://digital.ni.com/public.nsf/allkb/B484B0F129BB2EFD86257660000223C6 (this covers FXP, which can be used if you coerce your SGL to FXP first) or https://forums.ni.com/t5/LabVIEW/Flatten-floating-point-on-FPGA-for-multichannel-DMA/m-p/2576179#M77... (covers the SGL case but is a bit more involved).
04-28-2016 11:39 AM
Hi Flog,
I'd like to chime in with some good news. We will be releasing floating point support in Q3 2016 and will likely release fixed-point support next. Can you comment on your use and needs for fixed-point support?
Thanks,
Anna Kozminski
Embedded Software Product Manager
04-29-2016 02:20 AM
Hi,
Thank you for your answers.
Signal from modules such as NI9203 are seen as fixed point data for the FPGA. My purpose is to share this value with my C++ program as a float type (fixed point does not exit in C++)
Regards,
FloG.
04-29-2016
10:08 AM
- last edited on
12-13-2024
02:18 PM
by
Content Cleaner
flog wrote:
...
(fixed point does not exit in C++)
...
This is largely because there is no one standard or implementation for fixed-point, you must (implicitly) be aware of what the representation of your number means to work on it, and you can adjust the representation for whatever your operations require. It is not maintained within the actual data itself (as is the case with floating point, when following the defined structure for floating-point data).