Also, you need to make sure that the switch exists, and the control actions are not overriding your command (for example, trying to close a switch that because of the control actions need to be open). For better controlling switches I would suggest using Function 0x18. Then, through function 0x19 you can get everything back to confirm, but you need to solve your system first before checking the status, since is when the simulation is executed that the control action takes place.
Best regards
Davis
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thank you so much for your reply and your clarification about the switch actions.
How do we solve a system from python ?
I thought just by doing : ODGTCP.sendCommand('set time=(0,0) mode=time controlmode=time stepsize=1h number=1') the system is saved ? by the way this is how I am running my simulation, I open the power model, and I use python to run the whole simulation from outside.
Function 0x19 is Switch Control ? is there some clarification or an example to use it please I would be so grateful
Function 0x18 is the switch status but i am not getting the results it is giving me: [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']
so I am not getting the whole status given by these results, also how to use that one for all of my 5 tie switches and my 5 reclosers as well. just want to see : 1 or 0 for each switch.
Looking forward to your valuable replies which I am always grateful for. Also, this is a time sensitive matter for me to finalize the whole project. I will really appreciate it.
Best Regards,
Dhiaa.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Are you creating the switches dynamically? if so, that maybe a problem with version 2 since it takes the list of switches from the database, so only the switches registered there will be considered. That's something we solved in Version 3 but since it's not released yet is not available.
For now, you can use the text command to get the status of those switches, in case of being created dynamically during the simulation.
Best regards
Davis
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
OK, what it means is that you are uploading a set of switches that do not exist in the database probably, so my answers as follows:
Check in the Python library the property that calls function 0x23, I didn't write the library, so I don't know.
Check answer number 1, but in this case, looks for function 0x18. Another way to do it is using the text command through function 0x25. Check the OpenDSS user manual for details.
Same as in answer 2.
Best regards
Davis
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
when I do it once, the data stays dynamic, the values of the power and current and voltages are static one value per all the itterations! However when I pushed it into the loop that it keeps stepping in, the values change which is what I am looking for!
is that causing an issue?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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: (because I want my sim to keep running forever till I stop it)
ODGTCP.stepIn() (this is how to solve)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I didn't create the Python library, so I don't know. However, when creating a loop it is always good to add a delay after the solve command since the TCP server is an off-line link, which means that both processes are running separately and independently, if you don’t sync them, the output can come out very bad.
There are other ways to sync like for example, using functions 0x52 and 0x53 to know if the simulation job in OpenDSS-G is done. Anyway, you'll figure it out.
Best regards
Davis
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I created the FLISR application in Opendss-G using some matlab code and python.
The issue is when running : ODGTCP.sendCommand('SwtControl.switch1.Action=Close')
the status of the switches i am getting using : Switch1 = ODGTCP.getSwitchesStatus()
it doesn't give the correct switch status which is always 0 as opened however I have just clearly closed it with that command.
I need help in getting the switch status is that the correct way :
ODGTCP.sendCommand('Select SwtControl.switch1')
Switch1 = ODGTCP.getSwitchesStatus()
is it like this ?
Best Regards,
Dhiaa
Hello,
Unfortunately it is not. If your idea is to use the OpenDSS command to check the switch status you will have to do something like this:
Also, you need to make sure that the switch exists, and the control actions are not overriding your command (for example, trying to close a switch that because of the control actions need to be open). For better controlling switches I would suggest using Function 0x18. Then, through function 0x19 you can get everything back to confirm, but you need to solve your system first before checking the status, since is when the simulation is executed that the control action takes place.
Best regards
Davis
Dear Davis,
Thank you so much for your reply and your clarification about the switch actions.
How do we solve a system from python ?
I thought just by doing : ODGTCP.sendCommand('set time=(0,0) mode=time controlmode=time stepsize=1h number=1') the system is saved ? by the way this is how I am running my simulation, I open the power model, and I use python to run the whole simulation from outside.
Function 0x19 is Switch Control ? is there some clarification or an example to use it please I would be so grateful
Function 0x18 is the switch status but i am not getting the results it is giving me: [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']
so I am not getting the whole status given by these results, also how to use that one for all of my 5 tie switches and my 5 reclosers as well. just want to see : 1 or 0 for each switch.
Looking forward to your valuable replies which I am always grateful for. Also, this is a time sensitive matter for me to finalize the whole project. I will really appreciate it.
Best Regards,
Dhiaa.
Hello,
To solve the system remotely use function 0x23.
Best regards
Davis
when I run swt = ODGTCP.getSwitchesStatus() the only result is about the reclosers but not the rest of the five switches I have.
[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']
So I would love to understand this as well if possible.
Dhiaa.
Hello,
Are you creating the switches dynamically? if so, that maybe a problem with version 2 since it takes the list of switches from the database, so only the switches registered there will be considered. That's something we solved in Version 3 but since it's not released yet is not available.
For now, you can use the text command to get the status of those switches, in case of being created dynamically during the simulation.
Best regards
Davis
Hello Davis,
The creation of the switches in made in the text file called SwtControl normally.
The simulation is running from python code directly exactly as I explained.
I need some points:
1- how to solve the model using python or what do you mean by solving or how to do it?
2- and what is the command in python to open or close a switch?
3- Also how do we change the taps number of the transformer using python
I really would appreciate answering these questions.
Best Regards,
Dhiaa.
Hello,
OK, what it means is that you are uploading a set of switches that do not exist in the database probably, so my answers as follows:
Best regards
Davis
I use the data step in to solve yes, should that be once ? at the very beginning after setting the simulation params ?
Yes sir,
when I do it once, the data stays dynamic, the values of the power and current and voltages are static one value per all the itterations! However when I pushed it into the loop that it keeps stepping in, the values change which is what I am looking for!
is that causing an issue?
Sync is important, just make sure that your simulation is consistent and that the values make sense.
Best regards
Davis
Solving is done in my case by :
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: (because I want my sim to keep running forever till I stop it)
ODGTCP.stepIn() (this is how to solve)
Hello,
I didn't create the Python library, so I don't know. However, when creating a loop it is always good to add a delay after the solve command since the TCP server is an off-line link, which means that both processes are running separately and independently, if you don’t sync them, the output can come out very bad.
There are other ways to sync like for example, using functions 0x52 and 0x53 to know if the simulation job in OpenDSS-G is done. Anyway, you'll figure it out.
Best regards
Davis