Message Boards Message Boards

0
|
6799 Views
|
4 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Measuring Time in SystemModeler

Posted 4 years ago

In SystemModeler, I want to measure (and report) the time that an event is true. There is a block, Timer, that measures the time from when the event becomes true. What is unclear is how do I capture the "terminal" value before the timer resets when the condition becomes false.

I've looked through the documentation and examples and am missing how to do what should be a basic function. I can build this as a separate block but was hoping to find a built-in function that does this.

POSTED BY: Mark Ross
4 Replies
Posted 4 years ago

Hi Otto, This is just what I was wanting. Thank you! I was unfamiliar with the "pre" block and the triggered sampler and the combination of those does give me just what I want.

It would be nice if the functionality you provided in your example was a native part of the timer (suggestion for SystemModeler team).

Thanks again,

Mark

POSTED BY: Mark Ross

You can introduce an infinitesimal small delay of the reseting of the timer with a pre block and thereby sample the output signal before it's reseted to zero, see attached model.

Otto

Attachments:
POSTED BY: Otto Tronarp
Posted 4 years ago

Hi Neil

Thank you for asking.

Ideally I want to have an element that monitors the time a state machine is in a particular state and when that state exits I would like a system variable that another block may read. The block in question is going to be a controller and the time is used by that controller.

By way of an example, a ramp slope converter could use the time for a current source to remove the charge from a sample-and-hold capacitor in order to know the voltage. It must know the time for that voltage to reach a known state.

I hope this makes sense.

Regards

Mark

POSTED BY: Mark Ross

Mark,

I am not sure I understand what you want. Can you describe what would be "ideal" for you or show a diagram? The timer block outputs the transition times and the full record during a run is available. You can hold the cursor over any transition and get the time. Are you looking for a text file with a list of transition times?

Regards,

Neil

POSTED BY: Neil Singer
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract