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  <20092010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  <20092010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: GPIB/ASYN user port data
From: "Andrew C. Starritt" <[email protected]>
To: "EPICS Tech Talk ([email protected])" <[email protected]>
Date: Wed, 18 Mar 2009 11:37:36 +1100
Hi all,
 
When using devGpib inconjuction with ASYN, I sometimes want to store port
specific user status data (as opposed to record specific state data).
 
Suppose the gpibCmds table may look like:
 
static struct gpibCmd gpibCmds[] = {
   /* 0 - Frequency Monitor */
   {&DSET_AI, GPIBCVTIO, IB_Q_LOW, NULL, NULL, 20, 20,
    performIo, 12, 0, NULL, NULL, 0},
 
   /* 1 - Frequency Set Point */
   {&DSET_AO, GPIBCVTIO, IB_Q_LOW, NULL, NULL, 0, 20,
    performIo, 12, 0, NULL, NULL, "\033"},
 
   .... etc
};
 
 
In the performIo function is it possible to do something like the following:
 
typedef struct portState {
   int Count;
   ....;
} portState;
 
static int performIo (struct gpibDpvt *pdpvt, int P1, int P2, char **P3)
{
   portState *pPortState;
 
   pPortState = pdpvt->????->????->????;
 
   if (pPortState == NULL) {  
      /* Allocate port specific data
       */
      pPortState = dbCalloc (1, sizeof (portState));
      pdpvt-????->????->???? = pPortState;
 
      /* Initialise port specific data
       */
      pPortState->Count = 0;
      .....;
   }
 
   pPortState->Count++;
   .....;
}
 
 
And if so, what can I safely use for ????->????->????
 
I have a work around by extracting the port number xxx corresponding
to the
 
   field (INP, "#Lxxx Aaaa @ccc");
 
from the inp/out field of the record, but this seems a bit of a hack.
 
 
 
Regards
Andy
 
 
Andrew Starritt, Principal Controls Engineer, Australian Synchrotron
800 Blackburn Road, Clayton, Victoria 3168
ph: (03) 8540 4164 , fax: (03) 8540 4200
mailto:[email protected] http://www.synchrotron.org.au
 
 
 
This message and any attachments may contain proprietary or confidential information. If you are not the intended recipient or you received the message in error, you must not use, copy or distribute the message. Please notify the sender immediately and destroy the original message. Thank you.
Navigate by Date:
Prev: Re: weird behaviour of SNL test program running on Soft IOC on LINUX Oleg Makarov
Next: Starting multiple SNL programs Andrew C. Starritt
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  <20092010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: RE: Keithley 2000 multimeter support? Elder Matias
Next: Starting multiple SNL programs Andrew C. Starritt
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  <20092010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 31 Jan 2014 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·