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

Ask Your Question
0

Connection between Python and an already running PSSE-process

asked Sep 29 '15

Gusimurrvl gravatar image

updated Sep 30 '15

Hello.

Ok. So I opened up a PSSE-process manually in windows. Is there a way to connect to this PSSE-process from my python program so that I can collect its data thats in the working case?

Calling psspy.psseinit() is not the answer because it initializes a new PSSE-process which is run in the background and that I can't see graphically.

I want to be able to access the data from the manually started graphical PSSE-process from Python. If there is no way of doing that, is there then a way of initializing a new PSSE-process (psseinit()) and then making this PSSE-process run open, graphically, in Windows? I don't want to have it running in the background.

The idea of my program is to let PSSE modify the network graphically with split bus, switch off line and other commandos and what the python part is to do it so tell PSSE when to make Fault calculations and then collect the fault data and present it graphically in my own python program instead of as text it the PSSE Output Bar.

Kind regards

2 answers

Sort by » oldest newest most voted
0

answered Sep 29 '15

jconto gravatar image

updated Sep 30 '15

Assuming P1 is the python code running the main process and P2 running the short circuit calculations, then just bypass the opening of the *.sav case in your P2 code. Then P2 should work with whatever case in is memory (P1 and the working case). You can add your P2 code to P1 or you can call it from within P1 using the execfile() python command. There is no need to open a second PSSe instance in its GUI.

When having two PSSe instances (in GUI or not), there is no way for either instance to talk to the other to get data other than through saving data externally (*.txt, *.csv)

link

Comments

Thanks for your answer but after some thinking I realised I asked the wrong question. I've edited the question now. @jconto

Gusimurrvl gravatar imageGusimurrvl (Sep 30 '15)

update my initial response as well. Let's keep trying if not satisfied.

jconto gravatar imagejconto (Sep 30 '15)

Ok. Check. I cant communicate between different instances of PSSE. Won't try to any more. Do you know if its possible to open the PSSE instance graphically that was initiated when calling psseinit() from python? I cant find the PSSE instance in the windows task bar list even though its running.

Gusimurrvl gravatar imageGusimurrvl (Oct 1 '15)

Once you start a run from python and call psseinit(), PSSe is 'not loaded' but all its functions are available through the API. In this mode, switching the GUI on/off is not supported. I suggest change the P1 code to run in PSSe GUI mode and from within, call P2.

jconto gravatar imagejconto (Oct 1 '15)

Choice No. 1 for running my program is by opening PSSe GUI and loading my script with "Run automation file". I've been struggeling for 3 days trying to get that to work.

Gusimurrvl gravatar imageGusimurrvl (Oct 2 '15)
0

answered Oct 5 '15

Gusimurrvl gravatar image

What I learned:

  1. PSSE Version 33.4 contains a bug so that you can't import module wx or cmath without getting ImportError respectively making PSSE and Python crash. The bug is fixed in version 33.5 and 33.6 of PSSE so update your version of PSSE if you run into the problem. There is no quick-fix for the problem. Update your PSSE version instead!
  2. You can't open PSSE GUI graphically after calling psseinint() from python.
  3. You can't establish contact between an already running GUI PSSe instance and python code EXCEPT via "Run automation File".
link

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

Stats

Asked: Sep 29 '15

Seen: 3,794 times

Last updated: Oct 05 '15