I see that there’s an error in the message generation code in drvAsynUSBTMC.c. I’ve committed the following fix which should be in the next ASYN release. Please apply it ind see what is printed when you run your test again. I suspect that there’s a permissions problem.
I tried the drvAsynUSBTMC.c driver just now with a Rohde&Schwarz USBTMC oscilloscope and all seemed to work fine.
eric@FlashyBook 220> diff -u drvAsynUSBTMC.c.orig drvAsynUSBTMC.c
--- drvAsynUSBTMC.c.orig 2021-10-17 18:12:48.000000000 -0700
+++ drvAsynUSBTMC.c 2021-10-17 18:14:51.000000000 -0700
@@ -628,15 +628,19 @@
return asynError;
}
if (getCapabilities(pdpvt, pasynUser) != asynSuccess) {
+ char *msg = epicsStrDup(pasynUser->errorMessage);
libusb_close(pdpvt->handle);
epicsSnprintf(pasynUser->errorMessage, pasynUser->errorMessageSize,
- "Can't get device capabilities: %s", pasynUser->errorMessage);
+ "Can't get device capabilities: %s", msg);
+ free(msg);
return asynError;
}
if (clearBuffers(pdpvt, pasynUser) != asynSuccess) {
+ char *msg = epicsStrDup(pasynUser->errorMessage);
libusb_close(pdpvt->handle);
epicsSnprintf(pasynUser->errorMessage, pasynUser->errorMessageSize,
- "Can't clear buffers: %s", pasynUser->errorMessage);
+ "Can't clear buffers: %s", msg);
+ free(msg);
return asynError;
}
pdpvt->bulkInPacketFlags = 0;
Hello,
I try to make epics control system for dg812(Rf signal generator of RIGOL).
The dg812 supported usb commuincation but the protocol is usbtmc so I used drvAsynusbtmc module of asyn.
However, I faced some error like below.
<image.png>
I did the test in centos7 enviroment and the version of asyn is 4-26 and the version of base is 3.14.12.5 .
I also did the test with rasberrypi3 enviroment with same asyn and base version but it shows same error message.
'Can clear buffer ~' and 'Can't get device capabilities ~'
The most strange thing is about usb mount. When I plug in the usb cable and check the usb mount at /dev, I can check that the usb is succesfully mounted with name 'usbtmc0'.
However, after I run epics and see the above error, the usb is diconnected so I can't see the 'usbtmc0' at /dev directory.
That thing happens at centos 7 environment and also in rasberrypi enviroment.
Can you give me some advice about this error?
Best Regards
SeokHoMoon
===============================================
Intense Beam and Accelerator Laboratory
Department of Physics
Ulsan National Institute of Science and Technology (UNIST)
50, UNIST-gil, Ulsan 44919, Republic of Korea
Phone: +82-10-2767-9398
===============================================