Last Updated: August 29, 2007
This topic provides information about the conventions used for both short programming examples, and more comprehensive programming examples presented in this help. Refer to the following sections:
The programming examples provided in this help are written in Microsoft Visual Basic® .NET and use the VISA COM I/O architecture for communications with the test set. The use of Microsoft Visual Basic® .NET or VISA COM is not an endorsement of these products.
Comprehensive programming examples, such as those provided for individual measurements use the following statements to ensure that variables are explicitly declared, and to ensure that no data is lost during implicit type conversions:
Option Explicit On: This statement is used to force explicit declaration of all variables in each file.
Option Strict On: This statement is used to force explicit conversions from one data type to another. The use of Option Strict prevents data loss that can occur when the value of one data type is converted to a data type with less precision or smaller capacity. Compile-time notification of these types of conversions is provided by the programming environment so they may be avoided.
The programming examples provided in this help do not contain any code for handling errors and unexpected events that may occur in your program. This convention is used to ensure that the programming examples are easy to read and understand. If the required amount of error trapping was included in the examples, the test set programming concepts being presented would be less clear. It is highly recommended that any code you use from these examples is enhanced with the inclusion of error handling code before use in a manufacturing environment.
The variable TestSet used throughout the programming examples in this help refers to an object variable of the type VisaComLib.FormattedIO488. This interface to the test set provides basic formatted I/O functionality. Refer to the Agilent VISA COM I/O Help for more details on the IFormattedIO488 interface.
SCPI syntax is not case sensitive. Any combination of lower or uppercase characters can be used as long as the syntax is correct. For example, as far as the remote interface is concerned the following four SCPI command strings are identical and will work correctly. However, not all forms are as easy to read.
DISPlay:BRIGhtness MEDium
DISPLAY:BRIGHTNESS MEDIUM
dispLAY:brigHTNESS medIUM
dIsPlAy:BrIgHtNeSs mEdIuM
The programming examples in this help use the long form of the command syntax, with the short and long forms distinguished by UPPER and lower case text. This convention is used to aid readability and highlight the short and long forms simultaneously. However, when running your code in production, it is recommended that you use short form commands exclusively to minimize remote interface transactions.
The programming examples do not include optional nodes. Optional nodes in the command syntax are defined by enclosing the node inside the [ ] brackets. For example, the command syntax:
SYSTem:CORRection[:SGAin] -2.55,-3.12
appears in the programming examples as:
SYSTem:CORRection -2.55,-3.12
Complex commands are used to configure the state and assign values to parameters simultaneously. Complex commands can be used to save programming steps and minimize remote interface transactions.
The following syntax turns the state of the parameter on.
TestSet.WriteString("SETup:RFCHannel:TIMeout:STATe ON")
The following syntax is used to assign a value to the parameter.
TestSet.WriteString("SETup:RFCHannel:TIMeout:TIME 20S")
However, both of the above actions can be accomplished with one complex command:
TestSet.WriteString("SETup:RFCHannel:TIMeout:STIMe 20S")
The command above sets the parameter state to ON and the value of the parameter to 20 seconds. Note that in this example the optional command mnemonic :STIMe has been included to clarify that this complex command was used to set both the state and the value.
This command can be shortened further by removing the optional command mnemonic :STIMe, as follows.
TestSet.WriteString("SETup:RFCHannel:TIMeout 20S")
The test set can return the following data types in response to queries:
character data (char): ASCII characters A-Z (65-90 decimal), underscore (95 decimal), digits (48-57 decimal.
string data: ASCII characters enclosed in quotes (for example, "5551212" or "PGSM")
numeric response data <nr1>: numeric data in the form ± dddddddd
numeric response data <nr3>: numeric data in the form ± ddd.ddd E ± dddd