07-28-2022 10:22 AM
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
Solved! Go to Solution.
07-28-2022 10:57 AM
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.
07-28-2022 11:01 AM - edited 07-28-2022 11:02 AM
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?
07-28-2022 11:13 AM
I'm having 16 bits of 0 and 1 in a array(array size 16). I want to convert it to hexa string value.
07-28-2022 11:21 AM
@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?
07-28-2022 11:24 AM - edited 07-28-2022 11:25 AM
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.
07-28-2022 11:25 AM
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
07-28-2022 11:31 AM
Thanks, I'm looking for this one only.
07-28-2022 11:39 AM
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.
07-28-2022 11:59 AM