Skip to main content
Submitted by JosephKirk on Fri, 07/19/2019 - 03:53

Hello

I'm hoping anyone can help me by troubleshooting why I can't properly connect to a Galil device.

When attempting to connect to the known IP address I get a response of -1101 which I read refers to "Device could not be opened. E.G. Serial port or PCI device already open. ", nothing else is connected to the Device.

When I used the "-d" argument I managed to connect to the device and could successfully turn IOs on and off but the stage feedback gave back absurd numbers and I could not move the stages. This same code runs successfully on one of our other machines which also uses Galil.

What's weird is that another utility we have which wasn't written by myself connects correctly to the device using the same IP address with no arguments.

I'm running version 200.252.396 of gclb.

Any help would be greatly appreciated!

Best Regards

Joe

Comments 1

aschissler on 02/13/2020 - 17:11

I don't have any experience with the DMC21x2 series controllers, but I did run through troubles connecting to my DMC3x01X and DMC500x0 units when first getting started with gclib (and first experiences with non-PCI IP controllers) for silly reasons.

---

My issue was that gcaps was still opening UDP connections to the controllers alongside the main TCP connection. When the application disconnected/closed, the TCP connection would close, but the UDP connection handle would persist on the controller - occupying one of the few available network handles indefinitely (unless the controller was shut-down or the connection was manually removed via IHT or IHN command) and blocking new additional TCP connections from being made.

---

Now, I pass the " --direct" argument with the IP address when opening connections to the controllers AND I immediately send an "IHT=>-1" command (or "IHN=>-1" for DMC3x01x) to ensure that the controller network handles are freed from any and all pesky UDP connections created by my application or any others that have communicated with the device. I also verify that everything's gone every once in a while with "TH" to check what's connected and how (TCP or UDP).

---

Again, I don't have anything from the DMC21x2 series and I'm not sure if you're already handling finite number of network handles (8 max for DMC21x2) with respect to persistent orphaned UDP connections (or if you are actually using utilizing UDP intentionally in your application), but this solved my personal connection headache. Good luck!

---

Regards,
Andrew