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).
With this information, data capture can be easily automated with Python.
ser = ser_obj = serial.Serial("COM4",
Thanks for the writeup, just saved me some unnecessary fiddling. Cheers!
glad it was useful!
Thanks for the info.
With the ‘? ‘ We receive the current value, is there a way to capture the maximum value or break value?
Unfortunately I never tried to do anything more than get the current value. The EDMS software does seem to have more features, so there might be a way to do it, but I don’t know.
You could write a python script with the above code to constantly poll the gauge for new values, and record them. And then from that analysis get max. Although you are limited by the speed of the serial interface.
I’m trying to communicate with a FG-3003 (same series). While I’m able to successfully setup the COM connection using your pyserial code, I’m not receiving any response. Did you confirm that the Python code works?
Are there drivers that you may need to install?
The code did work when I used it. There are a couple things which may be the cause.
1. Did you check which COM (serial) port the device is plugged into? The script must be updated to connect to the correct Serial port.
2. Did you update the script to display results? This script just reads data from the serial, but doesn’t actually display anything on the screen.
Let me know if you have further questions.
I used a sniffer to see to check the actual signal. It turns out the package (pyserial) I was using wasn’t writing correctly for some reason.
It’s working now, thanks for your help!
glad to hear it