LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

hex character into columns

Hi, I am trying to go from ascii characters to Hex. It works fine. but I need my hex numbers to show in 4 columns ( as show on this text file, how can I do that?

 

 

Download All
0 Kudos
Message 1 of 9
(3,114 Views)

Four columns on your front panel string display?  Then just resize your string indicator so it is only wide enough to show 4 bytes across.

 

Or do you want this to show in a text file?  Then convert the string to a byte array.  Resphape the array from a 1-D to a 2-D.  Convert to hexadecimal characters.  Then use the 2-D input for strings for Write to Spreadsheet file to output to a text file.

0 Kudos
Message 2 of 9
(3,098 Views)

Ravens Fan beat me to it. But here it is in code.

 

snippet.png

=====================
LabVIEW 2012


0 Kudos
Message 3 of 9
(3,087 Views)

Thanks, but it looks like I cannot get the all thing.

0 Kudos
Message 4 of 9
(3,085 Views)

Oh! Thanks, I didn't see this last reply yet.

0 Kudos
Message 5 of 9
(3,083 Views)

 


@agyna wrote:

Thanks, but it looks like I cannot get the all thing.


 

You misunderstood what Ravens Fan said. He told you to simply resize the front panel string indicator, not to chop up the string in code.

 

To learn more about LabVIEW it is recommended that you go through the introduction material, tutorial(s), and other material in the NI Developer Zone's Learning Center which provides links to other materials and other tutorials. You can also take the online courses for free.

0 Kudos
Message 6 of 9
(3,076 Views)

For the non-Regex-impaired and those who dislike padding with zeros.

 

HexRegex.png

0 Kudos
Message 7 of 9
(3,075 Views)

 


@Darin.K wrote:

For the non-Regex-impaired and those who dislike padding with zeros.

 

 


Regular expressions are much more clear after they have been compiled to machine code.

 

Spoiler
Just kidding. They only look confusing if you are not familiar with them. They really do make sense after you learn them and are very powerful!

 

 

 

=====================
LabVIEW 2012


0 Kudos
Message 8 of 9
(3,066 Views)

Thanks a lot, both are giving me what I needed.

0 Kudos
Message 9 of 9
(3,039 Views)