LeapSecond.com :: Tools
compap - Data Logger for Medusa Power Analyzer PLUS

Description

The Medusa Power Analyzer PLUS is a unidirectional DC power meter with LCD display and RS-232 serial output. It ships with a Windows GUI app that records and plots.

But here's a simple  command line tool that reads the raw data and logs averages to a file.

Usage

With no arguments it simply logs data from COM1 and prints averages every 10 seconds.

C:\tvb> compap
port=1 seconds=10 stamp=0 limit=0 debug=0
** Opening port \\.\COM1 (19200 baud)
** Opening file pap18437.txt
** Receiving good data...
48.10 V 0.990 A 16.1976 Ah 47.6 W 778.66 Wh
48.09 V 0.994 A 16.1998 Ah 48.0 W 778.76 Wh
48.09 V 0.993 A 16.2025 Ah 47.9 W 778.89 Wh
** Closing pap18437.txt

Command line arguments are:

Averages are displayed modulo the number of seconds specified. For example, 60 second averages are displayed at the top of the minute (according to PC time); 10 second averages every multiple of 10 seconds, etc. An average time of 0 means display raw data from the Medusa (at a rate of approximately 320 ms per sample).

Time stamp options are any binary combination of:

Each run produces a new log file in the current directory with name pap#.txt with incrementing log number.

Here is an example using COM1, 5 second averages, UTC time stamps, for a maximum of 10 lines of output:

C:\tvb> compap 1 5 4 10
port=1 seconds=5 stamp=4 limit=10 debug=0
** Opening port \\.\COM1 (19200 baud)
** Opening file pap18441.txt
** Receiving good data...
2005-04-08 00:28:05 48.09 V  1.003 A  16.3186 Ah  48.3 W  784.50 Wh
2005-04-08 00:28:10 48.11 V  0.998 A  16.3195 Ah  48.1 W  784.58 Wh
2005-04-08 00:28:15 48.12 V  0.994 A  16.3209 Ah  48.1 W  784.63 Wh
2005-04-08 00:28:20 48.08 V  0.997 A  16.3223 Ah  48.1 W  784.70 Wh
2005-04-08 00:28:25 48.09 V  0.996 A  16.3236 Ah  48.1 W  784.78 Wh
2005-04-08 00:28:30 48.11 V  0.994 A  16.3251 Ah  48.1 W  784.83 Wh
2005-04-08 00:28:35 48.10 V  1.000 A  16.3265 Ah  48.3 W  784.90 Wh
2005-04-08 00:28:40 48.09 V  0.993 A  16.3277 Ah  48.0 W  784.99 Wh
2005-04-08 00:28:45 48.10 V  0.998 A  16.3293 Ah  48.2 W  785.03 Wh
2005-04-08 00:28:50 48.11 V  0.996 A  16.3306 Ah  48.2 W  785.10 Wh
** Closing pap18441.txt

This example produces 5 one minute averages with MJD time stamps.

C:\tvb> compap 1 60 2 5
port=1 seconds=60 stamp=2 limit=5 debug=0
** Opening port \\.\COM1 (19200 baud)
** Opening file pap18442.txt
** Receiving good data...
53468.022917 48.10 V  0.997 A  16.3976 Ah  48.1 W  788.36 Wh
53468.023611 48.10 V  0.997 A  16.4089 Ah  48.1 W  788.90 Wh
53468.024306 48.10 V  0.996 A  16.4255 Ah  48.0 W  789.71 Wh
53468.025000 48.10 V  0.998 A  16.4421 Ah  48.1 W  790.51 Wh
53468.025694 48.10 V  0.996 A  16.4585 Ah  48.0 W  791.31 Wh
** Closing pap18442.txt

Download


Return to LeapSecond.com home page.
Comments/questions to tvb.