I would like to know how to get a recloser or a switch status if 0 or 1 since 1 is closed, 0 is opened I believe because when I do the command in DSTCP python :
Recloser5 = ODGTCP.getSwitchesStatus()
or even by selecting the recloser itself
Currently, the command ODGTCP.getSwitchesStatus() will return a list of first the status if all enabled switches and then there names. (In a future release it will return a nested list, with the first list containing the statuses and the second list the names.)
It appears that the function is returning the status of five switches, all open, and then their names. The other five switches that are not appearing in the list may be disabled. Something similar to this in the DSS line definition:
New "Line.testline_switch" phases=3 bus1=testbus1.1.2.3 bus2=testbus2.1.2.3 Switch=True enabled=False
If they are disabled, they are not part of the circuit definition in OpenDSS. You will want to change all the line definitions of the switches to:
enabled=True
And the switch control to:
New SwtControl.test_control SwitchedObj=line.testline_switch Normal=Closed
OR
New SwtControl.test_control SwitchedObj=line.testline_switch Normal=Open
Depending on it's default status.
Let me know if that helps.
Regards,
Alex
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The colors can be confusing at first. In OpenDSS-G v2: red=closed and green=open. This follows more traditional colors from HMI screens in transmission/distribution control centers. I belive one of the original ideas behind the colors was: red means danger, i.e. the device is energized, and green means safe, i.e. the device is deenergized.
For the results, a "0" means the switch (a recloser in this case) is open.
If you are still having problems, please post a few of your line and control definitions of your switches (reclosers and ties). This will help see what is going on.
Alex
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I really do appreciate the reply in details, I tried your solutions, but I did not succeed to get what I want. So I have decided to share parts of my code:
first the line (code for dss):
New "Line.l1" bus1=sourcebus bus2=node2 phases=3 r1=0.0922 x1=0.047 emergamps=400
New "Line.l2" bus1=node2 bus2=node3 phases=3 r1=0.493 x1=0.2511 emergamps=400
New "Line.l3" bus1=node3 bus2=node4 phases=3 r1=0.366 x1=0.1864 emergamps=400
New "Line.l4" bus1=node4 bus2=node5 phases=3 r1=0.3811 x1=0.1941 emergamps=400
New "Line.l5" bus1=node5 bus2=node6 phases=3 r1=0.819 x1=0.707 emergamps=400
New "Line.l6" bus1=node6 bus2=node7 phases=3 r1=0.1872 x1=0.6188 emergamps=300
New "Line.l7" bus1=node7 bus2=node8 phases=3 r1=0.7114 x1=0.2351 emergamps=300
New "Line.l8" bus1=node8 bus2=node9 phases=3 r1=1.03 x1=0.74 emergamps=200
New "Line.l9" bus1=node9 bus2=node10 phases=3 r1=1.044 x1=0.74 emergamps=200
New "Line.l10" bus1=node10 bus2=node11 phases=3 r1=0.1966 x1=0.065 emergamps=200
New "Line.l11" bus1=node11 bus2=node12 phases=3 r1=0.3744 x1=0.1238 emergamps=200
New "Line.l12" bus1=node12 bus2=node13 phases=3 r1=1.468 x1=1.155 emergamps=200
New "Line.l13" bus1=node13 bus2=node14 phases=3 r1=0.5416 x1=0.7129 emergamps=200
New "Line.l14" bus1=node14 bus2=node15 phases=3 r1=0.591 x1=0.526 emergamps=200
New "Line.l15" bus1=node15 bus2=node16 phases=3 r1=0.7463 x1=0.545 emergamps=200
New "Line.l16" bus1=node16 bus2=node17 phases=3 r1=1.289 x1=1.721 emergamps=200
New "Line.l17" bus1=node17 bus2=node18 phases=3 r1=0.732 x1=0.574 emergamps=200
New "Line.l18" bus1=node2 bus2=node19 phases=3 r1=0.164 x1=0.1565 emergamps=200
New "Line.l19" bus1=node19 bus2=node20 phases=3 r1=1.5042 x1=1.3554 emergamps=200
New "Line.l20" bus1=node20 bus2=node21 phases=3 r1=0.4095 x1=0.4784 emergamps=200
New "Line.l21" bus1=node21 bus2=node22 phases=3 r1=0.7089 x1=0.9373 emergamps=200
New "Line.l22" bus1=node3 bus2=node23 phases=3 r1=0.4512 x1=0.3083 emergamps=200
New "Line.l23" bus1=node23 bus2=node24 phases=3 r1=0.898 x1=0.7091 emergamps=200
New "Line.l24" bus1=node24 bus2=node25 phases=3 r1=0.896 x1=0.7011 emergamps=200
New "Line.l25" bus1=node6 bus2=node26 phases=3 r1=0.203 x1=0.1034 emergamps=200
New "Line.l26" bus1=node26 bus2=node27 phases=3 r1=0.2842 x1=0.1447 emergamps=200
New "Line.l27" bus1=node27 bus2=node28 phases=3 r1=1.059 x1=0.9337 emergamps=200
New "Line.l28" bus1=node28 bus2=node29 phases=3 r1=0.8042 x1=0.7006 emergamps=200
New "Line.l29" bus1=node29 bus2=node30 phases=3 r1=0.5075 x1=0.2585 emergamps=200
New "Line.l30" bus1=node30 bus2=node31 phases=3 r1=0.9744 x1=0.963 emergamps=200
New "Line.l31" bus1=node31 bus2=node32 phases=3 r1=0.3105 x1=0.3619 emergamps=200
New "Line.l32" bus1=node32 bus2=node33 phases=3 r1=0.341 x1=0.5302 emergamps=200
New "Line.l33" bus1=node21 bus2=node8 phases=3 r1=2 x1=2 emergamps=200 Switch=True enabled=False
New "Line.l34" bus1=node9 bus2=node15 phases=3 r1=2 x1=2 emergamps=200 Switch=True enabled=False
New "Line.l35" bus1=node12 bus2=node22 phases=3 r1=2 x1=2 emergamps=200 Switch=True enabled=False
New "Line.l36" bus1=node18 bus2=node33 phases=3 r1=0.5 x1=0.5 emergamps=200 Switch=True enabled=False
New "Line.l37" bus1=node25 bus2=node29 phases=3 r1=0.5 x1=0.5 emergamps=200 Switch=True enabled=False
New "Line.rcl_2to19" phases=3 bus1=node2.1.2.3 bus2=node19.1.2.3 Switch=True enabled=True
New "Line.rcl_3to23" phases=3 bus1=node3.1.2.3 bus2=node23.1.2.3 Switch=True enabled=True
New "Line.rcl_6to26" phases=3 bus1=node6.1.2.3 bus2=node26.1.2.3 Switch=True enabled=True
New "Line.rcl_6to7" phases=3 bus1=node6.1.2.3 bus2=node7.1.2.3 Switch=True enabled=True
New "Line.main_cb" phases=3 bus1=sourcebus.1.2.3 bus2=node2.1.2.3 Switch=True enabled=True
as for the switches (dss) :
New "SwtControl.switch1" SwitchedObj=line.l33 Normal=Open
New "SwtControl.switch2" SwitchedObj=line.l34 Normal=Open
New "SwtControl.switch3" SwitchedObj=line.l35 Normal=Open
New "SwtControl.switch4" SwitchedObj=line.l36 Normal=Open
New "SwtControl.switch5" SwitchedObj=line.l37 Normal=Open
and the reclosers :
New "Recloser.rcl_2to19" NumFast=4 MonitoredObj=line.rcl_2to19 SwitchedObj=line.rcl_2to19 Action=Close Normal=Closed
New "Recloser.rcl_3to23" NumFast=4 MonitoredObj=line.rcl_3to23 SwitchedObj=line.rcl_3to23 Action=Close Normal=Closed
New "Recloser.rcl_6to26" NumFast=4 MonitoredObj=line.rcl_6to26 SwitchedObj=line.rcl_6to26 Action=Close Normal=Closed
New "Recloser.rcl_6to7" NumFast=4 MonitoredObj=line.rcl_6to7 SwitchedObj=line.rcl_6to7 Action=Close Normal=Closed
New "Recloser.main_cb" Reset=1.000000 MonitoredObj=line.main_cb SwitchedObj=line.main_cb Action=Close Normal=Closed
and for the python code to get the switch status :
As stated above you will NOT receive any status information on switch1-switch5 because the line objects are set to enabled=Falseand not enabled=True in the line definitions. Take switch1 for example:
New "Line.l33" ... Switch=True enabled=False
Compare that to the line object definitions for the reclosers which are returning a status through the function call. Take rcl_2to19 for example:
New "Line.rcl_2to19" ... Switch=True enabled=True
I am not sure what you mean by:
The result is always : [b'0', b'0', b'0', b'0', b'0', b'rcl_2to19', b'rcl_3to23', b'rcl_6to26', b'rcl_6to7', b'main_cb']
only the very first line is : [b'1', b'1', b'1', b'1', b'1', b'rcl_2to19', b'rcl_3to23', b'rcl_6to26', b'rcl_6to7', b'main_cb']
Do you mean the reclosers are tripping/opening at the start of the simulation?
It appears that you have not provided a TCC Curve Object to the recloser control. A lot of the options default to 1.0 for the recloser control. The current may be too high and the reclosers are tripping offline.
I would recommend reading the Recloser, Relay, and Fuse documentation for OpenDSS and take a look at the IEEE 123-Bus FLISR example which I believe is included with OpenDSS-G.
If you do not need the reclosers to trip offline automatically, you can just define the controls as switches and control them with your own algorithm manually.
Alex
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Also, yes at the beginning of the simulation it is 11111 and then next step size it becomes 0 0 0 0 0. In case of an over current or a high current and let's say the Reclosers trip, the current would be 0, and the lines would be de-energized. However, the current is still functional normally, with energy and loads perfectly running. EXCEPT: the status of the switches or reclosers is always 0.
We used the create PDE element option to create reclosers from opendss-G.
P.S: When is the new version going to be released ?
Best Regards,
Dhiaa.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Looking back at your line defintions, I see that you have multiple lines going between the same buses. For example:
New "Line.l6" bus1=node6 bus2=node7 phases=3 ...
New "Line.rcl_6to7" phases=3 bus1=node6.1.2.3 bus2=node7.1.2.3 ...
Anything downstream will still be connected through Line.l6 even if Line.rcl_6to7 is open. You will need to create a new bus and change the bus1=/bus2= assignments to corespond, if you want Line.l6 and Line.rcl_6to7 to be in series.
My recomendation would be two fold. One, go back and look over your circuit layout and make sure everything is connected correctly, no shortcircuits, unexpected loops, etc. (There are various options in OpenDSS to check all the connections, e.g. Show Loops.) And two, make sure you are configuring the reclosers to trip as you expect or use standard switches as I mentioned in an above post.
Alex
Last edit: A Melhorn 2020-04-16
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Dear All,
If anyone can help me that would be so great.
I would like to know how to get a recloser or a switch status if 0 or 1 since 1 is closed, 0 is opened I believe because when I do the command in DSTCP python :
Recloser5 = ODGTCP.getSwitchesStatus()
or even by selecting the recloser itself
I get :
[b'0', b'0', b'0', b'0', b'0', b'rcl_2to19', b'rcl_3to23', b'rcl_6to26', b'rcl_6to7', b'main_cb']
which I don't understand, knowing that I have 5 reclosers and 5 tie switches which I am not getting obviously in the results.
Please help me.
Best Regards,
Dhiaa.
Dhiaa,
Currently, the command ODGTCP.getSwitchesStatus() will return a list of first the status if all enabled switches and then there names. (In a future release it will return a nested list, with the first list containing the statuses and the second list the names.)
It appears that the function is returning the status of five switches, all open, and then their names. The other five switches that are not appearing in the list may be disabled. Something similar to this in the DSS line definition:
If they are disabled, they are not part of the circuit definition in OpenDSS. You will want to change all the line definitions of the switches to:
And the switch control to:
OR
Depending on it's default status.
Let me know if that helps.
Regards,
Alex
Dear Alex,
Thank you so much for the reply.
A quick question, does this apply on the reclosers ?
since in the result it is showing 0 0 0 0 0
even tho in opendss-g it is in green ? does green mean open or close ? also is 0 close or open ??
Best Regards,
Dhiaa.
The colors can be confusing at first. In OpenDSS-G v2: red=closed and green=open. This follows more traditional colors from HMI screens in transmission/distribution control centers. I belive one of the original ideas behind the colors was: red means danger, i.e. the device is energized, and green means safe, i.e. the device is deenergized.
For the results, a "0" means the switch (a recloser in this case) is open.
If you are still having problems, please post a few of your line and control definitions of your switches (reclosers and ties). This will help see what is going on.
Alex
Dear Alex,
I really do appreciate the reply in details, I tried your solutions, but I did not succeed to get what I want. So I have decided to share parts of my code:
first the line (code for dss):
New "Line.l1" bus1=sourcebus bus2=node2 phases=3 r1=0.0922 x1=0.047 emergamps=400
New "Line.l2" bus1=node2 bus2=node3 phases=3 r1=0.493 x1=0.2511 emergamps=400
New "Line.l3" bus1=node3 bus2=node4 phases=3 r1=0.366 x1=0.1864 emergamps=400
New "Line.l4" bus1=node4 bus2=node5 phases=3 r1=0.3811 x1=0.1941 emergamps=400
New "Line.l5" bus1=node5 bus2=node6 phases=3 r1=0.819 x1=0.707 emergamps=400
New "Line.l6" bus1=node6 bus2=node7 phases=3 r1=0.1872 x1=0.6188 emergamps=300
New "Line.l7" bus1=node7 bus2=node8 phases=3 r1=0.7114 x1=0.2351 emergamps=300
New "Line.l8" bus1=node8 bus2=node9 phases=3 r1=1.03 x1=0.74 emergamps=200
New "Line.l9" bus1=node9 bus2=node10 phases=3 r1=1.044 x1=0.74 emergamps=200
New "Line.l10" bus1=node10 bus2=node11 phases=3 r1=0.1966 x1=0.065 emergamps=200
New "Line.l11" bus1=node11 bus2=node12 phases=3 r1=0.3744 x1=0.1238 emergamps=200
New "Line.l12" bus1=node12 bus2=node13 phases=3 r1=1.468 x1=1.155 emergamps=200
New "Line.l13" bus1=node13 bus2=node14 phases=3 r1=0.5416 x1=0.7129 emergamps=200
New "Line.l14" bus1=node14 bus2=node15 phases=3 r1=0.591 x1=0.526 emergamps=200
New "Line.l15" bus1=node15 bus2=node16 phases=3 r1=0.7463 x1=0.545 emergamps=200
New "Line.l16" bus1=node16 bus2=node17 phases=3 r1=1.289 x1=1.721 emergamps=200
New "Line.l17" bus1=node17 bus2=node18 phases=3 r1=0.732 x1=0.574 emergamps=200
New "Line.l18" bus1=node2 bus2=node19 phases=3 r1=0.164 x1=0.1565 emergamps=200
New "Line.l19" bus1=node19 bus2=node20 phases=3 r1=1.5042 x1=1.3554 emergamps=200
New "Line.l20" bus1=node20 bus2=node21 phases=3 r1=0.4095 x1=0.4784 emergamps=200
New "Line.l21" bus1=node21 bus2=node22 phases=3 r1=0.7089 x1=0.9373 emergamps=200
New "Line.l22" bus1=node3 bus2=node23 phases=3 r1=0.4512 x1=0.3083 emergamps=200
New "Line.l23" bus1=node23 bus2=node24 phases=3 r1=0.898 x1=0.7091 emergamps=200
New "Line.l24" bus1=node24 bus2=node25 phases=3 r1=0.896 x1=0.7011 emergamps=200
New "Line.l25" bus1=node6 bus2=node26 phases=3 r1=0.203 x1=0.1034 emergamps=200
New "Line.l26" bus1=node26 bus2=node27 phases=3 r1=0.2842 x1=0.1447 emergamps=200
New "Line.l27" bus1=node27 bus2=node28 phases=3 r1=1.059 x1=0.9337 emergamps=200
New "Line.l28" bus1=node28 bus2=node29 phases=3 r1=0.8042 x1=0.7006 emergamps=200
New "Line.l29" bus1=node29 bus2=node30 phases=3 r1=0.5075 x1=0.2585 emergamps=200
New "Line.l30" bus1=node30 bus2=node31 phases=3 r1=0.9744 x1=0.963 emergamps=200
New "Line.l31" bus1=node31 bus2=node32 phases=3 r1=0.3105 x1=0.3619 emergamps=200
New "Line.l32" bus1=node32 bus2=node33 phases=3 r1=0.341 x1=0.5302 emergamps=200
New "Line.l33" bus1=node21 bus2=node8 phases=3 r1=2 x1=2 emergamps=200 Switch=True enabled=False
New "Line.l34" bus1=node9 bus2=node15 phases=3 r1=2 x1=2 emergamps=200 Switch=True enabled=False
New "Line.l35" bus1=node12 bus2=node22 phases=3 r1=2 x1=2 emergamps=200 Switch=True enabled=False
New "Line.l36" bus1=node18 bus2=node33 phases=3 r1=0.5 x1=0.5 emergamps=200 Switch=True enabled=False
New "Line.l37" bus1=node25 bus2=node29 phases=3 r1=0.5 x1=0.5 emergamps=200 Switch=True enabled=False
New "Line.rcl_2to19" phases=3 bus1=node2.1.2.3 bus2=node19.1.2.3 Switch=True enabled=True
New "Line.rcl_3to23" phases=3 bus1=node3.1.2.3 bus2=node23.1.2.3 Switch=True enabled=True
New "Line.rcl_6to26" phases=3 bus1=node6.1.2.3 bus2=node26.1.2.3 Switch=True enabled=True
New "Line.rcl_6to7" phases=3 bus1=node6.1.2.3 bus2=node7.1.2.3 Switch=True enabled=True
New "Line.main_cb" phases=3 bus1=sourcebus.1.2.3 bus2=node2.1.2.3 Switch=True enabled=True
as for the switches (dss) :
New "SwtControl.switch1" SwitchedObj=line.l33 Normal=Open
New "SwtControl.switch2" SwitchedObj=line.l34 Normal=Open
New "SwtControl.switch3" SwitchedObj=line.l35 Normal=Open
New "SwtControl.switch4" SwitchedObj=line.l36 Normal=Open
New "SwtControl.switch5" SwitchedObj=line.l37 Normal=Open
and the reclosers :
New "Recloser.rcl_2to19" NumFast=4 MonitoredObj=line.rcl_2to19 SwitchedObj=line.rcl_2to19 Action=Close Normal=Closed
New "Recloser.rcl_3to23" NumFast=4 MonitoredObj=line.rcl_3to23 SwitchedObj=line.rcl_3to23 Action=Close Normal=Closed
New "Recloser.rcl_6to26" NumFast=4 MonitoredObj=line.rcl_6to26 SwitchedObj=line.rcl_6to26 Action=Close Normal=Closed
New "Recloser.rcl_6to7" NumFast=4 MonitoredObj=line.rcl_6to7 SwitchedObj=line.rcl_6to7 Action=Close Normal=Closed
New "Recloser.main_cb" Reset=1.000000 MonitoredObj=line.main_cb SwitchedObj=line.main_cb Action=Close Normal=Closed
and for the python code to get the switch status :
import openDSSGTCP as dssTCP
import time
TCP_IP = '127.0.0.1'
TCP_PORT = 6345
BUFFER_SIZE = 20000
ODGTCP = dssTCP.OpenDSSGTCP(TCP_IP, TCP_PORT, BUFFER_SIZE)
ODGTCP.startTCPConnection()
ODGTCP.sendCommand('set time=(0,0) mode=time controlmode=time stepsize=1h number=1')
while True:
The result is always :
[b'0', b'0', b'0', b'0', b'0', b'rcl_2to19', b'rcl_3to23', b'rcl_6to26', b'rcl_6to7', b'main_cb']
only the very first line is :
[b'1', b'1', b'1', b'1', b'1', b'rcl_2to19', b'rcl_3to23', b'rcl_6to26', b'rcl_6to7', b'main_cb']
all I want is the correct status of the reclosers since they are closed meaning 1
and switches should be 0 and if I enable them via a command they should be 1 later on in an application such as FLISR for example.
Please help me as this is a matter of urgency for real.
I appreciate it and thank you so much.
Best Regards,
Dhiaa.
Also i forgot to give you the master file dss :
Clear
New Circuit.examplecircuit
Redirect Vsource.dss
Redirect LoadShape.DSS
Redirect GrowthShape.DSS
Redirect TCC_Curve.DSS
Redirect Spectrum.DSS
Redirect Line.DSS
Redirect Load.DSS
Redirect Transformer.DSS
Redirect Recloser.DSS
Redirect SwtControl.DSS
Redirect Monitor.DSS
MakeBusList
Redirect BusVoltageBases.dss ! set voltage bases
Buscoords buscoords.dss
I would appreciate if you find any errors I am commiting in creating things you would advise me .
Thank you so much.
Dhiaa.
Dhiaa,
As stated above you will NOT receive any status information on switch1-switch5 because the line objects are set to
enabled=False
and notenabled=True
in the line definitions. Take switch1 for example:Compare that to the line object definitions for the reclosers which are returning a status through the function call. Take rcl_2to19 for example:
I am not sure what you mean by:
Do you mean the reclosers are tripping/opening at the start of the simulation?
It appears that you have not provided a TCC Curve Object to the recloser control. A lot of the options default to 1.0 for the recloser control. The current may be too high and the reclosers are tripping offline.
I would recommend reading the Recloser, Relay, and Fuse documentation for OpenDSS and take a look at the IEEE 123-Bus FLISR example which I believe is included with OpenDSS-G.
If you do not need the reclosers to trip offline automatically, you can just define the controls as switches and control them with your own algorithm manually.
Alex
I changed it to True but nothing is changing.
Also, yes at the beginning of the simulation it is 11111 and then next step size it becomes 0 0 0 0 0. In case of an over current or a high current and let's say the Reclosers trip, the current would be 0, and the lines would be de-energized. However, the current is still functional normally, with energy and loads perfectly running. EXCEPT: the status of the switches or reclosers is always 0.
We used the create PDE element option to create reclosers from opendss-G.
P.S: When is the new version going to be released ?
Best Regards,
Dhiaa.
Dhiaa,
Looking back at your line defintions, I see that you have multiple lines going between the same buses. For example:
Anything downstream will still be connected through
Line.l6
even ifLine.rcl_6to7
is open. You will need to create a new bus and change thebus1=
/bus2=
assignments to corespond, if you wantLine.l6
andLine.rcl_6to7
to be in series.My recomendation would be two fold. One, go back and look over your circuit layout and make sure everything is connected correctly, no shortcircuits, unexpected loops, etc. (There are various options in OpenDSS to check all the connections, e.g. Show Loops.) And two, make sure you are configuring the reclosers to trip as you expect or use standard switches as I mentioned in an above post.
Alex
Last edit: A Melhorn 2020-04-16