03-26-2023 11:01 PM
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.
03-27-2023 12:43 AM - edited 03-27-2023 12:44 AM
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:
03-27-2023 01:47 AM
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.
03-27-2023 01:52 AM
I know this is wrong but, what to do when this case happened? Because hex will consists of two data. I'm sorry.
03-27-2023 02:38 AM - edited 03-27-2023 02:39 AM
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!)
03-27-2023 02:44 AM
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?
03-27-2023 03:23 AM
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!)
03-27-2023 03:44 AM
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
03-27-2023 05:01 AM
03-28-2023 12:42 AM
Is there any different between LV2023 and LV2019?