Note that the use of the drvUser interface to parse the drvInfo field into pasynUser->reason in my previous reply is just one example of how that interface can be used.
The documentation on the drvUser interface is here:
https://epics-modules.github.io/master/asyn/R4-41/asynDriver.html#asynDrvUser
It shows that the interface is actually independent of EPICS records and the use of the drvInfo field in the link.
Mark
From: Mark Rivers
Sent: Sunday, April 25, 2021 7:44 AM
To: Abdalla Ahmad <Abdalla.Ahmad at sesame.org.jo>
Cc: tech-talk at aps.anl.gov
Subject: Re: Purpose of the asynDrvUserMask interface
> The solution was to include “asynDrvUserMask” as part of the interface mask in the base class constructor even though
> I am not using drvUserCreate method (But I am using pasynOctetSyncIO).
> This was the call to the base class constructor:
> asynPortDriver(port_name, 255, asynInt32Mask | asynFloat64Mask | asynDrvUserMask,
> 0, ASYN_CANBLOCK | ASYN_MULTIDEVICE, 1, 0, 0)
> So what is the purpose of this interface?
The asynDrvUser interface is used to parse the drvInfo string in the record link string:
field(OUT, "@asyn($(PORT),$(ADDR),$(TIMEOUT))SCOPE_VOLT_OFFSET")
In the above example SCOPE_VOLT_OFFSET is the drvInfo string.
In the asynPortDriver base class implementation that string is converted to the integer pasynUser->reason. But your driver can override that method to handle the drvInfo string differently.
The drvUser interface is optional, although it is needed if your driver will handle multiple parameters, which nearly all drivers do.
Mark
Hi
I am working on a driver based on asynPortDriver interface, the problem is that this statement
int function = pasynUser->reason;
Will always return 0 no matter which parameter string I pass in the INP field. The solution was to include “asynDrvUserMask” as part of the interface mask in the base class constructor
even though I am not using drvUserCreate method (But I am using pasynOctetSyncIO). This was the call to the base class constructor:
asynPortDriver(port_name, 255, asynInt32Mask | asynFloat64Mask | asynDrvUserMask, 0, ASYN_CANBLOCK | ASYN_MULTIDEVICE, 1, 0, 0)
So what is the purpose of this interface?
Best Regards,
Abdalla