First time here? We are a friendly community of Power Systems Engineers. Check out the FAQ!

Ask Your Question
0

Using api "pssplot.channelfileexcelexport()" rasise error

asked May 18 '18

AlexYang gravatar image

updated May 18 '18

what I want: I want to export my .out file to Excel file by using [Run Automation File] button or python command.

what I do: I click Button [Start Recording], save a python file "out2excel.py". then I open my output file "t007.outx" in PSSE's GUI, and I right-click [t007] in left Plot Tree->Plot Data->Channel Files, then the corresponding excel window open successfully. I find api "pssplot.channelfileexcelexport()" is the key to export.out/.outx file to Excel file.

what error: When I restart PSSE, click [Run Automation File], select "out2excel.py" to do 'auto export' operation, some errors show in Output Bar:

  Call failed (result is null)
    Traceback (most recent call last):
      File ".\dyntools.py", line 2427, in _xlsout
      File ".\dyntools.py", line 1023, in __init__
      File ".\dyntools.py", line 351, in _outextract_data
      File ".\dyntools.py", line 321, in _outextract_id
    Exception: ERROR ... File c:\users\yang\documents\pti\psse34\test-ieee\1-9bus-test\t007.outx version is 1.47195436916e+19
        dyntools handles version 2.0 files only.

I copy python script: pssplot.channelfileexcelexport(r"""C:\Users\Yang\Documents\PTI\PSSE34\test-IEEE\1-9Bus-test\t007.outx""")to Command Line Input, the same error still exists.

My PSSE verion is v34, my python version is 2.7, and other automation operationlike 'open case data, do power flow solution' can be performed normally.

So how can I perform this api to export.out file to Excel file successfully? Thank you for helping.

2 answers

Sort by » oldest newest most voted
0

answered May 22 '18

AlexYang gravatar image

updated May 22 '18

This is my solution:

1.If you run simulation in PSSe GUI, you have to go for Dynamic -> Simulation options -> Simulation, check out [Extended file (support DVRM)] in Channel output file type before you create .out file(actually .outx file is available). Then you will find the .out file (or .outx file) can be read by dyntool.

2.If your simulation run outside the PSSe GUI like using python script, use:

psspy.set_chnfil_type(0)     # 1 for OUTX format, 0 for (old) OUT format
psspy.strt_2([0,1],outfile)  # create out file, .out/.outx file are available if type is 0
link
0

answered May 18 '18

perolofl gravatar image

API channelfileexcelexport is using module dyntools for the export to Excel while performing the export interactively in PSSE seems to use some other software. The Excel books created by the two methods are not identical.

Your problem is that dyntools in your revision of PSSE don't support .outx files, only .out files. You have to either upgrade to version 34.4 or save the simulation results in the older .out format.

link

Comments

thanks! I have solved it.

AlexYang gravatar imageAlexYang (May 20 '18)

How? can you post your code?

jconto gravatar imagejconto (May 21 '18)

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.
Want to format code in your answer? Here is a one minute demo on Youtube

Add Answer

[hide preview]

Question Tools

1 follower

Stats

Asked: May 18 '18

Seen: 1,133 times

Last updated: May 21 '18