|
|
<details><summary>Inhalt</summary>
|
|
|
|
|
|
[[_TOC_]]
|
|
|
</details>
|
|
|
|
|
|
# Kommandos
|
|
|
Um eine hohe Flexibilität zu erhalten, kann in den `.json` Dateien bei den Kommandos
|
|
|
|
|
|
# Aufbau
|
|
|
Eine Gerätekonfigurationsdatei ist wie folgt aufgebaut:
|
|
|
|
|
|
* **name**: der Name des Geräts (nicht essenziell zur ausführung)
|
|
|
* **desc**: eine Beschreibung des Geräts
|
|
|
* **port_config**: die Konfiguration der seriellen Schnittstelle. Werte sind analog zu den von der [pySerial Bibliothek](https://pyserial.readthedocs.io/en/latest/pyserial_api.html#serial.Serial)
|
|
|
* **baudrate**: die Baudrate als Zahl
|
|
|
* **bytesize**: die Anzahl der Bytes pro Nachrichtenblock (`FIVEBITS`, `SIXBITS`, `SEVENBITS`, `EIGHTBITS`)
|
|
|
* **parity**: die Parität (`PARITY_NONE`, `PARITY_EVEN`, `PARITY_ODD`, `PARITY_MARK`, `PARITY_SPACE`)
|
|
|
* **stopbits**: die Anzahl der Stopbits por Nachrichtenblock (`STOPBITS_ONE`, `STOPBITS_ONE_POINT_FIVE`, `STOPBITS_TWO`)
|
|
|
* **timeout**: der Lesetimeout in Sekunden (kann Dezimalzahl sein)
|
|
|
* **commands**:
|
|
|
* **general**: generelle Kommandos, wie z.B.: An- und Ausschalten
|
|
|
* **enable**: Kommando um das Messen zu aktivieren oder deaktivieren
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Beispielkonfigurationsdatei
|
|
|
```json
|
|
|
{
|
|
|
"name": "RND320-KEL103 aka Senke",
|
|
|
"desc": "Prof. Heinemann's Senke",
|
|
|
"port_config": {
|
|
|
"baudrate": 9600,
|
|
|
"bytesize": "EIGHTBITS",
|
|
|
"parity": "PARITY_EVEN",
|
|
|
"stopbits": "STOPBITS_ONE",
|
|
|
"timeout": 2.5
|
|
|
},
|
|
|
"commands": {
|
|
|
"general": {
|
|
|
"enable": ":INP {'ON' if value else 'OFF'}",
|
|
|
"set_mode": ":FUNC {{'voltage': 'VOLT', 'current': 'CURR', 'resistance': 'RES', 'power': 'POW'}[value]}}"
|
|
|
},
|
|
|
"measure": {
|
|
|
"voltage": ":MEAS:VOLT?",
|
|
|
"current": ":MEAS:CURR?",
|
|
|
"power": ":MEAS:POW?"
|
|
|
},
|
|
|
"set": {
|
|
|
"voltage": ":VOLT {value}",
|
|
|
"current": ":CURR {value}",
|
|
|
"power": ":POW {value}",
|
|
|
"resistance": ":RES {value}",
|
|
|
"cell_voltage": "???"
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
``` |