Please take a minute to review and accept our Terms of Use.
Welcome to the PLECS User Forum, where you can ask questions and receive answers from other members of the community.

Many technical questions regarding PLECS are answered on the Technical Solutions page of our website. Tutorial videos, specific application examples, and pre-recorded webinars are available on our YouTube page. Please follow us on LinkedIn for the latest Plexim news.

What type of blocks can be used to represent repeating sequence and S-Function in plecs.

0 votes
4,854 views
I have a work that needs a reference block and the S-Function block, these two are available blocks in the Matlab library, please what can I use to represent these blocks on plecs?
Thanks.
asked Feb 27, 2023 by Awesome (30 points)

1 Answer

0 votes

The most flexible block for implementing custom code (similar to S-Function) is the C-Script block.  It has a bit of a learning curve if you are not familiar with C.  I would recommend you read the manual if you want to use some of the more advanced features, but for simple algebraic expressions it should be straightforward.  There also is a tutorial on the website about how to use the C-Script block for implementing controllers: https://plexim.com/support/tutorials

There also is a “function” block which allows you to implement simple one liner functions using C syntax.  Take a look at the help documentation of this component to see what arithmetic functions it supports.

If your S-Function just has basic arithmetic, you can also use standard blocks from the PLECS Library (Product, Divide, Math Function, etc.)

answered Mar 14, 2023 by Bryan Lieblick (1,905 points)
...