+3 votes
106 views
in Modeling by Ioannis Poursanidis (45 points)
Hello community,

I am building from scratch a control logic in Typhoon HIL control center (THCC) having as a basis a Simulink model.

I am encountering an issue with a block element that is not present in THCC. The block element is called "Weighted Sample Time" and it's used in the following cases: "Add, subtract, multiply or divide the input signal by weighted sample time or just output weighted sample time or weighted sample rate."

Any suggestion on how to deal with this issue would be highly appreciated.

1 Answer

+4 votes
by Jovan Zelic (116 points)
selected by Ioannis Poursanidis
 
Best answer

Hi Ioannis,

You can use C function block to implement such functionality. (documentation)

execution_rate variable can be used in your C code, since it stores the value of the sample time. For example, if you want to add the sample time to the input, your output function would be:

out = in + execution_rate;

That should do the trick, since you can design your own function any way you like.

BR
Jovan

...