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

Subject: ASYN VXI-11
From: Eric Norum <wenorum@lbl.gov>
To: Mark Rivers <rivers@cars.uchicago.edu>, "tech-talk@aps.anl.gov Talk" <tech-talk@aps.anl.gov>
Date: Tue, 10 Jan 2017 09:58:45 -0800
I’m attempting to communicate with a Keysight 53210A frequency counter using VXI-11/ASYN/StreamDevice.  I’m seeing all sorts of problems when the driver attempts to set up the SRQ link — to the point where the windows application on the frequency counter crashes and puts up a ‘.exe failed’ message (upside down!) on the instrument screen.  

I had a look at the code in drvVxi11.c and by moving the SRQ code inside the ‘isGpibLink’ test everything seems to work.  This change also gets VXI-11 communication working with some other instruments that also failed before.

What are your thoughts on this change?
Does anyone use SRQ with non-'GPIB' devices?  If so, how did you make it work?


diff -U50 -r ../asyn4-30.orig/asyn/vxi11/drvVxi11.c ./asyn/vxi11/drvVxi11.c
--- ../asyn4-30.orig/asyn/vxi11/drvVxi11.c 2016-08-23 09:23:36.000000000 -0700
+++ ./asyn/vxi11/drvVxi11.c 2017-01-10 09:19:06.969887000 -0800
@@ -909,102 +909,102 @@
     pvxiPort->server.lid = link;
     pvxiPort->server.connected = TRUE;
     pvxiPort->ctrlAddr = -1;
     if(pvxiPort->isGpibLink) {
         /* Ask the controller's gpib address.*/
         status = vxiBusStatus(pvxiPort,
             VXI_BSTAT_BUS_ADDRESS,pvxiPort->defTimeout,&pvxiPort->ctrlAddr);
         if(status!=asynSuccess) {
             asynPrint(pasynUser,ASYN_TRACE_ERROR,
                "%s vxiConnectPort cannot read bus status initialization aborted\n",
                 pvxiPort->portName);
             if (pvxiPort->server.connected)
                 vxiDisconnectPort(pvxiPort);
             return status;
         }
         /* initialize the vxiPort structure with the data we have got so far */
         pvxiPort->primary[pvxiPort->ctrlAddr].primary.lid = link;
         pvxiPort->primary[pvxiPort->ctrlAddr].primary.connected = TRUE;
         /* now we can use vxiBusStatus; if we are not the controller fail */
         status = vxiBusStatus(pvxiPort, VXI_BSTAT_SYSTEM_CONTROLLER,
             pvxiPort->defTimeout,&isController);
         if(status!=asynSuccess) {
             asynPrint(pasynUser,ASYN_TRACE_ERROR,
                 "%s vxiConnectPort vxiBusStatus error initialization aborted\n",
                 pvxiPort->portName);
             if (pvxiPort->server.connected)
                 vxiDisconnectPort(pvxiPort);
             return status;
         }
         if(isController == 0) {
             status = vxiBusStatus(pvxiPort, VXI_BSTAT_CONTROLLER_IN_CHARGE,
                 pvxiPort->defTimeout,&isController);
             if(status!=asynSuccess) {
                 asynPrint(pasynUser,ASYN_TRACE_ERROR,
                     "%s vxiConnectPort vxiBusStatus error initialization aborted\n",
                     pvxiPort->portName);
                 if (pvxiPort->server.connected)
                     vxiDisconnectPort(pvxiPort);
                 return asynError;
             }
             if(isController == 0) {
                 asynPrint(pasynUser,ASYN_TRACE_ERROR,
                     "%s vxiConnectPort neither system controller nor "
                     "controller in charge -- initialization aborted\n",
                     pvxiPort->portName);
                 if (pvxiPort->server.connected)
                     vxiDisconnectPort(pvxiPort);
                 return asynError;
             }
         }
+        vxiCreateIrqChannel(pvxiPort,pasynUser);
     }
-    vxiCreateIrqChannel(pvxiPort,pasynUser);
     pasynManager->exceptionConnect(pvxiPort->pasynUser);
     return asynSuccess;
 }

 


 static asynStatus vxiDisconnectPort(vxiPort *pvxiPort)
 {
     int          addr,secondary;
     asynUser     *pasynUser = pvxiPort->pasynUser;

 

     if(!pvxiPort->server.connected) {
         asynPrint(pasynUser,ASYN_TRACE_ERROR,
             "%s vxiDisconnectPort but not connected\n",pvxiPort->portName);
         return asynError;
     }
     if(pasynUser) asynPrint(pasynUser,ASYN_TRACE_FLOW,
         "%s vxiDisconnectPort\n",pvxiPort->portName);
     if(!pvxiPort->isSingleLink)
     for(addr = 0; addr < NUM_GPIB_ADDRESSES; addr++) {
         devLink *pdevLink;

 

         pdevLink = &pvxiPort->primary[addr].primary;
         if(pdevLink->connected) {
             if(addr!=pvxiPort->ctrlAddr) {
                 vxiDestroyDevLink(pvxiPort, pdevLink->lid);
                 vxiDisconnectException(pvxiPort,addr);
             }
             pdevLink->lid = 0;
             pdevLink->connected = FALSE;
         }
         for(secondary = 0; secondary < NUM_GPIB_ADDRESSES; secondary++) {
             pdevLink = &pvxiPort->primary[addr].secondary[secondary];
             if(pdevLink->connected) {
                 vxiDestroyDevLink(pvxiPort, pdevLink->lid);
                 vxiDisconnectException(pvxiPort,(addr*100 + secondary));
                 pdevLink->lid = 0;
                 pdevLink->connected = FALSE;
             }
         }
     }
     vxiDestroyIrqChannel(pvxiPort);
     vxiDestroyDevLink(pvxiPort, pvxiPort->server.lid);
     pvxiPort->server.connected = FALSE;
     pvxiPort->server.lid = 0;
     clnt_destroy(pvxiPort->rpcClient);
     pasynManager->exceptionDisconnect(pvxiPort->pasynUser);
     return asynSuccess;
 }

 


 static void vxiReport(void *drvPvt,FILE *fd,int details)
 {

-- 
Eric Norum
wenorum@lbl.gov


Replies:
Re: ASYN VXI-11 Ben Franksen

Navigate by Date:
Prev: Re: Looking for someone to help building the control system of XAFS/XRF beamline at SESAME Mark Rivers
Next: Re: DSO missing from command line Error in Ubuntu 16.04 LTS Johnson, Andrew N.
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
Navigate by Thread:
Prev: Re: DSO missing from command line Error in Ubuntu 16.04 LTS Johnson, Andrew N.
Next: Re: ASYN VXI-11 Ben Franksen
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
ANJ, 14 Feb 2017 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·