Programming the 9103 With Python – Part 1: Standard Speed

New sample Python code for the 9103 is now available on RBD’s website. The 9103’s API is easy to program with any language and documented fully, but as always with any device programming, a few examples always help. We chose Python because it’s well supported, easy to understand even if you’re using another language and compatible with a number of popular lab control and analysis environments.

The sample code we provide is open-source and free for you to use and distribute as you see fit.

(If you haven’t taken a look at the 9103 USB auto-ranging picoammeter, everything you need to know can be found here. Measure bi-polar DC current from picoamps to milliamps, with optional built-in bias and 5 kV isolation.)

Programming the 9103 with Python

A Quick Look at the Standard Speed Sampling Code

Python’s pySerial module abstracts the calls to class-compliant USB serial COM port drivers, so setting up communications with the 9103 is a matter of a few simple calls:

port=serial.Serial(
    'com' + port_number,
    baudrate=57600,
    bytesize=serial.EIGHTBITS,
    parity=serial.PARITY_NONE,
    stopbits=serial.STOPBITS_ONE,
    xonxoff=False,
    timeout=1)

With the addition of a few helper functions for handling ASCII, it’s simple to write functions to send individual commands to the 9103. The following sets the auto-range and filter settings:

def message(message_string):
return bytes('&'+ message_string + '\n','utf-8')

def command_range_auto():
port.write(message('R0')) # put in autorange

def command_default_filter_32():
port.write(message('F032'))

Similarly, with the addition of a few helper functions, the 9103 samples can be read with a simple loop that reads lines from the port buffer: In this case, we’ve setup the 9103 to read in interval mode, and poll the port for incoming samples, with a simple keyboard interrupt. This code also writes the sample information to a text file.

try:
while True:
msg=port.readline().decode('utf-8').rstrip()
print(msg)
parsed = parse_message_for_sample(msg)
if parsed:
samplefile.write( parsed + '\n')

except KeyboardInterrupt:
pass

All of the code is commented and documented in the Python file.

Using Python with LabView and MATLAB

The Python code samples can be helpful to both LabView and MATLAB users.
LabVIEW now supports Python through the Python Node, which features low-latency calls from a LabVIEW Block Diagram using LabVIEW primitives.

The MATLAB Engine API for Python allows you to call MATLAB as a computational engine from Python, and you can call functions and objects in Python from MATLAB.

More to Come…

Next up we’ll be posting some sample code to write and read using the high-speed version of the 9103. Since high-speed data from the 9103 arrives in packets, there are some minor differences in parsing the message samples.

High-speed Support Improved in Latest Actuel Release (1.7) for the 9103 Picoammeter

RBD has released Actuel version 1.7 for the 9103 Picoammeter, with improvements for high-speed data acquisition and (especially) data logging and graphing.

The latest version can be found here.

If you do not have a high-speed 9103 Picoammeter and are already running Actuel version 1.6, there no reason to download the latest version. However, high-speed users will find a number of improvements.


Oscilloscope emulation


Although Actuel was not designed to have an oscilloscope emulation (with features such as triggering), at higher speeds you can come close to emulating scope current monitoring.

In the Data Window, click the Show Options button and select “Last” from the Graph Options. You can scroll in increments as low as 0.1 second, but you can type in a smaller increment, such as “0.05” in order to display at higher resolution.

Last time option in Actuel
Using the “Last” time option in Actuel


(Note: The graph display options can get out of sync with data collection if you change and option when recording or after stopping and clearing data – it may be necessary to re-enter the value or reset recording. We’re working to make this smoother in the next version.)

For smoother real-time graphing, use standard-speed at 25 mS unless faster rates are needed

The 9103 can run as fast as 25 mS per sample in standard-speed mode, and 2 mS per sample in high-speed. In order to optimize faster data acquisition in high-speed mode, the 9103 collects 10 samples per message, as opposed to 1.

However, note that if you are collecting data at 25 mS in Standard-speed, your PC will be updated with new data every 25 mS. In High-speed, you’ll be updated every 250 mS.

For that reason, the Acutel software always collects data in standard-speed mode at 25 mS and above, regardless of the high-speed mode settings. It is recommended you do the same if you are writing your own software to control the 9103.

That also means that for real-time graphing, you may not want to sample at a rate of, for example, 24 mS, if you can achieve the same results at 25 mS. At faster rates, the delay in caused by receiving 10 samples per message is less noticeable, but it’s visible at rates of 20 mS- 25 mS if you are graphing only the latest points in relatively high resolution:

Actuel 25 mS Standard Speed

Actuel – 25 mS Standard Speed

Actuel 25 mS High Speed

Actuel – 24 mS High Speed

Putting Together a Compact UHV (Ultra-high Vacuum) Chamber for Spectroscopy

Small, inexpensive UHV chambers have been the backbone of many commercial labs and universities for decades. The cost of larger, feature-rich systems has gone up dramatically in recent years, making compact, DIY chambers even more cost-effective for specialized applications and education.

RBD has a range of products available to add value to your compact chamber, and in fact built our own recently to develop and test our microCMA compact Auger analyzer.

RBD Kimball Chamber
Kimball Physics chamber with RBD miniZ, IG2, and microCMA compact Auger analyzer

The Chamber

We started with an 8 inch spherical octagon chamber from Kimball Physics. This chamber has two 8.00″ CF and eight 2.75″ CF mounts, with an internal volume of  106.6 cu. in. (1,747 cc):

Kimball Physics Chamber
Kimball Physics 8.0″ Spherical Octagon – Vacuum Chamber

The vacuum chamber was fitted with an ion pump from Gamma Vacuum, and valves and windows from MDC. Affordable turbo pumps can be sourced from Pfeiffer (HiCube 80 Eco) and Edwards (nEXT85).

Rough vacuum gauges are available from a number of companies including Digivac.

Rough Vacuum Gauge
Rough vacuum gauge

Ion gauges and ion gauge controllers are available from a number of companies including Stanford Research Systems

Ion Gauge Controller
Ion gauge controller

Accessories

To assist with water vapor desorption, the chamber is fitted with RBD’s miniZ. The mini-Z uses UVC radiation to desorb water from the chamber walls, resulting in faster pump-down times and lower ultimate vacuum.

RBD miniZ
RBD miniZ water vapor desorption system

This chamber is also fitted with RBD’s IG2 2 kV low cost sputter ion gun for specimen cleaning:

Instrumentation

The ultimate purpose of this system was to house RBD’s microCMA compact Auger analyzer (shown below with the Z translator attached):

RBD microCMA
RBD’s microCMA compact Auger Analyzer

For applications that require elemental analysis, this chamber, with the addition of a PC and CMapp AES acquisition and data massage software, is now a complete system providing quantitative, surface-sensitive Auger electron spectroscopy. At around $50,000 for all the components listed here, this is one example of a budget-sensitive spectroscopy system that can be assembled, repaired and upgraded without costly field service visits.