Jump to content

Trying to convert String to Byte Array... harder then I expected


temp409x

Recommended Posts

Hi,

I'm trying to take the following string and convert it into a byte array.

"01 01 13 FF 14"

But what happends is that each char gets converted into an element in the array, including spaces :

[0][1][ ][0][1][ ][1][3][ ][F][F][ ][1][4]

Where I really wanted :

[1][1][13][FF][14]

Is there a way to do this that I have not found ? I tried lots of different search/replace/index stuff but can't seem to get it right,

Very new to LabView btw,

Thanks!

Link to comment

Hi,

to convert a long space delimeted string:

use spreadsheet string to array, format string = %02X (hexadecimal),

wire a space to delimiter and a 1D I32-array [i32] to array type.

To view your data as hex, just select Radix visible on the [i32] and choose hex

good luck

tnt

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.