Jump to content
Sign in to follow this  
temp409x

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

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!

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Wow,

Thanks everyone, got it working great.

Now I just need to figure out how to add Input and Outputs to my subVIs and I'm good to go. I'll make a post about that.

Share this post


Link to post
Share on other sites

Join the conversation

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

Guest
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.

Sign in to follow this  

×
×
  • Create New...

Important Information

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