0

Using api "pssplot.channelfileexcelexport()" rasise error

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.

AlexYang's avatar
1
AlexYang
asked 2018-05-18 08:01:39 -0500, updated 2018-05-18 08:02:45 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

2 Answers

0

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.

perolofl's avatar
3.8k
perolofl
answered 2018-05-18 09:41:13 -0500
edit flag offensive 0 remove flag delete link

Comments

thanks! I have solved it.

AlexYang's avatar AlexYang (2018-05-20 03:53:00 -0500) edit

How? can you post your code?

jconto's avatar jconto (2018-05-21 17:58:30 -0500) edit
add a comment see more comments
0

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
AlexYang's avatar
1
AlexYang
answered 2018-05-21 19:51:20 -0500, updated 2018-05-21 20:01:02 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments

Your Answer

Login/Signup to Answer