Actuel 1.8 Adds New Auto-Save and Graphing Features to the 9103 Picoammeter

Actuel 1.8 adds new features to assist with saving and graphing data. As always, updates are free and can be found here.

Set the Auto-Save Interval

Prior to Actuel 1.8, the auto-save interval for recorded graph data was every 5 minutes. The latest version gives you the option to save the data every half-minute to every 30 minutes.

Option to Show / Hide Graph

You now have the option to show or hide the graph display. This is useful if you only want to record data and not view the real-time graph information. Large data sets and fast sampling rates can cause some performance issues on slower PCs, and this option mitigates that.

Set a Fixed Range for the Graph Y-axis

By default, the Y-axis scale automatically adjusts to the range of the incoming data, with the options to display dual or single polarity, and to zero the baseline.

9103 Actuel Y-axis Default Range
9103 Actuel Y-axis Default Range

The fixed-range option for the Y-axis is especially useful, as it serves as a Y-axis zoom (independent of the X-axis) and also allows you to more easily compare data between multiple units or sessions.
You can set the min and max for the range as well as the units.

9103 Actuel Y-axis Default Range
9103 Actuel Y-axis Default Range

There have been some minor changes to the user interface to accommodate the new options. The Data window is now (slightly) larger, and the formatting options have been moved to the Data Options group.

For more information on RBD Instruments’ 9103 USB picoammeter, visit our website here –

https://rbdinstruments.com/products/picoammeter.html

Programming the 9103 With Python – Part 3: High Speed

For Part 3 of our series on programming the 9103 with Python, we’ve written an application that controls the 9103 in High-speed mode (which can sample as quickly as 500 samples/second) and parses the high-speed messages so they are output to a text file using the same format as standard speed. (All Python samples for the 9103 can be found here.)

(The High-speed option for the 9103 is available as an option when purchasing. The 9103 is also available with a High-voltage option and 90 V fixed or external bias)

Setup the 9103 for High-Speed Sampling

The 9103 has two different modes of operation – high-speed and standard-speed. These run the serial COM ports at different baud rates, so the port needs to be opened at the appropriate rate (the 9103 recalls the last baud rate used). This application does not detect / switch modes, but in our last post we programmed a utility to do just that – it’s part of the set of python scripts included in the download.

The only difference between the code to open the port in standard speed or high speed is the baud rate (57.6k for standard, 230.4k for high) . All oher parameters are the same.

High vs. Standard Speed Interval Sampling

When interval sampling in Standard-speed mode, only the ‘I’ command is available, which provides one sample per message. High-speed mode adds an additional command – ‘i’ – which passes 10 samples per message, thereby reducing the round-trip overhead per sample. You would typlically only use this command for speeds faster than 40 samples / sec., however if can be used at slower speeds. We run a slower speed in our sample application to make it easier to observe the sample messages in the terminal.

(You would probably not choose to use the ‘i’ command for slower sampling rates, because it can only provide one stability warning and range for every 10 samples

Parsing the High Speed Sample Messages

The format for a High-speed sample includes the range and units, along with 10 samples:

&s=,Range=002nA,+0.0013,+0.0012,+0.0012,+0.0012,+0.0013,+0.0012,+0.0012,+0.0011,+0.0012,+0.0012,nA

For this application, we write to a data-logging file just as we do in the Standard-speed Python application. However, we need to parse the 10 sample data to produce a similar, one-sample-per-line output if we want to be able to use the data interchangeably.

The only difference between the samples is that the High-speed samples are prefaced with a lower-case ‘s’ (which could be easily replaced if necessary):

s=,Range=002nA,+0.0013,nA

.

Here’s the code for parsing the high-speed sample message:

def parse_message_for_high_speed_sample( msg):
if '&s' in msg:
msg = msg.strip('\0')
msg = msg.strip('&')
list = msg.split(',')
i = 0
stability = ''
range = ''
new_msg = ''
units = list[-1] # gets last item
list.pop() # remove last item which is units
for value in list:
if i==0:
stability = value
elif i==1:
range = value
else:
new_msg = new_msg + stability + ',' + range + ',' + value + units + '\n'
i=i+1
return new_msg
else:
return ''

That’s about all that’s necessary to create a compatible message, allowing you to mix High-speed and Standard-speed messaging in a compatible data-logging format

Programming the 9103 With Python – Part 2: Switching Between Standard and High-Speed Modes

In part 1 of our series on programming the 9103 with Python, we wrote a simple application to control the 9103 and sample at standard speeds (as fast as 40 samples/second). Before we look at programming a 9103 in high-speed mode, we’ll program a utility to determine which speed mode the 9103 is currently set for, and provide a means to switch speed modes. All python samples for the 9103 can be found here.

(The high-speed option for the 9103 provides up to 500 samples/second and is available as an option when purchasing. The 9103 is also available with a high-voltage option and 90 V fixed or external bias)

Programming the 9103 with Python

A Python Utility App for Switching Speed Modes

The 9103 with the high-speed option recalls the last speed mode (standard or high) at which it was operated at. This makes it easier to program applications that normally only operate in one speed mode. However, because the different modes open the serial ports at different baud rates (57.6k for standard, 230.4k for high) it may not be known what mode the 9103 was last operating in, so an application could fail if it assumes the incorrect speed.

Since you can’t query the 9103 speed mode without opening the port, one way to get around the issue is to catch a port failure, and try a different baud rate.
This utility tries to open the port for standard speed, and if that fails, high speed. In either case, if the port is successfully opened and communications with the 9103 established, the user is prompted to switch the speed mode.

Exception Handling for the Win

The 9103 firmware recalls the last port speed and communicates at that speed. However, the driver for the virtual USB port can be successfully opened as long as the device is connected to the port, even if there is a speed mismatch

So, as always, we create a try/except handler to first attempt to open the correct port:

try:
    port=serial.Serial(
        'com' + port_number,
        baudrate=57600,
        bytesize=serial.EIGHTBITS,
        parity=serial.PARITY_NONE,
        stopbits=serial.STOPBITS_ONE,
        xonxoff=False,
        timeout=0)
except:
    port_open = False
    do_nothing = input('9103 standard speed not found. Press enter to continue...')

In order to determine if we are communicating at the correct baud rate, we’ll try to write and read from the 9103. The simplest way to do that is to send a query and look for a valid status response:

standard_speed = False;
timeout = 3   # seconds
timeout_start = time.time()
try:
    command_query_status()

    while time.time() < timeout_start + timeout:
        msg=port.readline().decode('utf-8').rstrip()

        if msg == "RBD Instruments: PicoAmmeter":
            print(msg)
            standard_speed = True;

The command_query_status() call simply sends a ‘&Q’ query message to the 9103.

If this throws an exception, we basically do the same thing again, this time opening the port at the faster 230.4k baud rate, then testing it by writing / reading. If either case is successful, we prompt the user to see if they want to switch to the other speed.

If you know you’re only ever typically going to operate the 9103 in one speed mode, you can simply use this utility once, and normally should not have to use it again unless you swap your 9103 with another that is running at a different speed. Otherwise, you can integrate this into your application. Normally, if you may need a higher sampling rate, there’s no reason not to simply operate in the higher-speed mode – the slower sampling rates are still available and can the messages for those rates can be parsed the same as with the standard speed.

Also, note that, although this code is agnostic about the operating system it’s running on, the exception conditions might be subtly different depending on the OS and FTDI USB serial port driver, and you may need to make some modifications.

Next, we’ll look at how to sample using the high-speed mode, and how to parse messages at the faster rates.