LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Extract index hex data and do comparison for judgement

Hi all. Sorry for asking. I do have a reading from an instrument which give me reading in hex data "0055 A87B FD01 C236 01FF FFE2". I want to do some comparison between this data and the reference data which is "XXXX XXXX XXXX XXXX 0XXX XXXX". This data is true because the reading shows 01 and 0X are in the same place. Is the any possible approach to do it? I want to compare it and make a judgement either PASS or FAIL. Thank you soo much for your time.

0 Kudos
Message 1 of 11
(1,314 Views)

Hi man,

 


@man001 wrote:

Hi all. Sorry for asking. I do have a reading from an instrument which give me reading in hex data "0055 A87B FD01 C236 01FF FFE2". I want to do some comparison between this data and the reference data which is "XXXX XXXX XXXX XXXX 0XXX XXXX". This data is true because the reading shows 01 and 0X are in the same place. Is the any possible approach to do it?


Yes, sure there's a way!

 

Get the 5th word from the device response and check for "0" in the MSB…

What have you tried and where are you stuck?

Mind to supply an example VI, containing an example response string from your device?

Is the string plain ASCII or do you use "hex display mode"?

 

A possible solution for an ASCII string:

Best regards,
GerdW


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

hex comparison.jpg

 I try to use like this. But my problems are, the zero will be constant but all the numbers except the zero as in the yellow comments will randomly change. What is the easiest way to make a judgement when labview read the data and when there is zero at the constant place then it will becomes pass. Sorry for my bad english. 

0 Kudos
Message 3 of 11
(1,276 Views)

hex comparison.jpg

I know this is wrong but, what to do when this case happened?  Because hex will consists of two data. I'm sorry. 

0 Kudos
Message 4 of 11
(1,274 Views)

Hi man,

 


@man001 wrote:

I know this is wrong but, what to do when this case happened?  Because hex will consists of two data. I'm sorry. 


When you want to apply a mask like "0X" then you only need to test for that "0": why do you even start to test for "01" and "02"???

 

Btw. your expected result should be:

 

"==01" OR "==02" (OR "==03"…)

 

Why don't you implement it this way?

(It always helps to write/sketch an algorithm before even starting to code!)

Best regards,
GerdW


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

Yes correct. I want to apply the mask like "0X". But I don't know how to start. I use "01" and "02" as example if there is change in number then my program will not working. Your way of solution is correct but I don't know how to start on it. Maybe you can share a few steps on creating the masking as my reference?

0 Kudos
Message 6 of 11
(1,255 Views)

Hi man,

 


@man001 wrote:

Maybe you can share a few steps on creating the masking as my reference?


I already shared the whole VI - I attached a snippet!

 

(My "masking" consists of testing the single char - as you failed in attaching the requested example VI with example data!)

Best regards,
GerdW


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

Here I attahced my VI. I dont know, it still doesnt work. Here the example of the reading.

0055 A84E 4807 C283 07FF FF6C

0055 A858 EB08 C220 08FF FF20

0055 A85D A709 C26C 09FF FF11

0055 A853 730A C2B8 0AFF FF01

0055 A87B 3F0B C2F4 0BFF FFCE

 

0 Kudos
Message 8 of 11
(1,229 Views)

Hi man,

 

did you notice my signature?

Please downconvert your VI for LV2019…

Best regards,
GerdW


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

Is there any different between LV2023 and LV2019?

0 Kudos
Message 10 of 11
(1,169 Views)