キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 

Search for a pattern in array

解決済み
解決策を見る

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 件の賞賛
メッセージ21/40
896件の閲覧回数

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 件の賞賛
メッセージ22/40
863件の閲覧回数

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
メッセージ23/40
859件の閲覧回数

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 件の賞賛
メッセージ24/40
848件の閲覧回数

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 件の賞賛
メッセージ25/40
845件の閲覧回数

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 件の賞賛
メッセージ26/40
841件の閲覧回数

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 件の賞賛
メッセージ27/40
839件の閲覧回数

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 件の賞賛
メッセージ28/40
832件の閲覧回数

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 件の賞賛
メッセージ29/40
818件の閲覧回数

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 件の賞賛
メッセージ30/40
804件の閲覧回数