0

I have made some measurements with an NI6024 acquisition card using Simulink, with the following model:

enter image description here

I have run the simulation with simulation time = "inf" and a fixed time step of 0.2, in order to collect real time data from the card. But I didn't realize that the values that "Clock" gives do not correspond to real-world time. More specifically, I have run the experiment for about a minute but the data in the variable "t" range from 0 to about 50000, which is clearly wrong. I have saved the workspace data, and I have access to the recorded data (the variables "t" and "h"), but have no means to reproduce the experiment.

Is there any way to retrieve the real world time of the simulation?

Haris Gušić
  • 197
  • 2
  • 12

1 Answers1

1

You've basically got two choices.

  1. Run your model in real time, using for instance something like Simulink Real-Time, or other real time OS. In this case the (wall clock) time will represent time since the model was started.

  2. Write an S-Function to slow down the simulation so that it fakes real time. There are multiple examples of doing this on the File Exchange. See Real-Time Pacer for Simulink for one such example.

Phil Goddard
  • 10,571
  • 1
  • 16
  • 28