Last Updated: August 29, 2007
Refer to the following sections:
For more information on the conventions used in the programming examples click here.
To ensure consistent, repeatable performance, you need to start the program, computer, and test set in a known state. Without correct initialization, your program may run correctly in one instance and not in another. This might be due to changes made in configuration by previous program runs or from the front panel of the test set.
Program initialization defines and initializes variables, allocates memory, or tests system configuration.
Computer initialization ensures that the interface to the test set is properly set up and ready for data transfer.
Test set initialization involves fully presetting the test set and clearing the error queue.
Initializing the computer and test set involves the following steps:
Clearing the interface buffer
When using the Agilent VISA COM library, you can use the resource session object’s Clear method to clear the interface buffer. When you are using GPIB, the resource session object’s Clear method also resets the test set's parser. The parser is the program which reads in the instructions which you send it.
Fully presetting the test set
It is important to get the test set to a known state before each production session.
Sending the *RST command fully presets the test set, which ends all measurement processes and restores all values to defaults.
Clearing the test set's error queue
Before each production session, it is useful to clear the error queue of any old messages. That way, you know that any messages logged are relevant to the current production session.
Sending the *CLS command clears the error queue.
' Clear the interface buffer and reset the test set's parser.
TestSet.IO.Clear()
' Fully preset the test set.
TestSet.WriteString("*RST")
' Clear the test set's error queue.
TestSet.WriteString("*CLS")