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.

Exporting Scope Data as .CSV using XML-RPC

0 votes

I am using Python 3.6.7 XML-RPC library to interface with PLECS 4.2.5 standalone. I am looping through multiple "steady-state analysis" simulations which will show only one (though configurable) period at the end of the simulation once steady-state has been reached.

I'd like to export the scope data to a .CSV file for post-processing. Although there is a way to export scope data when scripting within the PLECS standalone, there doesn't seem to be a way to do so outside the PLECS scripting environment such as through the XML-RPC interface of Python.

In the PLECS standalone scripting environment, the command is:

plecs('scope', 'scopePath', 'ExportCSV', 'fileName')

I would have thought that executing the following command through XML-RPC would have worked but it doesn't.

server.plecs.scope('scopePath', 'ExportCSV', 'fileName')

The closest command that DOES work is just replacing the 'ExportCSV' command above with 'SaveTraces'. However, this generates a .TRACE file that can only be interpreted by PLECS scope and isn't readable in a typical text editor for post-processing.

asked Jan 18, 2019 by groberts (16 points)

1 Answer

+2 votes
Best answer
You are correct, there is no command to export CSVs from a scope using XML-RPC. You can either use a "ToFile" block to create CSVs or place a signal outport on the top level schematic to receive the simulation data in Python directly.

Kind regards,

Oliver Schwartz
answered Jan 22, 2019 by Oliver Schwartz (622 points)
selected Feb 11, 2019 by groberts
can you please clarify better how to redirect the AC analysis result ToFile or to signal output?