Ask Your Question
0

Connection between Python and an already running PSSE-process

asked 2015-09-29 08:41:44 -0500

Gusimurrvl gravatar image

updated 2015-09-30 11:02:22 -0500

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

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
0

answered 2015-09-29 09:40:28 -0500

jconto gravatar image

updated 2015-09-30 15:06:05 -0500

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)

edit flag offensive delete link more

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 ( 2015-09-30 11:09:20 -0500 )edit

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

jconto gravatar imagejconto ( 2015-09-30 15:07:12 -0500 )edit

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 ( 2015-10-01 09:07:46 -0500 )edit

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 ( 2015-10-01 10:08:03 -0500 )edit

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 ( 2015-10-02 03:15:35 -0500 )edit
0

answered 2015-10-05 05:44:03 -0500

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".
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Question Tools

Stats

Asked: 2015-09-29 08:41:44 -0500

Seen: 3,730 times

Last updated: Oct 05 '15