Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarification on how Holder block works #58

Closed
gabrielenava opened this issue Oct 26, 2017 · 5 comments
Closed

Clarification on how Holder block works #58

gabrielenava opened this issue Oct 26, 2017 · 5 comments

Comments

@gabrielenava
Copy link
Collaborator

I did the following test: a ramp signal (starting ramp value: 10) is sent into a subsystem, containing an HOLDER block. Every 2 seconds, the subsystem containing the HOLDER is enabled/disabled for a period of 1s each. See pictures attached.

screenshot from 2017-10-26 11-50-39

Inside the subsystem:

screenshot from 2017-10-26 11-52-01

These are the output: (Simulation time: 30s)

  • Signal sent to the ENABLE block:

screenshot from 2017-10-26 11-54-13

  • Ramp signal (no HOLDER)

screenshot from 2017-10-26 11-54-30

  • Ramp signal passing through the HOLDER block

screenshot from 2017-10-26 11-54-46

Now we know that the output of HOLDER block will always be the first value sent to the block. Maybe this may be an issue for some applications.

@francesco-romano
Copy link
Collaborator

Thanks @gabrielenava
I think that it may be worthwhile to move the implementation of the Holder block to c++ (the implementation is trivial).

Currently blocked by #46

@S-Dafarra
Copy link
Collaborator

This is not a problem of Holder block, but rather it is an intended behavior of the Enable Simulink block.
If you select reset from the drop menu in the options of the Enable block, the internal state of the Holder block is reset when enabled, thus changing the value of the Holder with the new one.
image

@francesco-romano
Copy link
Collaborator

Thanks @S-Dafarra.
I knew about that option, but I don't know if @gabrielenava tried it. @gabrielenava can you try if the holder block still exhibits the same problem with this option changed?

@gabrielenava
Copy link
Collaborator Author

No it doesn't. I didn't know about this option, changing it solves the issue.

@francesco-romano
Copy link
Collaborator

Great. For the time being this can remain as simple matlab code if it is compatible with code generation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants