EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Conversion to Hexadecimal
From: Rod Nussbaumer <[email protected]>
To: [email protected]
Date: Tue, 14 Jul 2015 09:17:10 -0700
Ishita:

You are confusing the *human-readable representation* of numeric data with the actual value of the stored data. The method to convert to any particular radix *for display* depends on the code or tool that you use to print or display it. Perhaps if you tell us something about that, someone can suggest an appropriate method.

If you are writing C code to display the data, for instance, you can simply use one of the printf() family functions with the appropriate format specifiers. In your case, wanting to display the data in hexadecimal notation, you would likely use the '%X' specifier, or perhaps modify it to provide more consistent formating: '%02X', for example.

Rod Nussbaumer
Controls Group, TRIUMF
Vancouver, Canada.


On 07/14/2015 12:38 AM, ishita bhatia wrote:
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 Davis
Next: Re: SubArray Andrew Johnson
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: RE: Conversion to Hexadecimal Mark Rivers
Next: using motor / steppermotor record for Trinamic TMCM-351 controller Christian Pauly
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 16 Dec 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·