Is it possible to import waveform data into PLECS?

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.

data_import.plecs (8 KB)

data.csv (101 KB)