Intermec IF2 Basic Reader Interface Programmer's Reference Manual (BRI version - Page 43

Using the AND and OR Keywords, Operators for AND/OR Logic Data Conditions

Page 43 highlights

Chapter 3 - Understanding BRI Programming Elements Operators for AND/OR Logic Data Conditions Operator = != > < Description The value at the specified tag memory address is equal to the comparison value. The value at the specified tag memory address is not equal to the comparison value. The value at the specified tag memory address is greater than the comparison value. This is not supported for EPCglobal Gen 2 tags. The value at the specified tag memory address is less than the comparison value. This is not supported for EPCglobal Gen 2 tags. A simple example of a data condition is: INT(0,1)=1 In this example, INT(0,1) specifies that an integer of one byte length starting at address 0 of the tag memory will be compared with integer value of one as specified by =1. Because the following expression attempts to compare two tag memory locations, the BRI returns ERR if you use this expression in a command: INT(0,1)=INT(1,1) Using the AND and OR Keywords Two additional keywords are available for specifying data conditions: • AND-If two or more data conditions are joined with AND, the tag data must match the conditions specified in both data conditions parameters. • OR-If two or more data conditions are joined with OR, the tag data must match either of the conditions specified in the data conditions parameters. A WHERE clause is processed from left to right. An OR condition selects a group of tags to be included in an expression. An AND keyword unselects or excludes tags from an expression. The following examples demonstrate this concept. READ INT(18) WHERE INT(19)=1 OR INT(20)=2 AND INT(21)=3 The WHERE expression is evaluated from left to right as follows: • Include all tags if the data at address 19 equals 1. • Include all tags if the data at address 20 equals 2. • Exclude all tags if the data at address 21 does not equal 3. Basic Reader Interface Programmer Reference Manual 31

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134
  • 135
  • 136
  • 137
  • 138
  • 139
  • 140
  • 141
  • 142
  • 143
  • 144
  • 145
  • 146

Chapter 3 — Understanding BRI Programming Elements
Basic Reader Interface Programmer Reference Manual
31
A simple example of a data condition is:
INT(0,1)=1
In this example,
INT(0,1)
specifies that an integer of one byte length starting at
address 0 of the tag memory will be compared with integer value of one as specified
by
=1
.
Because the following expression attempts to compare two tag memory locations,
the BRI returns ERR<CRLF> if you use this expression in a command:
INT(0,1)=INT(1,1)
Using the AND and OR Keywords
Two additional keywords are available for specifying data conditions:
AND—If two or more data conditions are joined with AND, the tag data must
match the conditions specified in both data conditions parameters.
OR—If two or more data conditions are joined with OR, the tag data must match
either of the conditions specified in the data conditions parameters.
A WHERE clause is processed from left to right. An OR condition selects a group of
tags to be included in an expression. An AND keyword unselects or excludes tags
from an expression.
The following examples demonstrate this concept.
READ INT(18) WHERE INT(19)=1 OR INT(20)=2 AND INT(21)=3
The WHERE expression is evaluated from left to right as follows:
Include all tags if the data at address 19 equals 1.
Include all tags if the data at address 20 equals 2.
Exclude all tags if the data at address 21 does not equal 3.
Operators for AND/OR Logic Data Conditions
Operator
Description
=
The value at the specified tag memory address is equal to the
comparison value.
!=
The value at the specified tag memory address is not equal to the
comparison value.
>
The value at the specified tag memory address is greater than the
comparison value. This is not supported for EPCglobal Gen 2 tags.
<
The value at the specified tag memory address is less than the
comparison value. This is not supported for EPCglobal Gen 2 tags.