EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  <20212022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  <20212022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: USBTMC, Can't get device capability and Can't clear buffers
From: Eric Norum via Tech-talk <tech-talk at aps.anl.gov>
To: "(대학원생) 문석호 (물리학과)" <msh3069 at unist.ac.kr>
Cc: "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Date: Mon, 18 Oct 2021 09:32:27 -0700
What version of libusb are you using?

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;

On Oct 17, 2021, at 1:35 AM, (대학원생) 문석호 (물리학과) via Tech-talk <tech-talk at aps.anl.gov> wrote:

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
===============================================

— 
Eric Norum





Replies:
RE: USBTMC, Can't get device capability and Can't clear buffers Mark Rivers via Tech-talk
References:
USBTMC, Can't get device capability and Can't clear buffers (대학원생) 문석호 (물리학과) via Tech-talk

Navigate by Date:
Prev: "Virtual circuit disconnect" message question John Dobbins via Tech-talk
Next: RE: USBTMC, Can't get device capability and Can't clear buffers Mark Rivers via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  <20212022  2023  2024 
Navigate by Thread:
Prev: Re: USBTMC, Can't get device capability and Can't clear buffers Mark Rivers via Tech-talk
Next: RE: USBTMC, Can't get device capability and Can't clear buffers Mark Rivers via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  <20212022  2023  2024 
ANJ, 18 Oct 2021 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·