LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Search for a pattern in array

Solved!
Go to solution

Hi Tom,

 

default editing mode -> Binary, 4 digits, with leading zeros

advanced editing mode: %04b

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 21 of 40
(666 Views)

Hi Gerd,

I've made several exercises with this code.

It's a great simplifying of decoding.

In next step I'm trying to "cut-out " from Input array portions of 18 messages if  6 first bits are equal to 1.

I'm struggling with two issues:

1. Compound Arithmetic returns TRUE only with first iteration of internal LOOP.

 Even if all six inputs in following iteration provides TRUE and Boolean Compound Arithmetic (AND) shall returns TRUE  it returns  FALSE

2. Case structure returns 2 times "Matched Found Array" with detection.

 

Tom_wolf_1-1709721764618.png

Is there more simple method to receive 2-D subarrays which starts with 111111 and contain 18 following rows?

 

Best regards

Tom

 

0 Kudos
Message 22 of 40
(633 Views)

Hi Tom,

 

mind to downconvert for LV2019?

 

On your image:

  • Comparing a boolean with TRUE is Rube-Goldberg!
  • All those "+1" are Rube-Goldberg!
  • When the inner loop iterates FOREVER then the outer loop is senseless...
  • Why don't you index a row from your 2D array and compare with a constant to detect your "TTTTTT" condition?
  • This shift register of the inner loop seems senseless, too.
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 23 of 40
(629 Views)

Hi Gerd, 

I think that on code below all "Rube-Goldberg" machines are eliminated

After first test, it looks that it works correctly.

 

Tom_wolf_0-1709734913437.png

Let me know Your comments.

 

P.S In next session, I will start the battle with decoding data from captured messages

Best regards

Tom

0 Kudos
Message 24 of 40
(618 Views)

Hi Tom,

 


@Tom_wolf wrote:

After first test, it looks that it works correctly.

 

Let me know Your comments.


Well, I see several possible improvements - but you didn't attach code converted for LV2019…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 25 of 40
(615 Views)

Hi Gerd,

 

Should I issue request for downconvert in separated forum on NI Community?

I don't see at first look this kind of option in my Labview.

 

Regards

Tom

 

0 Kudos
Message 26 of 40
(611 Views)

Hi Tom,

 


@Tom_wolf wrote:

I don't see at first look this kind of option in my Labview.


Did I mention "File->Save for previous" before? (Ok, apparently not in this thread…)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 27 of 40
(609 Views)

Hi Gerd, 

Attached is VI downconverted to the LV 2019.

If You will detect any potential optimization opportunities, let me know please.

Thank You

Best regards

Tom

0 Kudos
Message 28 of 40
(602 Views)

Hi Tom,

 


@Tom_wolf wrote:

Attached is VI downconverted to the LV 2019.


Nope, you still attached the VI saved in LV2020.

Fortunately I'm on a computer with LV2021 now…

 

See this:

As you get only 2 bits from your numeric data the "appended array" contains only 2 columns (after transposing)!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 29 of 40
(588 Views)

Hi Gerd,

This is also very good solution.

There should be Decrement instead of increment otherwise we lost first two rows ( there is TTTT instead of TTTTTT)

Tom_wolf_0-1709792446013.png

 

My improvements are:

- eliminate Loop For - only one loop

- elimination array transposition function but adding array subset + index array. This will give me that all subsets are separated to the Matched Found Array.

Tom_wolf_1-1709792553149.png

 

Attached VI

 

best regards

Tom

 

0 Kudos
Message 30 of 40
(574 Views)