CXAIN Command - Analog Input Configuration
Configures the interpretation of magnitudes read by the device’s AD inputs, allowing transformation and scaling of values according to the application.
What is it for?
| Use case | Description |
|---|---|
| 📊 Fuel sensors | Convert voltage to liters or percentage |
| 🌡️ Temperature sensors | Transform analog signal to °C |
| ⚡ Voltage measurement | Scale voltage readings |
| 📈 Custom calibration | Adjust readings to specific units |
Related Commands
- It is recommended to recalibrate the analog reading constant through the AR Command
- The AD value reading for each input can be obtained through the AIN Command
- To query all readings obtained from all AD inputs of the device or generate a report with these values, use the AD Report
Commands
Configure
SCXAINaabccccdeeeefgggghiiiijkkkklmmmmQuery
QCXAINaaResponse
RCXAINaabccccdeeeefgggghiiiijkkkklmmmmParameters
| Field | Description | Range |
|---|---|---|
| aa | Analog signal index | 00-02, 07 |
| b | Lower limit sign (BOTTOM) | +/- |
| cccc | Lower limit magnitude (BOTTOM) | 0000-9999 |
| d | Upper limit sign (TOP) | +/- |
| eeee | Upper limit magnitude (TOP) | 0000-9999 |
| f | First measured value sign (XA) | +/- |
| gggg | Tenths of volt for first measured value (XA) | 0000-9999 |
| h | Second measured value sign (XB) | +/- |
| iiii | Tenths of volt for second measured value (XB) | 0000-9999 |
| j | Sign of value to display referred to first measured value (YA) | +/- |
| kkkk | Value to display referred to first measured value (YA) | 0000-9999 |
| l | Sign of value to display referred to second measured value (YB) | +/- |
| mmmm | Value to display referred to second measured value (YB) | 0000-9999 |
Conversion formula: The system linearly interpolates between points (XA, YA) and (XB, YB) to convert the read voltage into the desired magnitude.
Examples
Configure analog input 00
>SCXAIN00-9999+9999-0000+0001-0000+0001<
// aa=00 → Analog input index 0
// b=- → Negative lower limit
// cccc=9999 → Lower limit value: -9999
// d=+ → Positive upper limit
// eeee=9999 → Upper limit value: +9999Fuel sensor 0-5V → 0-100 liters
>SCXAIN00+0000+0100+0000+0050+0000+0100<
// Maps 0V-5V to 0-100 liters
// XA=0.0V → YA=0 liters
// XB=5.0V → YB=100 litersCompatibility
💾Firmware:v1.00.00
SPLegacy
ULLegacy
MTLegacy
C3Legacy
C5Legacy
SP-IOT
SM-IOT
ZE-IOT
See Also
- AIN Command - Query analog inputs
- AR Command - Analog ranges
- AD Report - Analog values report
Last updated