Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Use of External API

#1
I am trying to use the RoboDK external API and I am not sure of what the expected behavior / limitations are.

1. If I set up external connections to the RoboDK API in the GUI in Tools > Options, does a RoboDK workstation need to be open in order to accept the connections, or can RoboDK be started using an external API connection?
2. Even with a RoboDK workstation open, I have not been able to get the external API to work successfully when using the -NEWINSTANCE arg. Is the the expected behavior? (It seems plausible to me that opening a new instance using the external API is not supported.)

I am using python 3.12 and RoboDK 5.6.1 on Windows 10.
#2
RoboDK can't be started remotely using the API. However, you could have RoboDK running in the background and show it or hide it using the API.

When using the API externally you should not use the NewInstance parameter. The NewInstance parameter will look for a random port that is available and will start the API server on that port. The port will not be the default port that the API uses to connect (port 20500). Another option is to specify your custom port for external usage.

For example, on the PC running RoboDK, start RoboDK allowing external API connections on port 20123:
Code:
RoboDK.exe -AllowExternalAPI -PORT=20123

And on the remote PC connecting to RoboDK using the API:
Code:
RDK = robolink.Robolink(robodk_ip="192.168.0.5", port=20123)
#3
I think the solution that I will need is to have a custom server running in the background that spawns (hidden) instances of RoboDK and provides their ports to clients that ask for it.

Thanks, Albert!
  




Users browsing this thread:
1 Guest(s)