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.

Is it possible to import waveform data into PLECS?

+2 votes
I have a time-dependent signal from an external analysis that I would like to use as a source in my model.
asked Jan 17 by Plexim Support Team (87 points)

1 Answer

+3 votes
Best answer
It is possible in PLECS to import data obtained from an offline analysis, via post-processing, or from an external means, such as a real oscilloscope. If the data is saved in a comma separated value (.csv) format, it can easily be read into lookup table blocks in PLECS that are used as sources for direct viewing in a Scope or to drive actuators.

In the attached PLECS Standalone model example, a Waveform Generator subsystem has been developed to demonstrate this functionality and which can easily be modified for custom use cases. In the subsystem's initialization commands (Ctrl+M) it can be seen that the current simulation time signal from a Clock block is provided as the input values x to two 1D Lookup Tables. These inputs provide the index mapping to output values f(x). In this case, two columns of waveform data captured from two channels of an actual scope, are stored in a separate spreadsheet file called ‘data.csv’.

One should view the subsystem mask initialization commands (Ctrl+M, see the ‘Parameters’ tab) to fully understand the implementation. The user is able to scale up the number of plots easily should a data file contain more column data, and can also use a Multiplexer block to combine waveforms into the same plot window.
answered Jan 17 by Plexim Support Team (87 points)
edited Jan 18 by Plexim Support Team