Exporting Scope Data as .CSV using XML-RPC

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.

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

can you please clarify better how to redirect the AC analysis result ToFile or to signal output?

thanks

Ricc