LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I inverse the Split 1D Array by recombining the splitting array?

Solved!
Go to solution

How can I inverse the Split 1D Array by recombining the splitting array? i.e I have two boolean arrays A and B, and I want them in one boolean array: A array elements followed by B elements (NOT Interleaving)

 

Thank you

 
0 Kudos
Message 1 of 10
(4,087 Views)

Hello ysma,

 

You can use the "Build Array" function from the Array pallet. The function has two option to connect the inputs. One makes a 2D Array out of the inputs an the other one connects the inputs and it is still an 1D Array.

 

I hope that helps you.

 

0 Kudos
Message 2 of 10
(4,078 Views)

This input mode is switched by right clicking the Build Array primitive, right clicking, and selecting Concatenate Inputs:

 

conc-array.png

---
CLA
0 Kudos
Message 3 of 10
(4,071 Views)

What I want to do is making encapsulation for a random packet (group of logic bits ones annd zeros) like a network packet by entering my data with IP address, both are in decimal numbers, then I turned both of them to a boolean array, after that I want to make a packet datagram by putting IP data as a header followed by my data.

 

When I did this, Build Array added just first bit for both entries, and when I marked on Concantenate Inputs, it added ony the first array.

 

It can be done easily by decimal numbers, but boolean? Did I miss something?

 

See attached vi file

 

 

 

 

 
0 Kudos
Message 4 of 10
(4,022 Views)

Hi ysma,

 

can't open your VI so a basic example on concatenating arrayshas to do:

check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 10
(4,013 Views)

If you want the appearance of concatenating Boolean arrays in the manner that you describe, I believe you can also logical shift the numeric value for array B and then adding the numeric values of A and B together. Something similar to this:

 

AcatBbool.png

---
CLA
0 Kudos
Message 6 of 10
(4,009 Views)

Also, on second thoughts, if you're converting a number to a Boolean array, the resultant array is either 8, 16, 32 or 64 elements long depending on the numeric being converted.

 

So if you're concatenating A (32-bit integer to Boolean array) to B (32-bit integer to Boolean array) it may take some scrolling through elements to see the elements from array B 🙂

---
CLA
0 Kudos
Message 7 of 10
(4,004 Views)

Thank you Marcus_Körner , 

 
Download All
0 Kudos
Message 8 of 10
(4,001 Views)
Solution
Accepted by topic author ysma

Hi ysma,

 

- you cannot convert SGL data directly to boolean array as the red CoercionDot is showing you...

- you still don't concatenate the arrays (despite all the comments in this thread) but instead create a 2D array...

 

Try this:

check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 10
(3,996 Views)

Thank all of you indeed  

 
0 Kudos
Message 10 of 10
(3,986 Views)