From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Split 1D array

In the attached VI .. how to let the first subarray contains the first element in the input Array  ?

first subarray = 1111111111

second subarray= 0000000000 & 1

0 Kudos
Message 1 of 6
(2,863 Views)

Hi Marina,

 

how to let the first subarray contains the first element in the input Array  ?

Using this:

check.png

the "first subarray" contains the first element of "Array" and "second subarray" contains the remaining elements…

 

It would be easier to follow your question when your "Array" would contain some real data!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(2,850 Views)

This is not happening ... what is happening is the "first subarray" contains the second element from "Array" and the "second subarray contains the rest of the elements. To check it run the attached VI .. 

0 Kudos
Message 3 of 6
(2,843 Views)

Hi Marina,

 

it's "not happening" because you use a loop - and I don't…

 

Please explain with more details, what you really want to achieve!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 6
(2,835 Views)

What I need is to check each elemnt in "Array of blocks" and if any element in this array has no. of bits < 7 then add zeroes to the left of the element 

Output Array :

0000000

0000000

0000001

 

 

 

How can I make it generic for any case 

0 Kudos
Message 5 of 6
(2,823 Views)

Hi Marina,

 

is this connected with your recent other threads? You have been told to use numerics instead of strings!

 And you already marked an answer as solution to your problem! So why do you create a new thread for that old topic?

 

Either use numeric indicators set to your desired display format - or create your strings with the correct formatting options!

 

As others have said in your other thread(s) you need to use the correct format string like this:

check.png

This ensures atleast 7 digits in your binary string…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 6
(2,812 Views)