LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

converting hexadecimal string to 64 bit hexadecimal number

Hi,
Does anyone know how can I convert a hexadecimal string to a 64 bit unsigned number?
I need to create a control which the user will put in a hexadecimal 64 bit number.
0 Kudos
Message 1 of 5
(3,550 Views)
Hmm... A bit tricky as LV doesn't support 64bit integers... Anyway, try this example I've made for you - hope this helps (it uses Event structure, so LV6.1 or higher is needed). I'm not at all sure that this is a good solution. Also, example works for variable-length numbers, so if you want restrict numbers to be 64bit some minor changes (max string length control) must be applied. The result is an U32 table.
Message 2 of 5
(3,550 Views)
Well, many thanks for your help. Your example was very helpful. It all works just fine.
I was just wondering about something:
What was the "max string length control" you mentioned?
Are there any ready vis for this?
Thanks again
0 Kudos
Message 3 of 5
(3,550 Views)
By the "max string length control" I mean that to force resulting hex number to be no more that 64 bit long you can restrict your string to be no more than 16 characters long (maybe cheking this when user type in some more characters). Not always good as user can enter 17 zeros... There are other ways also - you can test as well the length of resulting U32 table.
If you want, I can tune up a bit the proposed example.
Anyway, as I mentioned earliar, there are many ways to accomplish this kind of user control and mine are not always good - this depends of the task you have. If you are interested, I can make example of some other approache...
0 Kudos
Message 5 of 5
(3,550 Views)