Trouble passing unsigned long out of "C Function Call" block - dsPic 33EP32MC202
I'm having some trouble sending unsigned long values out of the C Function Call Block. I've attached a model I put together to help troubleshoot the issue. It makes output A0 pulse to make an LED blink and has 3 functions (testa, testb, and testc) that return values of 16384, 32768, and 65536 respectively, or so it should. It is also setup to connect to Matlab via the serial port through external mode to display those values.
The actual values are that are displayed in Matlab are correct for testa=16384, but not so for testb=4294934528 and testc=0. It seems the variables are overflowing.
Has anyone run into this issue or see any issues with the model/code?
Thanks in advance.