Laboratory Scale Logging Computer
Lab Scale Logger
Software has been developed at WERC to interface two different laboratory scales to a Linux computer. So far the system has been made with work with the Ohaus Navigator and the Denver Instruments PK6, but other scales or other types of equipment could likely also be supported.
Overview
The software is currently installed on one computer, host name "nuptse", and configured to log data from both the Ohaus and Denver Instruments scales. The system is intended to be reliable and simple to operate. To begin logging data:
- turn on the computer
- connect the serial port to the scale
- power-on the scale
Data should automatically start being received from the scale and stored to the hard drive. To retrieve the logged data from the computer:
- connect a USB "key" to an available port on the computer
- the computer should beep once when the USB key is seen, and will automatically copy queued data to the key
- the computer will beep twice with the data copy is complete and the key can be removed
To turn off the computer, it should be sufficient to hit Ctl-Alt-Del.
Implementation Details
The system consists of a few programs (or scripts, same thing) written in perl, implemented on a Linux system.
- scaled-ohaus.pl
The "scale daemon" is the working machine for the system. It sets things up, including creating a "named pipe" that is used for command input and output, then sits in the background only doing something when the pipe yields a command to process.
- readscale-ohaus.pl
The readscale utility simply does a "p" (optionally "P") query to the scaled daemon, which in turn queries the scale and returns the result. This utility is suitable to run via cron, for instance, if output from the scale is wanted on the order of minutes or longer intervals. Or perhaps readscale might be connected to a GUI button in a system to read the scale whenever the button is pressed.
- scale-cmd-ohaus.pl
The scale-cmd utility is the primary user interface for the system. It accepts commands on its standard input, and writes results to standard output. The "h" command can be used to display a help screen to show other available commands.
- wraptty.pl
This command is not really tied to the scale software, but can be used, for instance, to run the scale-cmd interface on a non-login virtual terminal.