Driver or solution for communicating with Galil DMC 20xx through USB

xamax

Registered
Registered
Joined
Feb 24, 2020
Messages
1
Hi, I have currently acquired a Galil DMC 2070 motion controller, I would like to use it to build a CNC with it.
I am not very familiar with USB interface low level communication or USB driver but I often code in C++.
I tried to use the USB bus to communicate with its NET2888 interface is not supported since windows 7 and is not recognized.
I tried to communicate with it directly via libusb in C++, and successfully connected it and claimed the interface but obtained an error when trying to send raw data.
Here is my test program, you need to get libusb and statically link its library with something like "gcc -Llibusb -llibusb-1.0.a main.cpp -omyTest.o" :

#include <cstring>
#include <stdio.h>
#include "libusb/libusb.h"

int main(){
char entry;
libusb_context *context = nullptr;
int status, nwrite;
unsigned char buffer[64] = "TP\0";
libusb_device_handle *handle = nullptr;

printf("start usb test (y/n) ?");
scanf("%c", &entry);
if(entry=='n') return 0;

libusb_init(&context);
handle = libusb_open_device_with_vid_pid(context, 0x06B3, 0x07D1);
if(handle){
printf("Device %04x:%04x opened with success\n",0x06B3,0x07D1);
}
else {
libusb_exit(nullptr);
printf("device %04x:%04x not found\n",0x06B3,0x07D1);
system("pause");
return 1;
}

libusb_set_auto_detach_kernel_driver(handle, 1);
status = libusb_claim_interface(handle,0);
if(status!=0){
libusb_close(handle);
libusb_exit(nullptr);
fprintf(stderr, "usb_claim_interface error %d\n", status);
system("pause");
return 2;
}
printf("Interface claimed successfully\n");

status = libusb_bulk_transfer(handle, USB_ENDPOINT_OUT,
buffer, 64, &nwrite, TIMEOUT);
if(status==0) printf("send %d bytes to device\n", nwrite);
else printf("error %d, writing to device\n", status);

libusb_release_interface(handle,0);
libusb_close(handle);
libusb_exit(nullptr);

system("pause");
return 0;
}

As galil DMCs are commonly used on CNCs, is there anyone who already solved this problem ?
 
Back
Top