Real time, Matlab, SpeedGoat, Simulink, read write data, Solution?

10 views (last 30 days)
Hi,I'm using Simulink connected to speedgoat in a real time status. The simulink model includes a user defined block in which along with the main code, there are commands open, close fprintf, fscanf, in order to write/read some numerical data. The model is built correctly, but when the start application button is clicked the following error pops up "external mode open protocol start command failed". So, is there any other way by which we can enjoy write and read data while connected to speedgoat online. Mathwork expers, do you know how to solve this issue?
  4 Comments
Bonyadi Arezoo
Bonyadi Arezoo on 14 Jul 2022
Dear Walter, Let's make the issue simple and easy to understand. Assume that there is a simulink model where there is a user defined block. In this block an array is built, e.g. A=zeros(5,1), Now we want to store this array somewhere and whenever we needed it, it can be read, modified and then stored. An example of modification: A= A+1; So, as a whole the block is something like this,
% Initialization A=zeros(5,1); Store A If t==3 Read A A=A+1; Store A end
This is while our simulink model is connected to a speedgoat machine and the machine is supposed to work online.

Sign in to comment.

Accepted Answer

Fangjun Jiang
Fangjun Jiang on 14 Jul 2022
Edited: Fangjun Jiang on 14 Jul 2022
To store runtime data like "A" in your example, use "Data Store Memory" block in your Simulink model. Use "Data Store Read" and "Data Store Write" block to read and write the data.
To log data for offline use, use "To Workspace" block or utilize signal logging.
  7 Comments
Bonyadi Arezoo
Bonyadi Arezoo on 15 Jul 2022
Dear Jiang, Thanks to your advice, My issue was solved completely.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by