Ask Your Question

sliderPy - GetMapString doesn't work in PSSE34

asked 2019-05-06 07:31:15 -0500

Peter81 gravatar image

I want to extract line data (From Bus, To Bus and ID) in a Python script after selecting a line in the SLD and then running the script. It works as intended in PSSE 33 but not in PSSE 34. I am using sliderPy and GetMapString, se script below.

Python script:

import sliderPy

mydoc = sliderPy.GetActiveDocument()
mydiagram = mydoc.GetDiagram()
mycomponents = mydiagram.GetComponents()

for mycomponent in mycomponents:
    if mycomponent.IsSelected() == True:
            print 'Type: {0}'.format(mycomponent.GetComponentType())
            print 'MapString: {0}'.format(mycomponent.GetMapString())

For example, lets use savnw.sav and savnw.sld in both PSSE 33 and PSSE 34. When selecting the line between bus 3006 and bus 153 the result will be as follows:

In PSSE 33:

Type: Link
MapString: LI    153   3006 1

In PSSE 34 (klicking the mid point):

Type: Symbol

In PSSE 34 (Klicking on the line next to the mid point):

Type: Symbol
Type: Link

Do observe that if you right click on the line in the SLD and select "item Properties -> Map String..." you can see that the Map String is shown as intended in PSSE 34:

LII    153   3006 1
  • Why can't I use "GetMapString" from sliderPy in PSSE34?
  • Is there a new updated command for this or is this a bug in PSSE 34?
  • If there is another way, how do I extract the Map String in PSSE 34?
edit retag flag offensive close merge delete


This seems to be a bug to be reported to Siemens-PTI.

perolofl gravatar imageperolofl ( 2019-05-06 09:58:40 -0500 )edit

I agree that it looks like a bug. For that I am not suprise since I found some API functions for getting indution machine data are not implemented and always return 'None'.

drsgao gravatar imagedrsgao ( 2019-05-08 04:38:51 -0500 )edit

Thanks for your comments! I have created an account on the new Siemens PTI Customer Care portal and will add a "Support Ticket" regarding this. As soon as I get an answer from them I will tell you.

Peter81 gravatar imagePeter81 ( 2019-05-09 05:55:36 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2019-05-24 02:53:41 -0500

Peter81 gravatar image

The answer I got from Siemens PTI was the following:

The mapstring representation has changed in PSSE 34 where maptring values are an encoded 28 byte structure. When calling GetMapString() via the sliderPy Python module, the returned result is now this byte encoded string. When using PSSE interactively, this still holds true but the value is translated into something similar to: LII 153 3006 1

You can translate these new values programmatically. The bytes returned are in this order after calling mycomponent.GetMapString():

int (4 bytes) struct size
int (4 bytes) type
1 byte copy id
3 bytes reserved
int (4 bytes) bus number / from bus number
int (4 bytes) to bus number
int (4 bytes) last bus number
char (2 bytes) ID
char (1 byte) OPF Branch Flow ID
1 byte reserved

Alternatively, for DC lines and FACTS devices, the last 16 bytes are the name of the device instead of the bus numbers and IDs.

I don't know how to translate these new values. If anyone here know how to do this, please add an answer to this thread.

Siemens also informed me that they have a new module which is still a work in progress. The new module is called pssetag and would allow you to translate the byte encoded mapstring into a format similar to PSSE 33. I will return with more information regarding this when I have tested the new module.

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

1 follower


Asked: 2019-05-06 07:31:15 -0500

Seen: 33 times

Last updated: 5 hours ago