Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I believe the following code will do the work:

# Get 3W data in arrays
sid = -1    
ierr, lbuses = psspy.awndint(sid,ties=3, flag=3, entry=2,string=['WIND1NUMBER','WIND2NUMBER','WIND3NUMBER','WNDNUM'])
ierr, sarray = psspy.awndchar(sid,ties=3, flag=3, entry=2,string=['ID'])
ierr, rarray = psspy.awndreal(sid,ties=3, flag=3, entry=2,string=['RATEA'])

# Print arrays with one 3w-transformer per row
print '   IBUS    JBUS    KBUS  ID   Winding-1  Winding-2  Winding-3'
for i,ibus in enumerate(lbuses[0]):
    # with entry=2 winding data should be in order 1,2,3,1,2,3,1,2,3,etc in the arrays
    winding = lbuses[3][i]
    # print IBUS, JBUS, KBUS, ID, W1-rate, W2-rate, W3-rate
    if winding==1: print '%7i %7i %7i  %2s  %8.1f   %8.1f   %8.1f' % (ibus,lbuses[1][i],lbuses[2][i],sarray[0][i],rarray[0][i],rarray[0][i+1],rarray[0][i+2])

You can change print statement to write and get a CSV-file for import into Excel.