LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using Brute Force in an array

Solved!
Go to solution

hi GerdW,

i tried it your way but this is what i was getting array 1 input and array 2 output

 

but what i was trying to do is this which is file11 if you can look at which i have uploaded a little earlier if you cant ding it i can upload it again.

 

 

 

0 Kudos
Message 11 of 22
(1,142 Views)

Hi hasnain,

 

this is what i was getting array 1 input and array 2 output

The last image looks correct for me - as much as I can tell from just that image.

 

but what i was trying to do is this which is file11

That image is entirely unclear for me. I have no idea why/how you would empty strings in the output array - you didn't say so in your description of the problem.

 

Generic advice:

When you have problems with your VI then its a BAD IDEA to attach just some images of a frontpanel. It would make so much more sense to attach the VI instead!

Specific advice:

I prefer VIs saved for LV2017 (or older). LV2018 is rather fresh and not everybody has it installed yet (like me).

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 12 of 22
(1,134 Views)

@GerdW wrote:

but what i was trying to do is this which is file11

That image is entirely unclear for me. I have no idea why/how you would empty strings in the output array - you didn't say so in your description of the problem. 

 


To me 11.png ("requested result") looks the same as 12.png ("your solution"). Main difference in 11 is, that the result array is transposed, so the 2D array has its values "in the same direction" as the input 1D array.

And somehow it only shows values for the first two (constant) input values, and both B's. I assumed that the output 2d array in 11.png was just a simplification showing the important values, rather than all. Hasnain, can you help us here?

 

Maybe like this: Is this way you need? If not, could you give some correct test cases?

 

Input: 10
Output: 10

Input: 00B
Output: 000, 001

Input: 10BB11
Output: 100011, 100111, 101011, 101111

Input: BBB
Output: 000, 001, 010, 011, 100, 101, 110, 111

 

 And shall the result be inside an 1D array? Or a 2D array?

 


Ingo – LabVIEW 2013, 2014, 2015, 2016, 2017, 2018, NXG 2.0, 2.1, 3.0
CLADMSD
0 Kudos
Message 13 of 22
(1,132 Views)

@GredW your solution is right for 1D Array i was not able to explain it earlier. It gives the write answer and sorry about it. 

And @ikaiser is saying it right it was my bad i didn't explain it better 

0 Kudos
Message 14 of 22
(1,122 Views)

"write"  or "right" ???

0 Kudos
Message 15 of 22
(1,120 Views)

here the result of what i got from your solution

0 Kudos
Message 16 of 22
(1,120 Views)

@RavensFan  nice catch corrected it 

0 Kudos
Message 17 of 22
(1,118 Views)

Hi hasnain,

 

what's wrong with result 121?

Every "B" is replaced by either "0" or "1", and you got 16 rows from your input vector containing 4 "B" elements!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 18 of 22
(1,116 Views)

there is nothing wrong with the result it is the right one @GredW

0 Kudos
Message 19 of 22
(1,109 Views)

Nice!

Does that mean your original question is answered, Hasnain?


Ingo – LabVIEW 2013, 2014, 2015, 2016, 2017, 2018, NXG 2.0, 2.1, 3.0
CLADMSD
Message 20 of 22
(1,106 Views)