на synaser пока не вполне помогает. И тк вижу, что есть знатоки
вопроса всё же задам его.
Есть хитрый могучий мультиметр (не мой), который имеет rs232
интерфейс. У него есть программа под Вин с кнопочками и стрелками.
В общем интерфейс ужасный, для конвеера непригодный. И
требования к этой с(т)ранной проге в районе PIII.
Хочу создать минимальную консольную прогу под Линукс, которая
будет просто выдавать его показания на стд вывод.
Ситуация осложнена: прибор не мой и доступ к нему ограничен
по времени. А себе такой покупать пока ни к чему и дорого.
Добрый человек поделился протоколом, вот он:
- Код: Выделить всё
The RS-232 protocol :
1. Communication Type : RS-232C
2. Communication protocol :
A : Baud Rate : 9600 bps
B : Data length : 8 bits
C : Parity check : None
D : Stop bit : 1 bit
3. Data format : The data format is ASCII code.
A. PC sends a command to DMM for requesting to read as follow :
|1 |2 |3 |4 |5 | | | |
| | | | | | | | |
| | | |
| | | | |
| | | | | | | |
|00H |4V |4V |4V |40mV |400mV |400mV |
|(auto) | | | | | | |
|01H |40V |40V |40V |400mV | | |
|(auto) | | | | | | |
|02H |400V |400V |400V | | | |
|(auto) | | | | | | |
|03H |1000V |750V |750V | | | |
|(auto) | | | | | | |
|80H |4V |4V |4V |40mV |400mV |400mV |
|(manual)| | | | | | |
|81H |40V |40V |40V |400mV | | |
|(manual)| | | | | | |
|82H |400V |400V |400V | | | |
|(manual)| | | | | | |
|83H |1000V |750V |750V | | | |
|(manual)| | | | | | |
| | DC mA | AC mA| (AC+DC)| DC A| AC A| (AC+DC)|
| | | | | | | |
| | | |mA | | |A |
|00H |40mA |40mA |40mA |4A |4A |4A |
|(auto) | | | | | | |
|01H |400mA |400mA |400mA |10A |10A |10A |
|(auto) | | | | | | |
|80H |40mA |40mA |40mA |4A |4A |4A |
|(manual)| | | | | | |
|81H |400mA |400mA |400mA |10A |10A |10A |
|(manual)| | | | | | |
| | Ohm | Low Ohm| Cap | Hz | Diode| Temp |
|00H |400Ohm |4kOhm |4nF |400Hz | Diode| Temp|
|(auto) | | | | | | |
|01H |4kOhm |40kOhm |40nF |4kHz | | |
|(auto) | | | | | | |
|02H |40kOhm |400kOhm |400nF |40kHz | | |
|(auto) | | | | | | |
|03H |400kOhm |4MOhm |4(F |400kHz | | |
|(auto) | | | | | | |
|04H |4Mohm |40MOhm |40(F |4MHz | | |
|(auto) | | | | | | |
|05H |40Mohm | |400(F | | | |
|(auto) | | | | | | |
|06H | | |4mF | | | |
|(auto) | | | | | | |
|07H | | |10mF | | | |
|(auto) | | | | | | |
|80H |400Ohm |4kOhm |4nF |400Hz | Diode| Temp |
|(manual) | | | | | | |
|81H |4kOhm |40kOhm |40nF |4kHz | | |
|(manual) | | | | | | |
|82H |40kOhm |400kOhm |400nF |40kHz | | |
|(manual) | | | | | | |
|83H |400kOhm |4MOhm |4(F |400kHz | | |
|(manual) | | | | | | |
|84H |4Mohm |40MOhm |40(F |4MHz | | |
|(manual) | | | | | | |
|85H |40Mohm | |400(F | | | |
|(manual) | | | | | | |
|86H | | |4mF | | | |
|(manual) | | | | | | |
|87H | | |10mF | | | |
|(manual) | | | | | | |
h. Reading of A/D Convert
| | |
|00H |NONE |
|01H |POINT 1 |
|02H |POINT 2 |
|04H |POINT 3 |
|08H |POINT 4 |
Remark : 4 . 0 . 0 . 0 . 0
POINT 1
POINT 2
POINT 3
POINT 4
2.UNIT CODE :
|CODE |UNIT |CODE |UNIT |
|00H |NONE |0EH |Delta |
|01H |V |0FH |Hz |
|02H | |10H | |
| |mV | |kHz |
|03H |A |11H |MHz |
|04H | mA|12H | |
| | | |deg.C |
|05H | dB|13H | |
| | | |deg.F |
|06H | dBm|14H | |
| | | |s |
|07H |nF |15H |ns |
|08H |(F |16H |(s |
|09H | |17H |ms |
| |mF | | |
|0AH |Ohm | | |
|0BH |kOhm | | |
|0CH |MOhm | | |
|0DH |% | | |
3.SUBFUNCTION CODE :
|CODE |DATA |
|00H | NONE |
|01H | Input Reading |
|02H | Freq. |
|03H | Period |
|04H | Duty Factor |
|05H | Ambient Temperature |
|06H | Time Stamp |
|07H | Load |
|08H | Number (Store, Recall) |
|09H | Store |
|0AH | Recall |
|0BH | Reset |
|0CH | Auto Hold |
|0DH | Max |
|0EH | Min |
|0FH | Max-Min |
|10H | Peak Hold Max |
|11H | Peak Hold Min |
|12H | Peak Hold Max-Min |
|13H | Set High �Indication� |
|14H | Set Low �Indication� |
|15H | High |
|16H | Low |
|17H | Delta |
|18H | % |
|19H | Ref |
|1AH | dBm |
|1BH | dB |
|1CH | Send |
|1DH | Setup �Indication� |
|1EH | Set Beeper �Indication� |
|CODE |DATA |
|1FH | Set Auto Power off |
| |�Indication� |
|20H | Set Back Light |
| |�Indication� |
|21H | Set Hazard �Indication� |
|22H | Set Line Frequency |
| |�Indication� |
|23H | Set dBm Load |
| |�Indication� |
|24H | Set Reset �Indication� |
|25H | |
|26H | Probe �Indication� |
|27H | Error �Indication� |
|28H | Fuse �Indication� |
Checksum:
The last byte is the SUM of every byte in the received data format
except
Checksum itself, you can use the Checksum (using the last tow digits)
to check
the data receiving from DMM is correctly or not.
Example for Checksum :
55+55+0+36+41+50+50+41+33+30+35+20+53+61+6E+64+72+61+20+20+30+2E+30+30+2E+3
0+36+1+0+0+0+1+0+80+1+0+0+8+1+1+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0 =
732
Checksum = 32