How can I make the load to rise/ fall at particular time while performing real time simulation in RT box 1?

  1. I am making a control system to deal with the transient load. So, I have to increase the load ( resistive load, or taking current source as load ) during the simulation. In offline mode, I use a step-up signal to increase the load at a particular time. How can I perform it while doing real-time simulation in the RT box 1?

  2. Under the “Coder Options”, in the “external mode” section. What’s the rule to keep the values of " number of samples" and " decimation " to increase the scope time?

To create events that occur on the RT Box in real-time there are a few options:

Create a periodic disturbance. For example, by using a Pulse Generator block opposed to a Step block the disturbance is not tied to any particular time during the simulation. This is used in many demo models.Have the change be externally triggered. For example, if you are using one of the pre-designed interface board use one of the DIP switches to change a digital input. That digital input can then be used in conjunction with a Signal Switch to choose between different values. For offline simulation, you can route a Step block to the appropriate digital input port.Manually change the value using inlined parameters and the external mode.Regarding the scope time, the total scope capture time in seconds is simply the product of the discretization step size, the number of samples, and the decimation.

It is also fine to use the step block in a realtime simulation. You may get an initial error that this block uses the absolute time, but this can be turned into a warning (or silenced completely) in the coder options.

The use of absolute time in the step block is not a problem: The danger with absolute time is that the floating point number becomes larger and larger over time and therefore the resolution is more and more reduced. Since the step block only compares to a single, fixed time stamp it will work as expected.

Great points Oliver!