LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Split array content

Hi,

 

I am working with hexadecimal data in an array. I want to split the content of the data to a 2d array. 

So, what I want is for example, I want character 1-2 in one cell, character 3-10 in the next cell, and so on. 

 

Do youhave an idea how to help me?

 

Thank you!

Download All
0 Kudos
Message 1 of 5
(3,710 Views)

Thanks for attaching the array of strings VI, I guess.... but it doesn't include any data other than the default value being an empty array of "3A010009005C00F2D192457821C83B00000000BD1A203C0000C0BB0000003C004087BFBF1A8BC2223D1842565581417465CD3B0ED9A3B8F81E203C4C326DBF19C1A8BBB8E39E3B4391C03E4637C1BBD0B1523C3C6B453F5E29853B84D6183BE033EFBCFF250D0A"

 

What criteria are you splitting the strings by? Just 1-2 always and 3-10 always?

 

You can split the array using a For loop and iterating through each element of your 1D array. Within each iteration of the For loop, split the string however you would like and create a 1D array within. Output that 1D array with auto-indexing and you will have a 2D array like you want.

One thing to keep in mind here is that if you have iterations create arrays of different sizes, the 2D array output will be of column dimension matching the largest 1D array. The smaller 1D arrays will automatically fill in the extra space with empty strings.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 2 of 5
(3,703 Views)

Thank you for your reply. 

 

It is data, measured by a accelerometer, connected by bluetooth to LabVIEW.

So every string of data will we different, but has to be split in the same order.

To analyze the data, the content has to be split. (See the attached image for the conversion table as indication. This is not the correct table, because the string contains more data than the table describes.) I am figuring out how it exactly should be split, but if I'm able to split, it will hopefully make it easier to find out how I should split it. 😉

 

I hope this makes it more clear what I'm trying to do.

0 Kudos
Message 3 of 5
(3,695 Views)

I see that I saved the data wrong, so now every string is the same. Attached the vi with different data.

0 Kudos
Message 4 of 5
(3,685 Views)

This is a basic LabVIEW array operation that you're trying to do. Here's the general idea:

data splitting (1).png

 

If you're having trouble with this, I suggest you look in to some training.

"Give me six hours to chop down a tree and I will spend the first four sharpening the axe."  - Abraham Lincoln

Here are some free training tools primarily focused on LabVIEW and NI hardware to help get started.

NI Learning Center

NI Getting Started

-Hardware Basics

-MyRIO Project Essentials Guide (lots of good simple circuits with links to youtube demonstrations)

-LabVEW Basics

-DAQ Application Tutorials

-cRIO Developer's Guide

Learn NI Training Resource Videos

3 Hour LabVIEW Introduction

6 Hour LabVIEW Introduction
Self Paced training for students
Self Paced training beginner to advanced, SSP Required
LabVIEW Wiki on Training

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 5 of 5
(3,677 Views)