02-06-2012 08:13 AM - edited 02-06-2012 08:16 AM
Hello everyone,
I know, this will be a very simple question, but I could not solve this. When I entered a text to text control box in Hexadecimal. I want this text to be converted into hexadecimal number. I am using unflatten from string function.
If I enter 8 characters it causes no errors. For ex: 1234 5678.
But If I enter 1234 for example, it causes the following error:
LabVIEW: Memory or data structure corrupt.
How can I solve this problem? Thank you and best regards,
Solved! Go to Solution.
02-06-2012 11:57 AM
I'd try the "Hexadecimal string to number" function. That should work as long as your string contains 1 to 8 hex digits.
Mark Moss
02-07-2012 04:03 AM
Hello,
Thank you for your response but no output is given after I try this function. Please find the updated file on the attachment.
02-07-2012 05:13 AM
The error that you are getting with Unflatten From String is because this function is made to get as an input a flattened string that is typically generated by the flatten to string function (please refer to LabVIEW help if you need more informations about this function). I attached an example with several functions that you can use. You can use also the function type cast.
02-07-2012 06:33 AM
02-08-2012 03:58 AM
@Carmen: Thank you, it seems it is working if the string representation is normal text, but I need to use it in Hexadecimal representation.
@mikeporter: Yes it is already in Hexadecimal format.
02-08-2012 04:30 AM
Take a look at this example, see if you can get some ideas out of it:
02-08-2012 04:57 AM
Have you tried Type Cast it to U16 array? That way you get decimal value of each 4-digit word.
02-08-2012 01:33 PM
Hello,
Thank you. I will try and tell you the result tomorrow...
02-09-2012 04:33 AM
Hello,
I would like to explain my aim again.
I would like to create a MAC address from the serial number. For example in Serial Number Field, I am writing 1203 and the MAC address becomes: 000A 3500 1203. I would like to generate a report using Easy Text report and would like to print both Serial number and the MAC address in Hexadecimal.
I try to connect MAC address indicator directly to the report text input. When I print, only string representation of the MAC address is printed (e.g. ..s).
How can I make this to be printed successfully?
Thank you again...