0

I need to read the value of Display block in Simulink model through m-file command using get_param function.

What should be the command syntax i.e. get_param ('mymodel/BockName', ???)

Appreciate your support.

Many Thanks

Ocean Blue
  • 33
  • 4
  • 7
  • Why do you need this ? Also IMO, probably this is not the best way to read outputs – P0W Jul 14 '14 at 04:15

1 Answers1

3

You cannot get the value displayed on Display block using get_param for dialog parameters. This is run-time data and is not stored as a dialog parameter in the block. While the model is running you can use the "RunTimeObject" parameter to get the values. For example, if your model is paused in the middle of the simulation, you can use the following commands to get the input values.

rto = get_param(gcbh,'RuntimeObject')
rto.InputPort(1).Data

RunTimeObject will be empty if the model is not running.

Navan
  • 4,407
  • 1
  • 24
  • 26
  • Thanks a lot for your answer. However, I need to get the value after the simulation run not during the simulation. – Ocean Blue Jul 18 '14 at 13:14
  • I do not think that is possible with Display block. You need to log the data to workspace and use that after the simulation. See "To workspace" block. – Navan Jul 18 '14 at 14:35