MATLAB Answers


Why cannot data be written to a file on Raspberry pi when it is working standalone, i.e when executable, created with the use of simulink, on raspberry pi is run

Asked by Saffet
on 17 Sep 2014
Latest activity Answered by Lara Zubaidia on 1 Apr 2016
When I start real time code on simulink, the data extracted from audio capture block can be written to a file, by using "to file" block, on raspberry pi. ( external mode is selected and simulation stop time is adjusted as "inf") However, when it works standalone, i.e when I run executable, created by simulink, on raspberry pi, no data is written to the file. It is empty in all cases. It appears the executable works but no new data is written to the file, although the file is created on the relevant directory. I also checked the following link but haven't not solved the problem yet
Any help is appreciated


Sign in to comment.

2 Answers

Answer by Murat Belge on 3 Dec 2014

The To File block does not generate any code (i.e. a no-op block) when the Simulink model is run as a stand-alone application. This is similar to other sink blocks such as a Scope. This block works only in Simulation. Since External Mode is a simulation mode, the block works in External Mode.
In stand alone mode, the Simulink model runs indefinitely (i.e. there is no stop time) on Raspberry Pi. So a MAT-file cannot be generated.


Thank you Murat for your answer. Can you suggest me any other way (another block or something else) so as to write any data to a file in stadalone mode, or there is no way by using stadalone mode in simulink ?

Sign in to comment.

Answer by Lara Zubaidia on 1 Apr 2016

hello Saffet I wonder If You have solved the problem and what was the solution for it ? Any Suggestion please?


Sign in to comment.

Translated by