Read/Write Acces to the speed slider thru Modbus server or/and Dashboard
Why is it needed?
Would be easier to have acces to the speed slider thru these communications instead only RTDE, EthernetIP and Profinet that are the only option for this at the time.
You can access the slider through a socket connection to port 30003. Here is an example of a script function we use to set the speed slider programmatically within a robot program. You could also send this from an external source, PLC or PC, if you open a client to the server similar to sending a command to the dashboard server.
def runSlow(speed):
socket_open("127.0.0.1",30003)
socket_send_string("set speed")
socket_send_string(speed)
socket_send_byte(10)
socket_close()
end
def checkSliderValued():
socket_open(“127.0.0.1”,30003)
sliderValue=socket_get_var(“target_speed_fraction”)
socket_close()
end
The things I’m not sure of are (a) socket_get_var only works on integers apparently? and (b) is “target_speed_fraction” the correct value to be looking at?
I have an application where I use a server to read it and send the value back to the robot through RTDE but I would like a way to read it if the server isn’t running for any reason.
Edit: Actually, while we’re here, how do you know what the “set speed” command does? Is there a document that outlines all the valid commands that can be sent over sockets?
Hi mikiposa, we ended up having to set up a separate python server to read the value of target_speed_fraction over RTDE and then write it to a float register that we could then read from the robot program using:
This works great for me, thanks!
But how do you know what string to send?
I wasn’t able to find commands to send directly to real time port 30003 in any documentation
I use this code for my MODBUS speed adjustments, where the modbus signal comes in as 0-100 from a signal generator, dividing it by 100 gives the float value required for adjusting speed through the speed slider