# Exporting Scope Data as .CSV using XML-RPC

**URL:** <https://forum.plexim.com/t/exporting-scope-data-as-csv-using-xml-rpc/613>\
**Category:** PLECS\
**Tags:** python, exportcsv, xml-rpc\
**Created:** [January 17, 2019, 7:51pm UTC](https://forum.plexim.com/t/exporting-scope-data-as-csv-using-xml-rpc/613 "2019-01-17T19:51:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![groberts](https://avatars.discourse-cdn.com/v4/letter/g/b77776/32.png) [@groberts](https://forum.plexim.com/u/groberts)\
**Post date:** [January 17, 2019, 7:51pm UTC](https://forum.plexim.com/t/exporting-scope-data-as-csv-using-xml-rpc/613/1 "2019-01-17T19:51:39Z")

</div>

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:

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

```

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

```auto
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.

---

<div class="post-metadata">

**Author:** ![Oliver\_Schwartz](https://dub1.discourse-cdn.com/flex006/user_avatar/forum.plexim.com/oliver_schwartz/32/6_2.png) [@Oliver\_Schwartz](https://forum.plexim.com/u/Oliver_Schwartz)\
**Post date:** [January 22, 2019, 5:22am UTC](https://forum.plexim.com/t/exporting-scope-data-as-csv-using-xml-rpc/613/2 "2019-01-22T05:22:50Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![tinivella](https://avatars.discourse-cdn.com/v4/letter/t/b77776/32.png) [@tinivella](https://forum.plexim.com/u/tinivella)\
**Post date:** [July 5, 2019, 5:21am UTC](https://forum.plexim.com/t/exporting-scope-data-as-csv-using-xml-rpc/613/3 "2019-07-05T05:21:58Z")

</div>

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

thanks

Ricc

---

<div class="post-metadata">

**Author:** ![vishweshgm](https://dub1.discourse-cdn.com/flex006/user_avatar/forum.plexim.com/vishweshgm/32/2495_2.png) [@vishweshgm](https://forum.plexim.com/u/vishweshgm)\
**Post date:** [March 2, 2026, 9:18am UTC](https://forum.plexim.com/t/exporting-scope-data-as-csv-using-xml-rpc/613/4 "2026-03-02T09:18:25Z")

</div>

Hi, I have same question. How can we use ToFile to output csv on an existing trace file?
