MATLAB: Is it possible to pass 64-bit values between S-functions in Simulink 8.1 (R2013a)

simulink

I want to pass 64-bit values, (u)int64, between S-functions, but I noticed that in the Supported Data Type, the support is only up to 32-bit values. Is there a way I can do this?

Best Answer

Currently in Simulink/RTW, there is not support for a 'built-in' 64-bit integer; e.g. (u)int64 similar to the current support for (u)int8, (u)int16() and (u)int32. To work around this, you have two options.
One option is to use a Fixed Point 64 bit value. This would allow you to do all kind of maths and manipulation, i.e. Gain blocks, Add blocks etc. would just work. This would require a license of Simulink Fixed Point and the Fixed Point Toolbox.
Another way to go is to expose it as a vector of two int32s, with the downside that you need to also design a set of your own math functions (S-function, constructed via Simulink blocks, etc.).