From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, 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: 

Match array criteria and cut the array

Hi. I need some help. I have 1 array that has a combination of numbers 0 and 1. What I need is, I need to find the combination of number 11. Once it is found it needs to cut the rest of the array.

 

nasha0101_0-1671498641245.png

 

0 Kudos
Message 1 of 12
(1,301 Views)

Do you have any experience with problems-solving, programming (using any computing language, even Basic), or "accomplishing a task by following directions"?  Without worrying about LabVIEW or any other programming environment, can you tell us, in words, the steps you would do to accomplish this simple task?

 

If you want to learn LabVIEW, have you considered taking a class (maybe you already are?), looking for tutorial material (and doing a little studying on your own), or finding a mentor and "apprenticing yourself" to her/him?  The LabVIEW Forum is not a bad place to come to when you've put in a little bit of work, yourself, and are "stuck", so do a little bit of work and come back when you get stuck.

 

Bob Schor

0 Kudos
Message 2 of 12
(1,289 Views)

What is the data type of the array elements (string? U8? Etc.). What is the display format? Binary? Decimal? Something else?

 

Easiest would be to attach a small vi that's contains typical data in a diagram constant.

0 Kudos
Message 3 of 12
(1,273 Views)

First of all, you need to provide information as altenbach suggests.

Here, below is my preliminary suggestion.

You can use Search 1D Array and Delete From Array.

Array cut.png

Message 4 of 12
(1,248 Views)

Yeah.. I managed to do it myself a while ago. Thanks a lot for helping me and the suggestion.

 

0 Kudos
Message 5 of 12
(1,233 Views)

@User002 wrote:

Yeah.. I managed to do it myself a while ago. Thanks a lot for helping me and the suggestion.


You cannot mark a post that does not show a solution as "accepted solution". Once you post your solution, you can mark that one, so show us what you did. (Maybe we can even offer significant improvements or point to flaws.)

0 Kudos
Message 6 of 12
(1,198 Views)

This is what I have done. I using array subset to display all the array after matching with number 11.

nasha0101_0-1671604812664.png

nasha0101_1-1671604879305.png

 

 

 

Message 7 of 12
(1,176 Views)

Hi all. I have binary number in array, for example 000101001100010. I need to find array binary number that have 11 inside. Once it matching, it will cut the before number 11. Which is the output for 000101001100010 is 1100010. And the same function for the next array. Sorry for my bad explanation. I hope you guys can give me suggestion to me for continue my code.

 

Humai90_0-1671632037237.png

Humai90_1-1671632380567.png

0 Kudos
Message 8 of 12
(1,155 Views)

Hi Humai,

 

please stick with your thread instead of asking the same in a new thread!

 


@User002 wrote:

Hi all. I have binary number in array, for example 000101001100010. I need to find array binary number that have 11 inside. Once it matching, it will cut the before number 11. Which is the output for 000101001100010 is 1100010.


In your image you have an input array of U32 integers. How does that relate to a "binary array"?

 

What exactly has changed to your previous posts?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 12
(1,147 Views)

Sorry for my mistake GerdW. For input I right click the array to display as binary. My previous post it has reached my target. I just want to upgrade my code that can find the binary number that has 11, cut the number and give the output that start with 11.

0 Kudos
Message 10 of 12
(1,132 Views)