Hi,
A few days before, I got a report from Ms. Komiyama of RIKEN that
medm/dm2k TextUpdate/TextEntry object, configured to "hexadecimal",
displays 0x7fffffff when value of the connected channel is larger than
2147483647 , i.e. 0x7fffffff.
If we connect these object to ai/ao record for example, value
can be larger than 2147483647 but TextUpdate/TextEntry object,
configured to "hexadecimal" shows 0x7fffffff. We expect 0x80000000
for 2147483648, for a example.
I looked at the source code of dm2k-2.5.2 and found that
1) these object keep the value in double type variable,
and that
2) this value is casted to (long) before passed to
localCvtLongToHexString() function.
In my test code, the result of (long) cast of a double value larger than
2147483647 is always 0x7fffffff, which is differenct from the result of
(unsigned long) cast.
For example;
(long) 2147483648.0 -> 2147483647 (0x7fffffff)
(unsigned long) 2147483648.0 -> 2147483648 (0x80000000)
(long)((unsigned long) 2147483648.0) -> (long) 2147483648u
(0x80000000)->-2147483648 (0x80000000)
So I suggest to change the lines like:
localCvtLongToHexString((long)value, textField);
in dm2kTextUpdate.c and dm2kTextEntry.c to:
localCvtLongToHexString((unsigned long)value, textField);
So that the value less than 4294967295 (2**32-1) will be displayed
propery in these objects.
Thank you,
Noboru Yamamoto
KEK, JAPAN
- Navigate by Date:
- Prev:
RE: Serial driver for Linux Robby Tanner
- Next:
how to prevent ioc app from being built for both target and host? M.C.Shao
- 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: OSI bumples reboot (R3.14.1) Zelazny, Michael S.
- Next:
how to prevent ioc app from being built for both target and host? M.C.Shao
- 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
|