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.

How to name the columns of the csv file exported using 'Scope' or 'To File' ?

0 votes
72 views

I am exporting a csv file using the following probe before a Scope/ToFile block.

The columns of the exported csv file are as shown below.

As you can see there are two columns with the same name 'Capacitor voltage'. When I import this as a table in my MATLAB script for post-processing and analysis, it is a bit difficult to handle this situation. Is there a workaround where the above columns will be named something like 'C1_Capacitor voltage', 'R2_Resistor current', and 'C2_Capacitor voltage'?

asked May 13 by ka (12 points)

2 Answers

0 votes
Hello,

You could place the components of interest inside a Masked Subsystem, and add their respective signals of interest as Mask Probe Signals, with your own custom names. Do you know how to do this?

Regards,
Kris
answered May 13 by Kris Eberle (815 points)

Thanks for the suggestion, Kris!

I was able to do that. Although I have to carefully name each mask signal of my interest.

Let me pick your brain a bit more, please. I have created a masked subsystem out of a simple inductor as shown below.

Is there any way I can name the mask signals with a reference to the 'Path' of the probed component as highlighted red in the above figure? If this is possible, then I can use this masked subsystem as many times as I want in my circuit without worrying to name the probe signals individually. I am kind of hoping there is a solution here.

Hi again,

Unfortunately, I don't think this is possible to include a path reference as part of the signal naming process. You will need to copy the path information into the signal name field manually.

Thanks,

Kris
+1 vote

Hi Kawsar,

I just wanted to update you that this has been fixed in PLECS 4.4.1. Please download the latest version here -- https://www.plexim.com/download. Major new features are highlighted in the release notes.

1. The component signal tied to the Probe block now also displays the component name along with the signal name.



2. The To File block has a new parameter “Write signal names” that lets you choose whether CSV files are written with a header row containing the names of the input signals.

Additionally, there is a new From File block, that reads signal trajectories from CSV or MAT files.

Regards,
Manu

answered Jun 10 by Manu Parimi (209 points)
Thanks for the update Manu! This is very helpful.
...