Capturing Serial Data from Nidec Shimpo Force Gauge

We wanted to automate some testing. We had a Nidec Shimpo FG-3008 force gauge that we wanted to capture data from, but no obvious way to get it. Nidec Shimpo do offer their EDMS software that can log and graph data over time, but it can’t be automated.

The force gauge has two connectors, a USB-B port that is used for charging the force gauge and another port that has a serial out (only for connection to a printer) and some output pins that react relative to a set pin.

When connected via USB, the force gauge shows up as a COM port. The EDMS software obviously connects using this port. Connecting a terminal to the port doesn’t show any data streaming, implying a query needs to be sent to the force gauge to trigger a reading.

We eventually figured out that when you send a ‘?’ (0x3f) to the force gauge, it replies with the current force reading in plain text, of length dependent on the number of characters in the measured value, the last character always being a carriage return (0x0d).

Testing with Realterm

With this information, data capture can be easily automated with Python.

import serial

ser = ser_obj = serial.Serial("COM4",
baudrate=9600,
parity=serial.PARITY_NONE,
stopbits=serial.STOPBITS_ONE,
bytesize=serial.EIGHTBITS,
timeout=2)

ser.write('?')
ser.read_until(CR)