3. Instrument Server

3.1. Program startup

When starting the Instrument Server, the program will create a tray icon and a tray menu for controlling the server, showing preferences and launching the Measurement and the Log Browser programs (see Fig. TrayMenu). The tray menu also shows the status of the network server. Whenever the network server is running, clients are allowed to connect to the server to communicate with the instruments. Note that the network server keeps running in the background even after the server window has been closed. To stop the server, either select “Stop Network Server” from the tray menu, or quit the server by selecting the “Quit Server” menu item.

_images/TrayMenu.png

System tray menu for the Instrument Server program. In addition to controlling the server settings, the menu provides options for starting the Measurement and the Log Browser programs.

_images/ServerWindow.png

The main Instrument Server window.

3.2. Server window

The main server window contains a list with all instruments defined in the setup (see Fig. Server). The standard procedure of Instrument Server is to populate this list with the instruments that can be controlled by the computer. Once the instrument have been defined and properly configured, they are ready to be used by the Measurement program.

3.3. Adding instruments

To add an instrument, click the “Add” button or select “Edit/Add...” from the pull-down menu. The program will scan the global and local Instrument driver-folders (defined in the preferences, see Section PrefsFolder), and bring up a list with available drivers. Select the instrument type to be added and define the communication interface and address. The instrument can also be given a unique name, which is convenient if many instruments of the same type are present in the setup.

3.4. Configuring instruments

Once an instrumented has been added to the server, it needs to be configured to perform the desired operation. Select the instrument to be configured in the instrument list and click the “Config” button (or just double-click the instrument name). This will bring up a window with instrument configuration settings (see Fig. DriverYoko for an example of a driver for a DC source). The window contains a list with (at least) two sections with controls:

_images/DriverYoko.png

Driver configuration window for a current source. In addition to controls defining the instrument configuration, there are buttons for sending and retrieving the configuration from the hardware. Some quantities, like “Voltage” in the figure, have additional controls for defining sweep rates.

Communication:
This section contains communication controls that define the interface type and address. In addition, if the driver support multiple instrument models with different installed options, the model type and available options will be shown here.
Settings:
This section (and all other sections, if present) contain instrument-specific configuration settings.

The toolbar at the top of the window provide the following buttons and controls for communicating with the hardware:

Set cfg:
Send the configuration defined in the dialog to the instrument hardware. This requires the communication interface and address to be properly defined.
Get cfg:
Read the configuration from the instrument hardware and update the driver dialog.
At startup:
This controls defines the operation to be performed directly after the instrument driver has started. The default is “Set config”, which will configure the instrument hardware according to the settings in the driver dialog. Other options are “Get config”, which will read the configuration from the instrument hardware and update the Labber driver configuration, or “Do nothing”, in which case neither the hardware configuration nor the Labber driver configuration are updated.
Start:
When clicking this button, the Instrument Server will connect to the instrument and perform the operation defined by the “At startup”-control. After successfully performing these tasks, the instrument will be in the Active state (marked by an indicator in the lower-right hand corner of the driver window and in the Instrument server window). Note that once the driver is active, any subsequent changes made to any of the controls will directly be sent to the instrument hardware. If an instrument is controlled by a client, it is no longer possible to change the configuration from the driver window (all controls will be grayed out). Values can still be sent to or read from the instrument, but only by using the “Set Value” or “Get Value” buttons in the server window, or if a client asks a value to be measured/updated. The “grayed out”-behavior can also be turned on by default from the “Server” section of the Preferences dialog (see Section PrefsServer).
Stop:
This will take the instrument driver out of the Active state, stop any eventual instrument operation and close the communication interface.

3.5. Instruments with vector-valued quantities

Some instruments like oscilloscopes, network analyzers and digitizers measure not only scalar values but also traces containing vector values. Drivers for such instruments contain a few extra controls (see Fig. DriverAcqiris for an example). If the “Show trace” checkbox is enabled, the user can acquire and plot the current instrument data by selecting a trace to show and clicking the “Get trace” button. The “Save trace...” button allows the trace currently visible to be saved to the log database. Note that instrument driver must be started and in the active state to acquire and show data traces.

_images/DriverAcqiris.png

Example of an instrument driver that returns vector-valued data.

3.6. Keeping track of open client connections

Once all instruments are defined, clients can connect to the server to control and measure instruments quantities. The server-client model of Labber is very flexible: The Measurement program can setup experiments that involve instruments connected to different servers on different computers, and a single server can handle simultaneous calls from multiple measurement programs. This flexibility also brings potential complications, like situations where two clients simultaneously try to access the same instrument. To avoid these complications, the server provides a way for clients to exclusively lock an instrument, thereby preventing other clients from accessing it. The locks are described in more detail in Section MeasDriverCfg.

To keep track of open connections and locked instruments, the Instrument Server program features a dialog that lists open client connections and the instruments those clients are using. The dialog is shown by selecting “Server/Show Open Connections...” from the menu bar.

3.7. Troubleshooting - Timing statistics

The Instrument Server program keeps track of the time each instrument driver need to perform operations, which can be useful information when benchmarking instrument communication. To turn on the timing statistics, select “Tools/Show Timing Statistics” from the Instrument Server menu bar. This will add two columns to the main Instrument Server window, one displaying the total number of calls performed to a specific instrument quantity, and one displaying average the time per call. The timing statistics can be reset for all instrument by selecting “Tools/Reset Statistics”, or for individual quantities by right-clicking the item and selecting “Reset Timing Statistics”.

3.8. Troubleshooting - Instrument and Network logs

The Instrument Server program keeps logs of recent activities, both for instrument and network communication. The log files are useful if problems arise with instrument communication or if clients have difficulties connecting to the server. To inspect the log files, select “Log/View Instrument Log” or “Log/View Network Log” from the Instrument Server menu bar. The log files provide dated entries with the data strings sent to or received from instruments or from clients.

The amount of logging detail can be controlled in the preferences dialog (see Section PrefsServer); select “Debug” for the most detailed information. However, once the problems have been resolved and the instruments and networks are working as expected, it is recommended to reduce the logging detail level to minimize overhead.