An ASYN GPIB driver has no notion of EPICS records. The device address is obtained with the ASYN manager static getAddr method.
Here's the start of the GPIB read method in asyn/gsIP488/drvGsIP488.c:
asynStatus gpibPortRead(void *pdrvPvt,asynUser *pasynUser,
char *data,int maxchars,int *nbytesTransfered,int *eomReason)
{
gsport *pgsport = (gsport *)pdrvPvt;
int actual = 0;
double timeout = pasynUser->timeout;
int addr = 0;
asynStatus status;
status = pasynManager->getAddr(pasynUser,&addr);
At this point 'addr' contains the GPIB address from which to read.
On Jun 26, 2012, at 7:14 PM, Andrew Wagner wrote:
> Hi everyone,
>
> I would like to access the Gpib address of a record within an ASYN devGpib device driver. I would like to use this information in custom messages to be sent to the physical device. Specifically I am writing drivers to communicate to several Gpib devices controlled with a PROLOGIX Gpib to Ethernet controller. The controller issues Gpib commands to the last device addressed to it via a custom command ++addr # (where # is the Gpib address of the device you want to address). Presently if multiple devices are under the control of a single PROLOGIX the individual Gpib addresses must be hard coded into the driver messages. i.e.
>
> {&DSET_SI, GPIBREAD, IB_Q_HIGH, "++addr 19\n*IDN?\n++read eoi",NULL, 0, 200, NULL, 0, 0, NULL, NULL, NULL}
>
> gets the IDN from Gpib Address 19 and
>
> {&DSET_SI, GPIBREAD, IB_Q_HIGH, "++addr 24\n*IDN?\n++read eoi",NULL, 0, 200, NULL, 0, 0, NULL, NULL, NULL}
>
> gets the IDN from Gpib Address 24.
>
> I would like to be able to access the Gpib Address (A) defined for a record in the OUT or INP fields, i.e:
>
> field{OUT, "#L$(L) A$(A) @2)
>
> via something like
>
> struct aiRecord *pai= (struct aiRecord *)pdpvt->precord;
>
> int addr = (int)pai->A;
>
> Unfortunately, searching through the API documentation I couldn't find how to access the Gpib address in the record struct. The codes a little dense so I could easily have missed something. I've had a lot of success with the PROLOGIX controllers and hard coding Gpib addresses definitely works, its just inelegant and unportable. Thanks for your help and advice.
>
> Andrew Wagner
>
>
>
--
Eric Norum
[email protected]
- References:
- Access to Gpib Address via record in ASYN Andrew Wagner
- Navigate by Date:
- Prev:
Access to Gpib Address via record in ASYN Andrew Wagner
- Next:
EPICS Collaboration Meeting Fall 2012, First Announcement 이은희
- 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
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
Access to Gpib Address via record in ASYN Andrew Wagner
- Next:
EPICS Collaboration Meeting Fall 2012, First Announcement 이은희
- 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
2021
2022
2023
2024
|