LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to compare 1D array

Solved!
Go to solution

Hi, TImmy download this Vi without image file.

 

It's size is lower compared to last one

 

Prashant

PBP
Labview 6.1 - 2019
0 Kudos
Message 11 of 18
(1,457 Views)

Prashant

 

Your VI is in LabVIEW 10, while the original poster only has LabVIEW 8.5.

 

There are many problems in your VI

 

  • Incrrect datatypes (lots of coercions, e.g. comparing an I8 value with an I32 diagram constant)
  • "I8 _AND_ xFF" is the same as "I8". This operation is not necessary
  • You are only comparing in chunks of 5 characters, ignoring possible smaller frame shifts.
  • Since the middle loop can only stop if a match is found, the output is always true and the later case structure is not needed (of course there should be other ways to stop the program if a match is never found!)
  • You can eliminate the "AND array elements" by setting the comparison mode of the equal to "compare aggregates"
0 Kudos
Message 12 of 18
(1,448 Views)

Hi Altenbach,

 

Thannking you for your feedback. I will correct and reupload.

 

 

PBP
Labview 6.1 - 2019
0 Kudos
Message 13 of 18
(1,438 Views)

Hi,

Find updated VI with corrections mentioned by Mr. Christian Altenbach .

PBP
Labview 6.1 - 2019
0 Kudos
Message 14 of 18
(1,420 Views)
Solution
Accepted by topic author PakAsia

Last VI was in Version 2010.

Find attached Vi in version 8.5

PBP
Labview 6.1 - 2019
0 Kudos
Message 15 of 18
(1,419 Views)

Thanks Parashant and Albentech...

The VI you send me is correct and it works well. I put portion of code in while loop after checking status of port so that it must read data all time and check it for 5 byte check until if stop by user.

But you read data in chunk of 5 byte and it works for multiple of 5... but if data is not in multiple of 5 the check willnot be true...

I make manual tester that read data continously on line. As BMS send data and then w8 for response before time out. I send data back manually with write_hex.vi that i mailed you before. Although this technique doesnot work properly but for my testing purposes the vi that you send me and this manual technique is enough.

Once again thanking you both for your help and time..

timmy
0 Kudos
Message 16 of 18
(1,396 Views)

Hi, Timmy

 

Check out modified VI. I think this VI will work even if data is not comming in chunk of 5. This VI will continously read data from port and will compare you reference data.

 

Check it and give me feedback.

 

Prashant Patel

CLAD

PBP
Labview 6.1 - 2019
0 Kudos
Message 17 of 18
(1,388 Views)

Sorry Timmy I forgot to upload VI.

 

 

PBP
Labview 6.1 - 2019
0 Kudos
Message 18 of 18
(1,386 Views)