02-18-2014 10:45 PM
Hi all, I am trying to convert decimal number to hexadecimal number by normal conversion in the string palate, I am getting the proper hexadecimal value when my string indicator is in Normal display mode, when I change it to hex display I am getting ASCII code. I want to convert decimal value to proper hexadecimal value for my application please some one help.
Solved! Go to Solution.
02-18-2014 11:42 PM
Post your VI. Give examples of what you have and what you want it to look like.
The problem with terms like decimal, hexadecimal, and ASCII is that they are frequently misused, and everyone has a slightly different intepretation as to what they mean by them. For instance, I don't know what you mean exactly by "when I change to hex display I am getting ASCII code."
02-18-2014 11:45 PM
Thanks friend I got solution for it my self.
02-18-2014 11:53 PM
Please find the attached VI, I got answer.
02-18-2014 11:59 PM
Well, yes... but more conventionally, you would use the Number to Hexadecimal String node in the Number/String Conversion palette.
02-19-2014 02:21 AM
@billko wrote:
Well, yes... but more conventionally, you would use the Number to Hexadecimal String node in the Number/String Conversion palette.
No, his string is in hex display, your conversion would give something entirely different.
(Granted, the original problem description was completely ambiguous and was not sufficient to give a solution.)
02-19-2014 09:03 AM
@altenbach wrote:
@billko wrote:
Well, yes... but more conventionally, you would use the Number to Hexadecimal String node in the Number/String Conversion palette.
No, his string is in hex display, your conversion would give something entirely different.
(Granted, the original problem description was completely ambiguous and was not sufficient to give a solution.)
Nah, it wasn't the OPs fault. I probably shouldn't be answering questions at midnight. Upon looking at it in the morning, his solution is totally appropriate - that's the classic way of using the Type Cast Function.
02-19-2014 09:56 PM
HI all,
While we are doing serial communication like RS 232 we need to transfer the comands to the registers in the slave in the form of hexa decimal code, If we use normal conversion like number to hexadecimal string we will get the convertion value, but during transmission, only corrosponding ASCII code is been transmited to the slave which results in instable operation.
To avoid it we must do proper hexa transmission.
See the VI attached below.
Karthick K
INDIA
02-19-2014 10:20 PM
This is all obvious once we know what you actually want. "Hexadecmal" is a display format while the device is apparently interested in the raw binary data, no matter how it is displayed.
02-20-2014 07:21 AM
Hi,
But the device is not supporting the normal formate, we have to do like this only. I have tested with my device.