The hexadecimal string to decimal content content

I write a code in LabVIEW to convert MBus data for some energy meters.

Apparently the meter that I use sends the data as a string in hexadecimal format, however after correctly parking that string in hexadecimal format, the real value is the decimal number in this hexadecimal string without conversion.


-Response of the meter (String in hexadecimal display):

68 37 37 68 08 07 72 89 12 13 67 A7 32 04 04 00 00 00 00 0C 06 09 58 02 00 0C 14 39 13 79 00 0B 2D 47 00 00 0 B 3 B A 30 32 00 5-0 HAS 81 03 0A 5TH 68 0 A 03 62 13 00 0F 21 04 00 00 20 86 16

-After parking, I get 22 bytes to 25 (09 58 02 00) in the right order, i.e. 09 58 00 02 meaning 25 809 MWh.

This means that I need to transfer sort the string in hexadecimal numbers to display a decimal format and divede by 1000 to get the correct value in MWh.

I tried to use the Type Cast and Conversion of string without success. Can someone please help me find a solution?

Best regards.

How's this for simplified?

Tags: NI Software

Similar Questions

  • remove the odd spaces of the hexadecimal string


    I would like to remove the odd spaces to a hexadecimal string, and the output result.  That's what the input string will look like:

    01 00 04 0F FF 36 3B CC...

    I want the output to be:

    0100 040F FF36 3BCC...

    I got the attached forum labview code earlier, but it does not work with the text.

    Any help is greately appreciated.

    Thank you


    Try this version 8.2.

  • Convert the hexadecimal string of Little Endian floating-point single precision

    I made a lot of tinkering and research, but despite all the very similar examples, I found, I think that I am limited by my lack of knowledge in programming. I gives me values such as 0000c 641 I need to convert to 41C60000 who must convert single precision IEEE754 to 24.75 as a standard 32-bit float. I saw very similar examples with boxing and unboxing conversions, but I simply can't understand it. Thank you.

    OK, so if you have actual letters coming, there are a few ways that you can do. You can basically change the string in order to get in order waiting for LabVIEW. Otherwise, you can do the same using data manipulation functions:

  • How to find the bytes in hexadecimal string start

    Hi, I'm a freshman for Labview.

    I want to find the beginning bytes in Hex string. For example, 12 1A 00 34 1A 01 23... How can I get my data of 3 bytes of the hexadecimal string which starts at 1 'a '?

    Thank you for your help.

    You will need to provide more information. You have a string that has values of bytes like this? In other words, you have the control/indicator string value "hex display mode", and that you have provided, that's what you have? Or, you have the string in normal view?

    If it is in hexadecimal display mode, then use one of the functions of the chain to get a subset of the string. Have you looked in the channel palette?

    If it is in normal display mode, then you must convert all 2 characters to hex values.

    To learn more about LabVIEW, it is recommended that you go through the tutorials and look over the material in tutorials the NI Developer Zone Learning Center , which provides links to other materials and other. You can also take a course online for free.

  • Can I use a hexadecimal string with a case statement?

    Simple question:

    Can I enter a hexadecimal string to a case statement and have the case statement see it as hex?

    I understand that I could convert the hexadecimal string to a number and then enter the hexadecimal number to the case statement but I am curious to know if I could have the case see the string itself as hex without this added feature.

    Would be nice to not have to convert all my numbers throughout my code strings

    Thank you


    How long are the strings? Since you mention convert in numbers, they are probably short and all of same length.

    Are there different possible channels how?

    Case header includes \-codes in the case of a label deal selector As string, so that should be enough for your use. For example this code turns the LED (.. .so that a simple string of "\00\00" of wiring would not be!)

    (See also the last sentence of the "enumerated values" section of the help).

  • Readed hexadecimal string converted to a decimal number.

    Hello! I do a vi to check the hours of the lamp of my Sony projector. I send a hexadecimal command which is: A901 dignitaries 1301 0000 139 a senators. When the projector receives answer with 1901 1302 0031 339. 0031 corresponds to the data that I need to convert it to decimal because it tells me how many hours we used the lamp. How can I get this read-separated string to get only the third part of hexadecimal numbers converted to decimal? Thanks in advance!

    Hey rounded!

    As the data is in a format string, the hexadecimal number VI string should work well in this case.

    To enter only a single figure of this string to use in the hexadecimal number string VI, then I suggest using the string subset VI; Returns a specified segment of a string. By changing the offset of entry which determines which part of the string data is beginning to be analyzed from and changing the length to control the amount of characters to analyze, you will be able to enter the character that you want to convert.

    Kind regards

  • Convert a single number to a hexadecimal string of 32-bit and exchange the high and low bytes

    I need to convert a number single precision floating decimal to hexadecimal format of 32 bits, share the high and low bytes and that convert a hexadecimal string.  I tried to use the 'Word of Swap' function but it seems to have no effect on the unique number.


    A single decimal number of entry: 100

    Convert 32 bit hexadecimal string with the low byte first: 0000 42 8

    Anyone have any ideas?

    Thank you

    Slightly lighter, try to cast U32 and exchange words. Same difference.

    (apparently, exchanging words is a NOOP for SGL, but still accepts SGL without constraint. Interesting...)

  • Firefox can't find the file at chrome://tavgp/content/htmlwindow.xul.

    Firefox can't find the file at chrome://tavgp/content/htmlwindow.xul.

    This has happened

    Each time Firefox opened

    == I deleted duplicate files

    It looks like a problem with an extension of the AVG. See Troubleshooting extensions and themes and problems of hardware acceleration to resolve common Firefox problems

  • Content on the laptop does not match content on ipod

    Content on the laptop does not match content on ipod

    Content on the laptop does not match content on the ipod.

    How do you load the content on the iPod?  Manually (do drag and drop items on the iPod in iTunes), or automatically (set up screen settings of music from iPod in iTunes)?

    What content isn't is?  Unless your iTunes library is small enough to fit on the iPod completely, it is normal for the content on the laptop to not game content on the iPod.

  • Display the exact string of the file as a hexadecimal display data

    I'll send control messages via a serial port, which are built in a series of bytes.  Currently, I have all these messages in an excel file which is 8 columns of 224 lines.  The messages are the exact hex display, I need for my program works.  To check my installation, I tested a few messages by manually typing in messages using a string constant and the value display hexadecimal and everything works well.  How can I get the strings in my file to be recognized as they use hexadecimal display.

    Thanks for your suggestions.

    So if I understand, you read an ASCII representation to hexadecimal format of the command strings.

    You must convert ASCII bytes, then the chain, in this way:

    The entrance on the left string must be read from your file, of course.

    Notice that the representation of the integer constant must be U8.

    You don't need the Trim function spaces if you are sure that the string does not contain additional characters beyond the last hexagonal number.

  • remove the two zeros of hexadecimal string

    I'm passing an ASCII string of bench to a VI I wrote and I start with "04" and my VI the ASCII get normal "04".  I then have to convert an ASCII string to a Hex string (using a solution of VI, which I found on the web) and instead, having it display Hex '04', it adds two zeros in the Hex display "0004".  I need to remove the two zeroes don't is just "04".  I don't know there is probably an obvious solution (I'm fairly new to LabVIEW). Thank you

    A statement of format for a cast of just wiring operation confuses the programmer. Don't, don't. The value is not important as the type. (.. .and if you want a string, you can't even wire type.) String is the default!)

    What is the representation of the blue zero constant wired scheme down to the left of "hexadecimal string to munber '? Make sure it's U8.

    Please join the real VI, many things cannot determine in a single image. Thank you!

  • Windows Media Center, says "the disk is full delete content or change the area of sotrage.

    Windows Media Center, says "the disk is full delete content or change the area of sotrage.

    What should I do? I don't think it's completely just a mistake, where us the files and I is not even saving programs!

    WMC stores the file in the Public TV folder saved on your hard drive by default, it is located at C:\Users\Public\Recorded TV.

    Check how much space is there.

  • When I run the Xbox 360 MW3 Chaos Collection Pack app, it reads 'Enter multiplayer and launch of the store to purchase new content, games and Premium Elite subscriptions'.

    Original title: Xbox 360

    I downloaded and purchased the Collection of MW3 Chaos Pack. When I in Chaos mode, it reads"enter multiplayer and launch of the store to buy new content, games and subscriptions Premium Elite. "Help PleaseXBOX 360

    Hi Dgkskr24,

    The question you posted would be better suited in the Xbox Forums. I would recommend posting your query in the Xbox Forums.


    Xbox 360 support


    Collections of Modern Warfare 3

    I hope this helps.

  • Failed to load the metadata server using GET_DOC_METADATA_INFO content model?

    Hi all

    I create connection in Jdeveloper to the repository of content both are version. I'm creating RIDC Socket type Socket.
    everything by testing the connection I get under Error.UCM runs in other ways machine come IP. trying to connect from my local Jdeveloper.

    Test failed:
    Failed to load the metadata server using GET_DOC_METADATA_INFO content model.
    Permission denied. Address ' XX. XX. XX. XX'(IP) is not an authorized remote socket address. (IP replaced by XX...)

    Why his showing that I need to put any changes of the UCM let me know problem question

    Please give me an idea about this error and the solution for the same.

    Siva sery

    To eliminate the first manifesto, see this post: fail to connect to the content if server use 'web' for the RIDC socket type and check that the other IP is allowed, amongst, IPs (you can use a mask, or type it directly) - do not forget to restart the server after the change.

    If this does not help, test, if other services such as DOC_INFO_BY_NAME can be called via RIDC, or if they have the same problem.

  • Bookmarks created automatically based on the word 2013 Table of contents.

    Bookmarks created automatically based on the word 2013 Table of contents.  In the earlier version of Word, the Style of the Table of contents built into bookmarks when PDFing.

    I thought about it.  There is a new check box, you must activate in 2013 of Word when exporting to PDF format that allows to convert the elements of bookmarks when PDFing.

Maybe you are looking for