LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Binary to hex conversation

Solved!
Go to solution

I want write 2 bytes of data as hex format in visa write for rs 422 communication. Each bytes has 8 bits of binary values 0 and 1. So I want to convert these into hex format. 

Eg. 1000 1100 (as array) 

How to convert these into hex. 

 

What I thought convert these 1 and 0 to boolean then convert it to decimal number and then to hex.

Anyone provide a solution please. 

 

Thanks in advance

0 Kudos
Message 1 of 12
(1,184 Views)

Please explain better what you are looking for as far as your input and output.  It would be better to supply a VI showing what you have and want, even better with default data showing an example of an expected input and expected output.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 12
(1,167 Views)

What are the two bytes of data? (an array of two U8, each 0..255? A U16 scalar? An array of 16 integers (0..1)  A binary string with two characters? A formatted string of eight characters(0..1), etc.)

 

What is your definition of Hex? (A string with ASCII characters, 0..F per nibble)? A binary string with two characters viewed in hex display? etc.)

 

Why not attach a small VI containing a diagram constant with typical input data and the desired output? (datatype and value).

 

Do you have a link for the manual of the device?

0 Kudos
Message 3 of 12
(1,163 Views)

I'm having 16 bits of 0 and 1 in a array(array size 16). I want to convert it to hexa string value. 

0 Kudos
Message 4 of 12
(1,155 Views)

@Manik981211 wrote:

I want to convert it to hexa string value. 


Still too ambiguous. Nobody here know without guessing what a "hexa string value" is.

 

A 4 character string where each character is 0..F?

A 2 character string where each bit represent an element of the input array and "looks right" if the string is set to hex display?

0 Kudos
Message 5 of 12
(1,149 Views)
Solution
Accepted by topic author Manik981211

This is what I'm guessing you are looking for based on the fact you said you wanted a 2 byte output.  Notice that the output string has a "Hex" display mode.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 12
(1,145 Views)

Sorry I don't have a system to share with vi. Simply i want to convert binary to hex value. 

Binary means string array of 16 bit(2 bytes) only 0 and 1.

 

Thanks in advance

0 Kudos
Message 7 of 12
(1,140 Views)

Thanks, I'm looking for this one only. 

0 Kudos
Message 8 of 12
(1,131 Views)

Without selecting of hex mode in string indicator any other way is there? . Because I need to write in a hex format in visa write. 

0 Kudos
Message 9 of 12
(1,118 Views)

If you want a hex format string  (normal string display!), use this instead:

 

altenbach_0-1659027514950.png

 

0 Kudos
Message 10 of 12
(1,112 Views)