Error: The class uint64 does not map to a 64-bit C type.
Ältere Kommentare anzeigen
I've updated Matlab from 2017b to 2020b - because of my tool chain I'm restricted to certain releases and 2020b is the newest relase I can use at the moment. In my Simulink file I've implemented a Matlab function containing the bin2dec command. Everything worked fine in the 2017b release, but now, after the update, I get the error
"For code generation, integer input or result classes for TYPECAST must map directly to a C type in the target hardware. The class uint64 does not map to a 64-bit C type."
Why does this error occur and how can I resolve this issue?
I tried using the 'Bit to Integer Converter' Block from the Communications toolbox but this one doesn't work in my code because I get the value from an FPGA and in the communication interface I don't have the option to specify the number of bits. Hence, at the input, the value has the type 'double' and I have to convert it to a 12bit signed int.
Antworten (3)
Andy Bartlett
am 22 Apr. 2022
1 Stimme
If this error is happening when you are explicitly attempting to generated code with MATLAB Coder, Simulink Coder, or Embedded Coder, then the following may solve the problem.
Make sure Hardware Implementation target provides 64 bit integer type.
Make sure your model's Hardware Implementation target provides a 64 bit integer type. Either
- long is 64-bits
or
- long long is 64 bits
- Support long long is checked.
Some screenshots can be found here.
If this error is occuring due to implicit code generation such as simulating with a MATLAB function block or simulating with accelerator mode then I would not expect the previsous suggestion to solve the problem.
chrisw23
am 21 Apr. 2022
0 Stimmen
Try to use the .net System.Convert class methods. i.e.
System.Convert.ToInt64( <yourVal> )
3 Kommentare
Gerd Fuchs
am 21 Apr. 2022
Bearbeitet: Gerd Fuchs
am 21 Apr. 2022
The System class is usable by default as far as I know, but you can try to import it explicitly by
import System.*
The Matlab Command Window should provide the class interface by intellisense if you press the TAB key after the dot System.Convert.<TAB>
...and I'm talking about Matlab not Simulink :)
Gerd Fuchs
am 21 Apr. 2022
Ayush Modi
am 14 Mär. 2024
0 Stimmen
Hi Gerd,
I found similar question in the community.
Hope this helps!
Kategorien
Mehr zu Naming Conventions finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!