0

get bus number using facts device name

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
Ascegan's avatar
11
Ascegan
asked 2020-01-02 14:33:03 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

2 Answers

0

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

drsgao's avatar
76
drsgao
answered 2020-01-03 08:06:04 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments
0

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"
Ascegan's avatar
11
Ascegan
answered 2020-01-06 16:13:19 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments

Your Answer

Login/Signup to Answer