NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Hex String Limit Comparision

Hi Members,

 

Is there any option to limit checking for Hex string

 

I have low limit  30303030 (Hex) and High Limit 3F3F3F3F (HEX) my measured value should fall in between this limits.

these are the CAN response Data, Converted 8 byte array to hex string. Similarly I have many test cases where the hex string length(CAN Response Array) is varying

 

Can anyone suggest the method for the above requirement.

 

NI FOrum.PNG

0 Kudos
Message 1 of 7
(4,120 Views)

Is 3EFFFFFF a valid value? Or should each byte be between 30 and 3F? May it be that the returned value is a ascii reperesentation of a hexadecimal number between 0x0000 and 0xFFFF?

If each byte should be between 30 and 3F i would suggest to use Multiple Numeric Limit Test and set a limit for each of the 4 bytes. When you select a limit there is also possibility to select Numeric Format to be hexadecimal.

If 3EFFFFFF and similar values is valid i would suggest to cast the 4 bytes to a U32 instead of converting it to a string. 

But from your values i may think that the real value you get as response is the ASCII representation of 0000 to FFFF. In that case the correct thing would be to convert your value to a number. It would also be necessery to know if it is a signed or unsigned number. 

I use TestStand 2012 so it may be that newer teststand versions have better inbuilt limit checking for strings .

0 Kudos
Message 2 of 7
(4,108 Views)

Hi,

 

Thanks for your Reply.

Here I need to compare entire information, Can't compare byte by byte. Also some of the test cases having more than 20 bytes. I think LabVIEW supports max 8 byte (U64) data only.Please correct me if i m wrong.

 

 

0 Kudos
Message 3 of 7
(4,103 Views)

Hi VipinrakKK, are you sure that is necessary the comparison of all bytes? I say it because I work with many protocols and even when the entire response is composed of several bytes I take a part to verify the important parts 1 by 1, actually the first verification is a valid response based on 3 or 4 bytes at maximum. In this case I prefer convert the hex response to decimal and using a Numeric Limit Test step.

Message 4 of 7
(4,086 Views)

Sorry, i did not read your post completely, i only saw your example and limits. And is now a little bit confused since you mention an 8 byte array and your example has 4 bytes.

If there is more bytes, will there be other limits and other type of data?


If you for example has 5 bytes which gives string "3132333435" is the limit still "30303030" to "3F3F3F3F", or is there another limit in those cases?

And also, is the string value "3EFFFFFF" allowed? As a string it is between "30303030" and "3F3F3F3F".


Or should each byte be between 30 and 3F?
If that is the case it may be that it will work to test one element in teststand and tell it to repeat the measurement. 
niforum_2.jpg

Message 5 of 7
(4,079 Views)

I also wonder what the information you get from the CAN device represent. Does a 4 byte response and a 20 byte response contain same type of measurement? Is it possible to see an example of a 20 byte response?

0 Kudos
Message 6 of 7
(4,066 Views)

Ok,

 

I think i have to do the same. Extract the CAN parameters and compare. Its a mistake in Test Case I believe

0 Kudos
Message 7 of 7
(4,063 Views)