I have simple softIOC which reads values from a HP34401A multimeter. The multimeter is connected via GPIB bus to NI PCI-GPIB interface. The IOC is built with EPICS 3.14.9, ASYN 4-8, and linux-gpib 3.2.09.
The command which reads the value is:
{&DSET_LI,GPIBREAD,IB_Q_HIGH,"READ?","%f",0,80,NULL,0,0,NULL,NULL,NULL},
Caget shows something like: 1091779303, which is nonsence. The value should be about 9.202. When I change the record to stringi, then I see correct 9.2 type value. Also in edm I see the same 1091779303 unreal number. When I display it in hex, I see 0x41133AE7.
I also wrote a simple c program where:
int v=0x41133ae7;
float f;
memdpy( &f,&v,sizeof(int));
print( "0x%x %f\n",v,f);
This gives an output:
0x41133ae7 9.201880
All of this is on RHEL4 linux. It seems to me that EPICS is interpreting the byte order in a way different than the c program. But then what do I need to do to have the PV floating value be correct? Thanks in advance,
Zen
- Replies:
- Re: Byte Order? Eric Norum
- Navigate by Date:
- Prev:
RE: host watchdog and PLC Mark Rivers
- Next:
Re: Byte Order? Eric Norum
- 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: host watchdog and PLC Bryce Karnaghan
- Next:
Re: Byte Order? Eric Norum
- 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
|