Hi Lewis,
On Tuesday 05 April 2011 09:45:30 J. Lewis Muir wrote:
>
> Say I have a longout record on an IOC and want to write to its
> VAL field from an SNL program running in a different IOC. What
> type should I use for the SNL variable in order to be portable?
> int32_t? Or is there actually no way to be portable because
> the size of the longout record's DBF_LONG VAL field can vary
> depending on the architecture for which the longout record was
> built and because CA doesn't support 64-bit integer types?
Since R3.14.10 the DBF_LONG field type has mapped to epicsInt32, a 32-bit
integer typedef for int (or int32_t where __STDC_VERSION__ >= 199901L) that is
defined in epicsTypes.h. I don't know of any architectures where those are
not synonymous nowadays, but some might come along in the future. IOCs built
with releases prior to 3.14.10 didn't work properly on 64-bit architectures
anyway. The Channel Access dbr_long_t from db_access.h is also a typedef for
epicsInt32.
> It would seem to me that the only way to actually make anything
> portable is to use fixed size types across the board. That is,
> in the example above, make the type of the longout record's VAL
> field a 64-bit signed integer (e.g. DBF_INT64), make CA support
> 64-bit signed integers, and let me use int64_t as the type of
> the variable in the SNL program used to write to the VAL field.
64-bit integers were not fully supported on some of our older OSs and are not
efficient on CPUs that have only 32-bit registers, but replacing 64-bit with
32-bit in the above paragraph that's what we currently have; use int variables
in the sequencer to get a 32-bit integer on all the architectures I know of.
- Andrew
--
An error is only a mistake if you don't learn from it.
When you learn something from it, it becomes a lesson.
- References:
- sequencer on 64bit linux Benjamin Franksen
- Re: sequencer on 64bit linux Benjamin Franksen
- Re: sequencer on 64bit linux J. Lewis Muir
- Navigate by Date:
- Prev:
how to use EPICS driver of MicroResearch PMC-EVR 王林
- Next:
Re: sequencer on 64bit linux Andrew Johnson
- 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:
Re: sequencer on 64bit linux J. Lewis Muir
- Next:
Re: sequencer on 64bit linux Andrew Johnson
- 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
|