Is there any way to create a custom plot by C-block

Hi All,

As some may aware, I have developed an FRA that is similar to practical hardware FRA.

However, the downside of my FRA implementation is, the result is only stored in .txt file, and the result must be plotted manually by copying the result into excel then plot it.
Or another alternative is to control the simulation by Python and use the python to read the .txt result file automatically.

My question: is there any way to automate the plotting for this FRA method?
or in general, is there any way to use C-block to create a simulation data which then use the Qspice to invoke that data and plot it?

Arief,

Automatic way? No, i do not think so.
There is a manual way, but needs csv file, see from 11:20 min:

Only, as You already said, to import that .txt file into Python, matlab, etc, and to make a script/code that plot automatically only by reading that .txt file and running the code in Python, matlab, etc

In standard QSpice simulations, when you run a simulation, you can export the data into .csv or ASCII SPICE format from the waveform viewer. Though I have never tried it, you can attempt to write data with DLL block directly into a .csv file with the exact format of QSpice exported output. This might enable you to use the waveform viewer to open that .csv file and generate a plot. Similar to exporting data from the waveform viewer into a .csv file, you can load that .csv file. exported csv with two format, real or complex (R,X).

However, you will need to manually load the .csv file from the waveform viewer. But it may prevent get use of other software for data plot.

1 Like

Hi,

This might be what KSKelvin mentioned, but it’s coded in Verilog. :sweat_smile:

3 Likes

Thanks Kelvin as always

It’s easy for me to create multiple file format…so I am not worry about compatibility.

Anyway, is there anyway to tell the Qspice to automatically open that .qraw or .csv file and plot it?

@Engelhardt , will it be feasible to consider adding a command in schematic to open some output file then plot it at the end of the simulation?