Intermec IF2 Basic Reader Interface Programmer's Reference Manual (BRI version - Page 126
Creating a Command Macro, Executing a Command Macro, Creating a Parameter Macro
View all Intermec IF2 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 126 highlights
Chapter 4 - BRI Commands Creating a Command Macro You create a command macro, which contains both a command and all its parameters, with the SET command. For example: SET MYREADMACRO="READ TAGID WHERE INT(20,2)=2000" Follow these guidelines when naming a macro: • The name is an alphanumeric string that can be as short as one character; there is no length limit for the name. • You cannot use BRI reserved keywords as macro names. For a list of reserved keywords, see "Reserved Keywords" on page 17. • The first character must be a letter (A to Z or a to z). • The first character cannot be a number (0 to 9). If the macro contains [LITERAL] parameters, which must be enclosed in double quotes, you must use the \ character to escape the embedded double quotes. To execute a command macro, see the next section, "Executing a Command Macro." Executing a Command Macro You execute a command macro by typing the name of the macro preceded by a $. Suppose a macro MYREADMACRO was defined, you invoke it with this command: $MYREADMACRO The macro MYREADMACRO is expanded by the BRI and replaced with the text string stored in the macro MYREADMACRO. Creating a Parameter Macro Suppose these are the parameters for a READ command used several times in your application: READ "TAG ID:" ,HEX(0,8), "NAME:", STRING(18,20) WHERE INT(18)=1 AND INT(22) != 100 AND STRING(30)="ADDRESS" You can store all those parameters in a parameter macro called MYREADPARAMS with this command: SET MYREADPARAMS ="\"TAG ID:\", HEX(0,8), \"NAME:\",STRING(18,20) WHERE INT(18)=1 AND INT(22) != 100 AND STRING(30)=\"ADDRESS\"" Note how the \ character is used to escape the embedded double quotes for the [LITERAL] parameters. To execute a READ command using this parameter macro, see the next section, "Executing a Command With a Parameter Macro." 114 Basic Reader Interface Programmer Reference Manual