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.

How to insert a phase delay value calculated during a running simulation to a delay or any other block?

0 votes
97 views
Hi

How can I insert a variable calculated during a simulation to block. I know, we can write the initialization commands and the blocks pick up the variable value. But I want my circuit to sense the current and calculate the time values and provide that as a delay to the block.

Fig attached.

I want to provide a delay 't1' for my pulse2 i.e. pulse2 should start after pulse1. Either I should be able to provide delay t1 to the sawtooth waveform as shown or I use a delay block. But Plecs throws an error, as it does not pick the value from running simulation.

Can you please help?
asked Feb 13 by snehathakur (48 points)

1 Answer

0 votes
 
Best answer
You cannot change block parameters at runtime.

To get the desired behavior, the turn-on block needs to be rewritten so that the delay is read from an input signal. This can be realized using a C-Script, please see the attached example.

Kind regards,

Oliver Schwartz
answered Feb 27 by Oliver Schwartz (273 points)
selected Mar 2 by snehathakur
Thank You Oliver.
...