Hi Florian,
This can easily be done by using 2 additional records.
Define a new asynFloat64 parameter in your driver which is the maximum voltage that you read back from the remote control interface. This could have a drvInfo field of MAX_VOLTAGE, for example. Make sure your driver sets the flag that registers it as an interrupt source on the asynFloat64 interface.
Your database would then look like this:
record(ai, "$(P)$(R)MaxVoltage")
{
field(DTYP, "asynFloat64")
field(INP, "@asyn($(PORT),0,1)MAX_VOLTAGE
field(SCAN, "I/O Intr")
field(FLNK, "$(P)$(R)SetMaxVoltage")
}
record(ao, "$(P)$(R)SetMaxVoltage")
field(DOL, "$(P)$(R)MaxVoltage NPP")
field(OMSL, "closed_loop")
field(OUT, "$(P)$(R)Voltage.DRVH NPP")
}
So the MaxVoltage will process whenever your driver sets a new value for the MAX_VOLTAGE parameter. That will cause the SetMaxVoltage record to process, which copies the value of MaxVoltage to the DRVH field of your existing Voltage ao record.
Mark
-----Original Message-----
From: Florian Feldbauer [mailto:[email protected]]
Sent: Wednesday, October 15, 2014 8:11 AM
To: Mark Rivers; EPICS Tech Talk
Subject: AsynPortDriver setting DRVH of ao?
Hey Mark,
I'm using the asynPortDriver for some of my device support routines.
Now we have a power supply were the maximum voltage can be limited via a
poti.
The actual value can be read out via the remote control interface.
We would like to use this value for the DRVH field of the ao records
used to set the output voltage.
Is it possible (e.g. during initialization) to set the DRVH fields via
the asynPortDriver?
Best regards,
Florian