I got another toy to play with: A digital multimeter with RS232 interface and True RMS power measurement. Sadly, it comes with Windows-only software, which I interpreted as a challenge!
Since this is electrical measuring equipment, the serial communication should be electrically insulated from the device. The VC-940 uses a photodiode. Since the cable connecting the multimeter to the computer only contains an optical receiver, it is impossible for the computer to communicate with the meter. This significally reduces the complexity of a protocol.
This optical part showed to be the first problem. When I insert my RS-232 tester when running the Windows application, I could see data passing; under MacOSX no data would pass. Besides showing no data, the tester also indicated that the control lines were asserted differently. By asserting the control lines the same way under MacOSX, the problem was resolved. Apparently, the voltages on the control lines are used to power the optical receiver electronics.
The baudrate and other settings were found by simply trying different values. When receiving at 2400bps, 8 databits, no parity and 1 stopbit (2400 8N1 for short), measurements were recorded in the Windows application.
This perl-script opens the specified serial port, asserts the control lines as required (RTS logical 0, positive voltage; DTS logical 1, negative voltage) and outputs the data to stdout.
The message format
When observing the data flow, it was clear that the device sends out a byte-string of 11 bytes roughly every second:
B0B0B0B0B03131B0B50D8A B0B0B0B0B03131B0B50D8A B0B0B031B63131B0310D8A B0B034B3323432B3310D8A B0B03237B53432B3310D8A ...
Every message seems to be terminated by 0x0D8A. I used this to synchronize the input. The following table shows what I discovered for the other bits in the message. The nibbles (4 bit group) are numbered from left to right starting from 0.
|13||The measurement mode (see below)|
|9||Fifth digit (not in all modes)|
|11||Decimal point position and unit selection (depends on mode)|
|17 bit 0||Negative (1) or positive (0)|
|17 bit 1||Auto (1) or manual (0) range|
|15||AC, DC or AC+DC (depends on mode)|
Note that I didn’t figure out what every bit means…
The modes are listed below:
|a||Ohm with beep|
|b||Diode junction voltage|
|c||Frequency and duty cycle|
|f||% of 4-20mA loop|
This perl-script parses the binary input (from stdin) to readable output:
2009-05-01-16-48-52 : 313834b5b3b0b3b0b0 : 184.53 mV 2009-05-01-16-48-53 : 3138343434b0b3b0b0 : 184.44 mV 2009-05-01-16-48-54 : 313834b534b0b3b0b0 : 184.54 mV 2009-05-01-16-48-55 : 313834b3b0b0b3b0b0 : 184.30 mV 2009-05-01-16-48-56 : 313834b037b0b3b0b0 : 184.07 mV 2009-05-01-16-48-57 : 3138b338b5b0b3b0b0 : 183.85 mV