Conversión decimal a hexadecimal

¡Hola!
      Quiero convertir un número decimal en hexadecimal. A medida que varíe un "pointer slide" con valores decimales, un indicador númerico me vaya mostrando dicho numero pero en formato hexadecimal.
¿Se puede, alguien sabe cómo hacerlo?
Adjunto una imagen de la idea para que sea más clara la pregunta.
Saludos.
Adjuntos:
Ejemplo.png ‏7 KB

Estoy controlando un variador de velocidad por medio de Modbus (empleo una conexión RS485). Dicho variador se programa con formato HEXADECIMAL.
Para lograr esto estoy utilizando la libreria Modbus, en la cual sus entrada acepta un valor U16 (unsigned 16 bits).
La pregunta es:
¿Cómo hago o existe algun bloque para convertir un número decimal (el cual lo voy variando con una perilla desde el panel frontal) en U16 hexadecimal? Usé un conversor decimal/hexadecimal pero la salida del mismo es un string y esto no me sirve.
Adjunto una imagen para que sea más claro.
Adjuntos:
Esquema.JPG ‏45 KB

Similar Messages

  • Conversion of Decimal to Binary String

    Hello Labview People:
    I'm rather new to Labview, so this may be a simple-minded question . . .
    I would like to take a numeric control and have the decimal input
    converted to a binary string of 8 bits. So, for example, if I were to
    put in the number '127', I would get out (on an indicator) the string:
    01111111
    The number '128' would show on the indicator as:
    10000000
    It seems to me that this should be simple, but somehow I cannot figure
    out how to do it. Must an array be built bit by bit to accomplish this?
    (I'm afraid I don't yet know how to build arrays.)
    Thanks in advance for any help you provide!
    Sent via Deja.com http://www.deja.com/
    Before you buy.

    Or, you can go under the numeric function, and look for conversions, get
    decimal to byte array conversion.
    Then what you need to do is to get an array selection vi, and index to zero.
    I don't remember the exact name of the VI's because I don't have LabView
    here with me.
    Perhaps this complicates things
    Steven
    "Timo Miettunen" wrote in message
    news:[email protected]..
    > use format into string VI from string palette
    >
    > format string should be "%08b" for 8 bits, "%016b" for 16 bits etc.
    >
    > timo
    >
    > Ananda Dave wrote:
    > >
    > > Hello Labview People:
    > >
    > > I'm rather new to Labview, so this may be a simple-minded question . . .
    > >
    > > I would like to take a numeric control and have the decimal input
    > >
    converted to a binary string of 8 bits. So, for example, if I were to
    > > put in the number '127', I would get out (on an indicator) the string:
    > >
    > > 01111111
    > >
    > > The number '128' would show on the indicator as:
    > >
    > > 10000000
    > >
    > > It seems to me that this should be simple, but somehow I cannot figure
    > > out how to do it. Must an array be built bit by bit to accomplish this?
    > > (I'm afraid I don't yet know how to build arrays.)
    > >
    > > Thanks in advance for any help you provide!
    > >
    > > Sent via Deja.com http://www.deja.com/
    > > Before you buy.
    >
    > --
    > -------------------------------------------------
    > Timo Miettunen
    >
    > Fincitec Oy Production Department
    > e-mail: [email protected]
    > Address:
    > Lumikontie 2 Tel: +358-16-2151245
    > PO BOX 11 Fax: +358-16-221561
    > FIN-94600 KEMI Finland
    > -------------------------------------------------

  • Convertion from Decimal to Hexadecimal

    Hi,
    Can you please tell me the way to covert a given decimal number into hexadecimal (for example 4 -> 04, 20 -> 14 etc) and also the vice versa.
    thank you.

    Hi
    Try this function module:
    " CRM_EI_KB_CONV_DEC_TO_HEX "
    This fm converts any decimal to hexadecimal, but not vice-versa.........
    Hope it helps....

  • SAMPLE:C,DECIMAL TO HEXADECIMAL OR REVERSE

    제품 : PRECOMPILERS
    작성날짜 : 2002-05-26
    SAMPLE:C,DECIMAL TO HEXADECIMAL OR REVERSE
    ==========================================
    PURPOSE
    다음의 간단한 두 C Source code들은
    16진수를 10진수로 10진수를 16진수로 바꾸는 방법의 예를 보이고 있습니다.
    EXAMPLE
    prompt$ vi hex2dec.c
    #include <stdio.h>
    int main(void) {
    unsigned int num;
    printf("Hexadecimal number ? ");
    scanf("%x", &num);
    printf("(%d)10\n", num);
    return 0;
    :wq
    prompt$ vi dec2hex.c
    #include <stdio.h>
    int main(void) {
    unsigned int num;
    printf("Decimal number ? ");
    scanf("%d", &num);
    printf("(%X)16\n", num);
    return 0;
    :wq
    prompt$ cc -o hex2dec hex2dec.c
    prompt$ cc -o dec2hex dec2hex.c
    prompt$ ./hex2dec
    Hexadecimal number ? 7FFF
    (32767)10
    prompt$ ./dec2hex
    Decimal number ? 32767
    (7FFF)16
    Reference Document
    ------------------

    Try the SDK forum.

  • Decimal to Hexadecimal convertion

    Hi, how can I converte decimal(NUMBER) to Hexadecimal in PL/SQL ?
    I need to translate the NUMBER: 50545326 to haxadecimal: 030342AE
    But my SQL return C43337361B, see below:
    SELECT RAWTOHEX( utl_raw.cast_from_number( 50545326 ) )  --> I wish 030342AE value
      FROM DUAL;

    Luciana T. Angeli wrote:
    One more question, I see that negative numbers can't be converted to Hexadecimal this way.
    It is possible to convert negetive decimal numbers to hexadecimal format ?Negative numbers need to be displayed as 2's complement to be shown in hexadecimal, so you would have to specify (in effect) how many bytes you are dealing with.
    e.g. if you know your are dealing with 4 byte numbers...
    SQL> ed
    Wrote file afiedt.buf
      1  with t as (select &num as num from dual)
      2* select to_char(case when num<0 then 65536+num else num end, 'fmXXXX') as hx from t
    SQL> /
    Enter value for num: 123
    old   1: with t as (select &num as num from dual)
    new   1: with t as (select 123 as num from dual)
    HX
    7B
    SQL> /
    Enter value for num: -1
    old   1: with t as (select &num as num from dual)
    new   1: with t as (select -1 as num from dual)
    HX
    FFFF
    SQL> /
    Enter value for num: 32767
    old   1: with t as (select &num as num from dual)
    new   1: with t as (select 32767 as num from dual)
    HX
    7FFF
    SQL> /
    Enter value for num: -32768
    old   1: with t as (select &num as num from dual)
    new   1: with t as (select -32768 as num from dual)
    HX
    8000
    SQL>If your numbers are larger you need to increase your format mask and increase the value (65536) appropriately.

  • Conversion of Decimal datatype

    Post Author: tanuja.patankar
    CA Forum: Data Integration
    Hi Friends,
    I am pretty new to DI 11.7 but I am experiencing a funny issue.I have a calculation in my query transform which has A/B where A is a decimal(10,2) and B is int .The output calculation column does not retain the decimal numbers .I tried the following :-
    1.Made the calculated collumn as a decimal(10,2), it didnt work.
    2.Made the collumn B to a decimal(10,2) it didnt work.
    3.Used To_char to convert the calculation in char to retain the decimal numbers, it didnt work.
    4.Used concatenation operator making the calculated column as a varchar:-'To_char(A/B)||'.'||To_Char(Mod(A,B)),it didnt work.
    5.Tried To_Decimal and to_Decimal_ext, it didnt work
    6.Tried using Cast() function , it didnt work too.
    Hence if the output of the calculation is 122.34 i would always end up getting 122.00 or 122.
    Please help and let me know if there is anyother way to go about it.
    Best Regards,
    Tanuja

    Post Author: bbatenburg
    CA Forum: Data Integration
    It seems you tried quite a lot. For problem solving you can use the validation is_valid_decimal/ is_valid_int. This should help you pinpointing the location of the problem. I always them when i encounter problems with datatypes.

  • File content conversion : hexa decimal character value for tab

    Experts,
       I am working on a FCC for a tab delimited file. Can any one tell me what is the hexadecimal value of tab. I am using '0x09' but it is not recognizing this.
    Can anyone help me out..
    Thanks
    Veeru

    Hi Veeru,
    >    I am working on a FCC for a tab delimited file. Can any one tell me what is the hexadecimal value of tab. I am using '0x09' but it is not recognizing this.
    Have a look at this bolg /people/shabarish.vijayakumar/blog/2005/08/17/nab-the-tab-file-adapter . You can try the 2nd method given in that. If that doesn't solve your issue, might be there is some other problem in the FCC configuration.
    Regards,
    Sunil Chandra

  • Conversion from decimal to char

    Hi experts,
    i am using some function module which has parameter of type char(132) . now i have to pass packed no  p(7) decimals 3 
    to  this how to do it .  if i send directly function module raising run time error ( type conflict).
    how we can do this.
    regards,
    santosh.

    Hi Santosh,
    Try this code for conversion.
    DATA: AMOUNT(7) TYPE P DECIMALS 3.
    DATA : VAR TYPE CHAR13.
    DATA : VAR_1(132).
    AMOUNT = '12345.333'.
    WRITE AMOUNT TO VAR.
    VAR_1 = VAR.
    CONDENSE VAR_1.
    AND PASS THE VALUE OF VAR_1 TO YOUR FM.
    HOPE THIS WILL SOLVE YOUR PROBLEM.

  • Conversion of decimal number

    hi,
    how to convert a decimal number
    suppose i want to convert 500.00- to 500.
    plz help me in resolving this.

    Hi Ramya,
    You can use Field symbol with CASTING operator to convert decimal to Numeric Type (Intergers). You can try with other Numeric type also.
    data:wf_int type i,
    wf_dec(10) type x.
    field-symbols: <fs> type any.
    wf_dec = '28'.
    assign wf_dec to <fs> casting type i.
    wf_int = <fs>.
    write wf_int.
    kindly reward if helpful.
    cheers,
    Hema.

  • Is there a way to convert decimal or hexadecimal string to bcd on labview 8.0 or 7.1??

    i am trying to convert user input data to bcd data. is there a way to do this besides converting each individual data bit to binary?

    How do you want the data represented in memory? Because the BCD code only takes 4 bits there are several options:
    One byte per digit with the unused bits set to zero
    One byte per digit with the unused bits set to ones (hardly anybody does this anymore)
    Two digits stored in each byte
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Conversion from decimal to binary!

    int i=1234;How can I convert an integer to its binary form??

    int i = 1234;
    String binInt = Integer.toBinaryString(i);

  • How to convert bitwise operator for oracle

    hi all,
    Please help me to get convertion for (IP/16777216)&0xFF like
    If I have query select (IP/16777216)&0xFF I need IP address like 10 is there any way to do this
    Thanks in Advance
    Prashant

    Hi..
    Well not very clear with the question.
    If you want the ip you can use
    select utl_inaddr.get_host_address(Host_Name) from V$INSTANCE;
    If you want some conversion from decimal to hexadecimal you can refer to
    [http://arjudba.blogspot.com/2008/10/convert-decimal-to-hexadecimal-on.html]
    [http://www.jlcomp.demon.co.uk/faq/base_convert.html]
    Anand

  • Converting a hexadecimal string to ASCII-characters.

    I have long hexadecimal strings that I wish to convert to their corresponding ascii-characters. I know there are a series of functions for doing things like this - hex to number, number to string etc.
    At the moment, however, I am stuck at entering the hexadecimal string. I connect it to "hexadecimal string to number". What I get out is the decimal value of the two last digits of the hexadecimal number. No other wires are connected to the function. This means data is lost. How do I get around this? Is this particular function at all suitable for what I am trying to do?

    Hi Tzench,
    "hexadecimal string" isn't very accurate and conversion questions have been discussed many times before...
    See example on conversion of two different "hexadecimal" strings. There are other conversion methods, but those are most easiest to understand
    Message Edited by GerdW on 12-08-2008 11:27 AM
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome
    Attachments:
    HexString_LV71.vi ‏35 KB

  • Conversion of binary string into headecimal

    Ho will i convert binary string into hexadecimal fromat

    HI,
    Thanks but the above module is not present my system.
    I have number which needs to be converted into binary first and then into Hex.
    I have written it code for conversion of decimal number into Binary.But i am not able to convert it into Hex.
    My rough code is ....
    types : begin of t_temp,
            r1 type i,
            end of t_temp.
    data : ty_temp type standard table of t_temp ,
           wa_temp type t_temp.
    DATA : num TYPE i,
           temp1 TYPE string,
           temp2 TYPE string,
           temp3 TYPE string,
           temp4 TYPE x.
    temp1 = 0.
    temp2 = ''.
    num = 64.
    while num ne 1.
      temp1 = num MOD 2.
      num = num / 2.
      If temp1 = 1.
        num = num - 1.
      endif.
      concatenate temp1 temp2 into temp2 .
    endwhile.
      temp1 = 1.
      concatenate temp1 temp2 into temp2 .
      condense temp2 no-gaps .
      WRITE : temp2 .

  • BCD to decimal and viceversa

    Hi,
    Am working on conversion of decimal to BCD (Binary coded decimal) and viceversa. I require BCD for calling Cobol from Java using JNI.
    Can anybody help me out in giving a pointer or an algorithm for doing the same.
    I Googled on the web for any info on BCD conversion, but all in vain. Even Java Forums here in Sun also donot have any info on the same.
    Please help me out.
    TIA,
    Prashanth Babu.

    You'll have to adjust this to do put the output where you want. Surely not the only (and maybe not elegant):
       /** Write specified string into stream as two Binary-Coded Decimal (BCD)
        *     digits.
       private static void writeTwoBCDDigits(DataOutputStream stream,
                                             String           twoDigits)
              throws IOException
          // Convert two digits to Binary-Coded Decimal (BCD).
          // The "write(int)" function writes a numeric value in binary to the
          //    stream.
          // If the twoDigits string is parsed as a hexadecimal integer, then
          //    writing the equivalent decimal integer using "write(int)" will
          //    generate the correct BCD numbers.
          // For example, if twoDigits is "54", parsing this as the hexadecimal
          //    integer 54 results in twoBCDDigits as the decimal integer 84.
          //    Then, "write(84)" will write the correct bits to the stream:
          //    "0101 0100" (space not included).
          //    "0101" = BCD '5' and "0100" = BCD '4'.
          int twoBCDDigits = Integer.parseInt(twoDigits, 16);
          // Write out the numeric value of twoBCDDigits in one byte.
          stream.write(twoBCDDigits);
       }

Maybe you are looking for

  • DeskI report refreshable on the web

    I am attempting to make a DeskI report available on the web.  That part was easy, i saved as HTML, and was able to view it on a web page.  But we need a step further,  i need to be able to make this report refreshable, it has 4 prompts.  We want the

  • 3G Duo Dock

    Will Apple be coming out with a duo dock that will fit both the 3G iPhone and the Apple BT headset. I thought it was one of the best features of the original Apple iPhone/BT headset combination. Thanks for your help.

  • How to get a case number for license transfer?

    Dear all, I would like to transfer my Creative Suite CS6 Production Premium license to a new owner. After some internet searching I already found the instructions at http://helpx.adobe.com/de/x-productkb/policy-pricing/transfer-product-license.html#m

  • Using Wlan in E71

    Hi Guys, I have recently bought a E71-1 phone. I have a few issues while connecting to my office network. My office network is a WPA2-Enterprise/EAP-FAST with AES-CCMP encryption. The EAP-FAST enhancements (CCXv4) has been disabled along with unathen

  • HTTP Server process dies

    Hi We have got Oracle9ias release 9.0.3 with Webcache running on a 4 processor 4GigRam server. JDK is 1.3.1_02. The HTPP server process dies after a while. The entry in the imp.log reveals this: 03/11/10 20:20:34 ipm_hc_get_headers: failed to get rep