I'm using a LaunchXL-F28379D with MATLAB-Simulink and the Hardware Support Package for the C2000 processors.
So far I'm very happy with everything I can do but I've encountered a problem when sending data to workspace.
My model just reads data from an analog input every 0.01 seconds and applies a couple of simple operations. With the scope I can see the values in real time without any problem for a long period of time, but if I try to send them to workspace with the corresponding block only the last 6 values are stored. I send them as "Structure With Time" (Timeseries is not available in External Mode).
I attach the model in .mdl format because .slx files are not permitted, if someone wants the .slx (which is the one I'm working with) I can provide it with an external link..
Values of the constants if someone wants to reproduce it:
ADC_REFHI_mV = 3000;
ADC_RESOL = 4096;
ADC2mV = ADC_REFHI_mV/ADC_RESOL;
valueMin_mV = 820;
valueMax_mV = 2540;
What I've tried:
- By default I have the Limit data points to last unchecked in the Model Parameters and set to inf in the specific block. If I change them to a specific number(like 100 or 1000 values) then I only got the last 2 values in the structure.
- If I change the "Save format" to "Structure" or "Array" I get the same result: only the last 6 points.
- The solver uses "Fixed-step" type with "Fixed-step size" set to "auto". I tried changing it to 0.005 seconds and 0.001 seconds and then I only get the last value to workspace.
I'm wondering whether the cause may be something related with some kind of dynamic memory or serial communication problem...
If I use an Arduino Uno with the same model (using the corresponding Arduino ADC block) I can get a huge amount of points stored into a workspace variable, so I think this board should be capable of doing so as well.
Thank you very much.