Ask Your Question
0

get bus number using facts device name

asked 2020-01-02 14:33:03 -0500

Ascegan gravatar image

I used the code below to get a list of FACTS device names (not dynamic model names). How can I retrieve the bus # for each loadflow model?

    ierr = psspy.inifax()
    ierr, nextfax = psspy.nxtfax()
    while ierr ==0:
        ierr, nextfax = psspy.nxtfax()
        print nextfax
    return      #exit out of the script
edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
0

answered 2020-01-06 16:13:19 -0500

Ascegan gravatar image

I ended up using a loop. It cycles through all FACTS devices to match a bus # to the name but there are ~ 10 in the case so it is quick. Inelegant escape from the way it exits: either return the bus # or just "not found"

def getname(busnum):
    ierr = psspy.inifax()
    ierr, nextfax = psspy.nxtfax()
    nextbus = ""
    while ierr ==0:
        ierr, nextbus = psspy.fcdint_2(nextfax, 'SEND')         
        if nextbus == busnum:
            #print "found it " + str(nextfax)
            return str(nextfax)
        else:
            ierr, nextfax = psspy.nxtfax()
    return "notfound"
edit flag offensive delete link more
0

answered 2020-01-03 08:06:04 -0500

drsgao gravatar image

Why not just the subsystem data retrieval APIs? Check chapter 8 of the API manual. It is either the "aFactsInt" or "aFactsBusInt" API.

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

Stats

Asked: 2020-01-02 14:33:03 -0500

Seen: 666 times

Last updated: Jan 06 '20