What conversion are you referring to? The LINR conversion? If so, then yes LINR is designed to convert from engineering units (epicsFloat64) to device units (epicsInt32). If you use the asynFloat64 device support then your VAL field is assumed to already be in engineering units, and the VAL field is written directly with no conversion.
Mark
________________________________________
From: [email protected] [[email protected]] on behalf of haquin [[email protected]]
Sent: Thursday, February 21, 2013 9:15 AM
To: Kasemir, Kay
Cc: tech-talk
Subject: Re: Rounding in conversion of ao record
What I find disapointing is that the conversion forces the cast to Int32,
for exemple, in my initial situation (asynFloat64 device support):
- if I don't use the conversion the output is Float
- if I use the conversion the output is Integer
You never expect the conversion to prevent you from Float output.
Le 21/02/2013 15:16, Kasemir, Kay a écrit :
On 2/21/13 09:06 , "Hu, Yong" <[email protected]> wrote:
For the conversion of ao, the data flow (conversion direction) is VAL
(double type) --> RVAL (integer); input is double, output is integer;
For the conversion of ai, the data flow (conversion direction) is RVAL
(integer) --> VAL (double); input is integer, output is double;
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of haquin
There is a rounding operation (cast to (epicsInt32)) when using the
conversion of the ao record, hence, with this conversion only integer is
output, no float ...
This is surprising and not equivalent to what is done for the ai record.
As Yong describes, it is consistent both ways: There is usually a
conversion from the double type to/from the integer, and device support
would then use the integer.
But that's up to the device support.
With EPICS base, you get the "Soft Channel" device support for example
that will transfer the double VAL field.
The "Raw Soft Channel" device support will transfer the integer RVAL field.
For the EtherIP device support, floating point typed PLC tags are
transferred in/out of the VAL fields, otherwise the RVAL fields are used.
So it depends on your device support.
Thanks,
-Kay