First time here? We are a friendly community of Power Systems Engineers. Check out the FAQ!
1 | initial version |
@jconto
I appreciate your answer. However, I now see that I didn't make it clear that this code is a part of a loop that runs many times, and doesn't just affect a single transformer. The error above is a sample of a bunch of similar errors.
Therefore the code generated from the recording function doesn't help much.
I am curious - when the generated code gives something like r"""Dyn1""", what is the reason for the r and the triple quotes? Also, is there a function in the API to return the vector group of a transformer?
Thanks for your time.
2 | No.2 Revision |
I have found a nice solution to the problem. I can use the "aTrnChar" function of the API to return a list of vector groups for a subsystem. I just initialized a two-bus subsystem and found the vector group (and name) of the transformer contained inside it:
psspy.bsysinit(9)
psspy.bsyso(9,bus1)
psspy.bsyso(9,bus2)
ierr, xfmrData = psspy.atrnchar(9,1,3,2,1,['XFRNAME','VECTORGROUP'])
xfmrName = xfmrData[0][0]
vectorGroup = xfmrData[1][0]
psspy.two_winding_chng_4(i=bus1],j=bus2,
ckt=circuitID,intgar1 = 0,
charar1 = xfmrName, charar2 = vectorGroup)
I think it's a bit silly that I have to create a subsystem just to find the vector group of a transformer, but that's Siemens for you!
@jconto
I appreciate your answer. However, I now see that I didn't make it clear that this code is a part of a loop that runs many times, and doesn't just affect a single transformer. The error above is a sample of a bunch of similar errors.
Therefore the code generated from the recording function doesn't help much.
I am curious - when the generated code gives something like r"""Dyn1""", what is the reason for the r and the triple quotes? Also, is there a function in the API to return the vector group of a transformer?
Thanks for your time.
3 | fixed typo |
I have found a nice solution to the problem. I can use the "aTrnChar" function of the API to return a list of vector groups for a subsystem. I just initialized a two-bus subsystem and found the vector group (and name) of the transformer contained inside it:
psspy.bsysinit(9)
psspy.bsyso(9,bus1)
psspy.bsyso(9,bus2)
ierr, xfmrData = psspy.atrnchar(9,1,3,2,1,['XFRNAME','VECTORGROUP'])
xfmrName = xfmrData[0][0]
vectorGroup = xfmrData[1][0]
psspy.two_winding_chng_4(i=bus1],j=bus2,
psspy.two_winding_chng_4(i=bus1,j=bus2,
ckt=circuitID,intgar1 = 0,
charar1 = xfmrName, charar2 = vectorGroup)
I think it's a bit silly that I have to create a subsystem just to find the vector group of a transformer, but that's Siemens for you!
@jconto
I appreciate your answer. However, I now see that I didn't make it clear that this code is a part of a loop that runs many times, and doesn't just affect a single transformer. The error above is a sample of a bunch of similar errors.
Therefore the code generated from the recording function doesn't help much.