2
\$\begingroup\$

I'm fairly new to Simulink programming so bear with me.

My project is to measure some parameters with the ADC of the board and send them over serial (SCI_A) to a Simulink file I'm running on my PC and then graph the data.

So far I've succeeded in doing just that, by uploading a program to the board that sends the data (using the SCI transmit block) and another program that's only run on my PC, reads the data using SCI receive (and of course a com port select block and a Scope block to plot the data)

Now I want to save the data that I get into a Matlab file, but since I plan to save days or weeks of data (multiple times per second), the file would become huge and I wouldn't want it to get corrupted.

So my first question is: Is there a way to SAVE the data (I've tried using a To File block) in chunks, say 1000 samples, then open a new file and start saving the new incoming data to that, so I'll end up with loads of separate data files?

My second question is: Uploading a program to my board takes loads of time and I have to do it each time I want to change a parameter. Is there a way I could receive the data I want to, but also use the same program running on my PC to send data back to the board and change its parameters?

To clarify: Let's say, for example, I want to measure an ADC input with the board, multiply the data by a number X and send that to my PC where I could plot the data and save it into multiple files when one file exceeds (for example) 1000 samples. If I choose so, I would also like to send the number X from my PC to the board, so that the multiplication factor changes.

I hope I've clearly stated my problem and I thank you for your answers in advance.

P.S: Again, I'm new at this so please be specific when answering, I would very much appreciate "explain this to your granny" answers.

\$\endgroup\$
  • \$\begingroup\$ A simulink file or a matlab file? if you have matlab file what you are requesting is relatively trivial \$\endgroup\$ – JonRB Sep 10 '18 at 15:48
  • \$\begingroup\$ I'm using Simulink for everything. I now want to send parameters to my development board over us...no clue how \$\endgroup\$ – CrtSuznik Sep 11 '18 at 11:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.