This function defines how the actual reply is compared to the expected reply to define a pass or fail.  

  • By default, the actual reply must match exactly (including case) the expected result in order to pass. Anything else is a fail.


Let's say the expected reply rather than being the number 1000, is to be in a range of values. You can define that range in many different ways:


Less than/equal to:

<=1000


Greater than/equal to:

>=1000


Range

*=1000|2000


Equal to expected value and force a math comparison

==1000


ANDed with current Bit Mask (BTMASK command) is equal to expected value 

&=1000


  • The comparison macro must always come first and is always 2 characters (>= , <=,  *=, ==, =&). The range is always inclusive. There is no <, just <=


The first two macros are obvious. The third one means a range. So:


*=1000|2000


means:


>= 1000 and <= 2000


So values between 1000 and 2000 (inclusive of the 1000 and 2000) are valid reply values.


  • When a math comparison is done (any above) the values are tested to see if they are using either BASIC or C notations for Binary or Hex numbers as well.
    • The app test for the following notations:
      • 0x for C++ Hexadecimal  (just x can be used as well)
      • 0B for C++ Binary  (just B can be used as well)
      • &H for Basic Hexadecimal
      • &B for Basic Binary

In case of multiple values replies

Some commands (PP, EP, etc) will return multiple values (i.e. for all axis) like this:


0:0:0:0


If you want to use the comparison macros, you can do this for all or any of the individual items like this:


*=0|1:*=0|1:0:0


The app test for the : character assumes multiple return values (i.e. one for each axis). It breaks up the reply and expected text into parts and then does the normal comparison for each item. If any value fails, the entire command is considered to have failed.


Return to ASCII programs