Ask Your Question

How to get Machine Control Mode information for each generator?

asked 2021-04-14 14:17:12 -0500

DanSmith gravatar image

I would like to know how to retrieve the Machine Control Mode for each generator in PSSE automation. I cam across the function 'amachint' with string 'WMOD' in API documentation but was not successful. Is there any other better way to retrieve this data.

Thanks in advance!!

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2021-04-14 15:24:59 -0500

perolofl gravatar image

First define a function to return the wanted information:

# Function to return ibus, id and wmod in three lists
def get_wmod(sid=-1, flag=4):
    ierr, iarray = psspy.amachint(sid,flag, ['NUMBER','WMOD'])
    ierr2, idarray = psspy.amachchar(sid,flag, ['ID'])
    return iarray[0],idarray[0],iarray[1]

Call get_wmod to get three lists with ibus, id and wmod for all generators and loop through the lists.

ibusl,idl,wmodl = get_wmod()
# Loop through the lists and perform action
for ibus,id,wmod in zip(ibusl,idl,wmodl):
    # do some stuff
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: 2021-04-14 14:17:12 -0500

Seen: 33 times

Last updated: Apr 14