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

Ask Your Question
0

How to output in a readable format the monitoring in PSS/E

asked May 4 '19

toderesa97 gravatar image

I have this script:

CASE = r'''C:\\Program Files (x86)\\PTI\\PSSE34\\EXAMPLE\\savnw.sav'''
psspy.case(CASE)

# Convert loads (3 step process):
psspy.conl(-1,1,1)
psspy.conl(-1,1,2,[0,0],[100,0,0,100])
psspy.conl(-1,1,3)

# Convert generators:
psspy.cong()

# Solve for dynamics
psspy.ordr()
psspy.fact()
psspy.tysl()

# Add dynamics data
psspy.dyre_new(dyrefile="C:\\Program Files (x86)\\PTI\\PSSE34\\EXAMPLE\\savnw.dyr")

# Add channels by subsystem
#   BUS VOLTAGE
psspy.chsb(sid=0,all=1, status=[-1,-1,-1,1,13,0])

# Initialize
psspy.strt(outfile="test.out")   <----------------------------------------------
simtime = 1
#psspy.run(tpause=simtime)
psspy.run(0,simtime,99,19,0)

but turns out that the test.out file is in binary and hence, cannot be interpreted directly but just for PSS/E. I was wondering whether there is a way to output such content in a readable format, such as .csv, .xlxs,... to treat it. If not, could you come up with an idea to deal with this situation?

Thanks for your time.

Tomás.

2 answers

Sort by » oldest newest most voted
0

answered May 7 '19

jconto gravatar image

Check the python code "dyntools_demo.py" located in the "example" folder, to extract (all or selected) channels in an *.out file. To get a description of the functions available in "dyntools.pyc", run the following code:

#display help in module dyntools.pyc
import psse33
import dyntools
help(dyntools)
link
0

answered May 6 '19

perolofl gravatar image

You can export to Excel in the GUI:

  1. Open .out file
  2. Right click the file in Plot Tree View and select "Export to Excel"
  3. All channels are now written to a .xlsx file.

Unfortunately, there is no API to perform the action from python.

link

Comments

Thank you for replying. Unfortunately, that's not a valid solution for me. Do you know if there is a way to ask for the monitoring data through the python API?

toderesa97 gravatar imagetoderesa97 (May 6 '19)

You can open the .out file with dyntools and write the channel values to .csv or an excel file using for example excelpy.

perolofl gravatar imageperolofl (May 6 '19)

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 4 '19

Seen: 709 times

Last updated: May 07 '19