Hi Zen,
getBounds is only called for asynInt32 device support, not asynFloat64. The purpose of getBounds is to establish the range of integer device units for the device, for example 0 to 4095 for a 12-bit A/D or D/A. getBounds is not a method in the asynFloat64 interface, which is why your getBounds method is not being called.
Mark
________________________________________
From: Zenon Szalata [[email protected]]
Sent: Monday, March 04, 2013 10:32 PM
To: Mark Rivers
Cc: tech-talk
Subject: Re: getBounds
Hi Mark,
Here is a typical ai record:
record( ai, "$(P,undefined):AI:CALDAC"){
field( DTYP, "asynFloat64")
field( INP, "@asyn($(PORT,undefined),0,1)AI_CALDAC")
field( SCAN, "I/O Intr")
field( PREC, "3")
field( EGU, "V")
field( EGUL, "0.0")
field( EGUF, "5.0")
field( LINR, "LINEAR")
}
and a typical ao record:
record( ao, "$(P,undefined):AO:VMEDAC"){
field( SDIS, "$(P,undefined):AO:VMEDAC:Sync.PACT")
field( DISV, "1")
field( DTYP, "asynFloat64")
field( OUT, "@asyn($(PORT,undefined),0,1)AO_VMEDAC")
field( EGU, "V")
field( EGUL, "0.0")
field( EGUF, "0.3125")
field( LINR, "LINEAR")
field( PINI, "1")
}
I have a number of similar records in this IOC.
Thanks Mark,
Zen
On 03/04/13 16:47, Mark Rivers wrote:
Hi Zen,
If you look in asyn/asyn/devEpics/devAsynInt32.c you'll see that getBounds is called in initAi(), initAiAverage(), and initAo().
However, it is not called if the user specified the number of bits the device supports by using the asynMask syntax for the INP or OUT link specification. That allows the device support to work correctly with Modbus and similar systems where a generic driver cannot know how many bits the device will support, so the database designer must define it.
- Are you using the asynInt32 device support for ai, aiAverage, or ao?
- Are you using the "asynMask" or "asyn" syntax in your link specification?
Can you send me a copy of the record definition in the .db or .template file?
Mark
________________________________________
From: Zenon Szalata [[email protected]]
Sent: Monday, March 04, 2013 6:14 PM
To: Mark Rivers; tech-talk
Subject: getBounds
Hi Mark,
I wonder when is the virtual function getBounds in asynPortDriver called.
I have reimplemented this function in my device driver. I put a printf
statement in it and it looks that it never gets called. I am thinking
that it should be called for each analog in or analog out record at IOC
init time. That is not what I see. What am I missing?
Thanks,
Zen