I think you are confusing the values of the data and how it is represented in a human readable form.
A number in a computer is not "decimal", "binary" or "hexadecimal". Those are simply ways of representing that number as ASCII characters so people can read it.
Here is an example of a 16-bit binary EPICS waveform record:
corvette:~>cainfo 13BMDPG1:image1:ArrayData
13BMDPG1:image1:ArrayData
State: connected
Host: 164.54.160.140:5064
Access: read, write
Native data type: DBF_SHORT
Request type: DBR_SHORT
Element count: 12592912
So it is of native data type DBF_SHORT, i.e. a 16-bit integer.
This is a display of the first 100 elements of that array in decimal:
corvette:~>caget -#100 13BMDPG1:image1:ArrayData
13BMDPG1:image1:ArrayData 100 6912 6912 7168 7040 7040 6976 6912 6912 7040 7168 6976 6976 6912 6976 6976 7104 7168 6976 6720 7168 7104 7040 6976 6976 6720 7040 6848 6912 6784 6656 6848 6912 6912 6976 6976 7104 7104 7104 7232 7040 7296 7232 6784 7168 6912 7168 6976 7488 7168 7040 7168 7232 7232 7168 7040 7360 7296 7296 7424 7232 7168 7360 7296 7296 7360 7296 7296 7232 7296 7360 7424 7232 7680 7424 7296 7552 7488 7296 7488 7424 7232 7552 7488 7488 7488 7424 7488 7552 7296 7552 7296 7424 7488 7680 7232 7360 7360 7168 7488 7360
This is a display of the first 100 elements of that array in haxadecimal:
corvette:~>caget -#100 -0x 13BMDPG1:image1:ArrayData
13BMDPG1:image1:ArrayData 100 0x1B00 0x1B00 0x1C00 0x1B80 0x1B80 0x1B40 0x1B00 0x1B00 0x1B80 0x1C00 0x1B40 0x1B40 0x1B00 0x1B40 0x1B40 0x1BC0 0x1C00 0x1B40 0x1A40 0x1C00 0x1BC0 0x1B80 0x1B40 0x1B40 0x1A40 0x1B80 0x1AC0 0x1B00 0x1A80 0x1A00 0x1AC0 0x1B00 0x1B00 0x1B40 0x1B40 0x1BC0 0x1BC0 0x1BC0 0x1C40 0x1B80 0x1C80 0x1C40 0x1A80 0x1C00 0x1B00 0x1C00 0x1B40 0x1D40 0x1C00 0x1B80 0x1C00 0x1C40 0x1C40 0x1C00 0x1B80 0x1CC0 0x1C80 0x1C80 0x1D00 0x1C40 0x1C00 0x1CC0 0x1C80 0x1C80 0x1CC0 0x1C80 0x1C80 0x1C40 0x1C80 0x1CC0 0x1D00 0x1C40 0x1E00 0x1D00 0x1C80 0x1D80 0x1D40 0x1C80 0x1D40 0x1D00 0x1C40 0x1D80 0x1D40 0x1D40 0x1D40 0x1D00 0x1D40 0x1D80 0x1C80 0x1D80 0x1C80 0x1D00 0x1D40 0x1E00 0x1C40 0x1CC0 0x1CC0 0x1C00 0x1D40 0x1CC0
This is a display of the first 100 elements of that array in binary:
corvette:~>caget -#100 -0b 13BMDPG1:image1:ArrayData
13BMDPG1:image1:ArrayData 100 1101100000000 1101100000000 1110000000000 1101110000000 1101110000000 1101101000000 1101100000000 1101100000000 1101110000000 1110000000000 1101101000000 1101101000000 1101100000000 1101101000000 1101101000000 1101111000000 1110000000000 1101101000000 1101001000000 1110000000000 1101111000000 1101110000000 1101101000000 1101101000000 1101001000000 1101110000000 1101011000000 1101100000000 1101010000000 1101000000000 1101011000000 1101100000000 1101100000000 1101101000000 1101101000000 1101111000000 1101111000000 1101111000000 1110001000000 1101110000000 1110010000000 1110001000000 1101010000000 1110000000000 1101100000000 1110000000000 1101101000000 1110101000000 1110000000000 1101110000000 1110000000000 1110001000000 1110001000000 1110000000000 1101110000000 1110011000000 1110010000000 1110010000000 1110100000000 1110001000000 1110000000000 1110011000000 1110010000000 1110010000000 1110011000000 1110010000000 1110010000000 1110001000000 1110010!
000000 1110011000000 1110100000000 1110001000000 1111000000000 1110100000000 1110010000000 1110110000000 1110101000000 1110010000000 1110101000000 1110100000000 1110001000000 1110110000000 1110101000000 1110101000000 1110101000000 1110100000000 1110101000000 1110110000000 1110010000000 1110110000000 1110010000000 1110100000000 1110101000000 1111000000000 1110001000000 1110011000000 1110011000000 1110000000000 1110101000000 1110011000000
The data is the same in all cases. It is just displayed differently. There is no such thing as "converting" a 16-bit integer to hexadecimal, unless you mean converting it to an ASCII string in hexadecimal notation.
I am sure this is a follow-up to your earlier questions. However, I sent you several specific questions to answer on July 9, and you have not answered them. If you want help from this group you should answer the questions that you have been asked.
Mark
________________________________
From: [email protected] [[email protected]] on behalf of ishita bhatia [[email protected]]
Sent: Tuesday, July 14, 2015 2:38 AM
To: EPICS Tech-Talk
Subject: Conversion to Hexadecimal
Hie,
I have received data in waveform record which is as follows:
datavme 72 53 51 -2 -19 127 -1 50 50 50 50 50 50 50 50 50 50 50 50 50 50 65 50 80 -14 50 64 70 -48 50 50 50 50 50 50 50 50 -113 -113 -128 -128 -128 -128 -113 -113 -113 -113 -113 -113 -113 -113 -113 -113 -113 -113 -113 -113 -113 -113 -128 -128 -113 -113 -128 -128 -113 -113 -113 -113 -113 -113 -113 -113
Please tell me how to convert this data in Hexadecimal format i.e. how can i get output as
datavme 72 0x35 0x33 0xFFFFFFFE 0xFFFFFFED 0x7F 0xFFFFFFFF 0x32 0x32 0x32 0x32 0x32 0x32 0x32 0x32 0x32 0x32 0x32 0x32 0x32 0x32 0x41 0x32 0x50 0xFFFFFFF2 0x32 0x40 0x46 0xFFFFFFD0 0x32 0x32 0x32 0x32 0x32 0x32 0x32 0x32 0xFFFFFF8F 0xFFFFFF8F 0xFFFFFF80 0xFFFFFF80 0xFFFFFF80 0xFFFFFF80 0xFFFFFF8F 0xFFFFFF8F 0xFFFFFF8F 0xFFFFFF8F 0xFFFFFF8F 0xFFFFFF8F 0xFFFFFF8F 0xFFFFFF8F 0xFFFFFF8F 0xFFFFFF8F 0xFFFFFF8F 0xFFFFFF8F 0xFFFFFF8F 0xFFFFFF8F 0xFFFFFF8F 0xFFFFFF8F 0xFFFFFF80 0xFFFFFF80 0xFFFFFF8F 0xFFFFFF8F 0xFFFFFF80 0xFFFFFF80 0xFFFFFF8F 0xFFFFFF8F 0xFFFFFF8F 0xFFFFFF8F 0xFFFFFF8F 0xFFFFFF8F 0xFFFFFF8F 0xFFFFFF8F.
I have tried using scalcout record as :
record(scalcout, vmehex1) {
field(SCAN, "Passive")
field(DTYP, "Soft Channel")
field(CALC, "'0x'+AA")
field(INAA, "datavme")
}
but this gives hexadecimal output of just first array index.
- References:
- Conversion to Hexadecimal ishita bhatia
- Navigate by Date:
- Prev:
Re: Stepper Motor Controllers Mark Clift
- Next:
Re: Stepper Motor Controllers Mark Davis
- 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:
Conversion to Hexadecimal ishita bhatia
- Next:
Re: Conversion to Hexadecimal Rod Nussbaumer
- 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
|