CXDL Command - Automatic Datalog Sending
Configures automatic sending of datalog (LOG) records to the specified destination.
What is it for?
| Use case | Description |
|---|---|
| 🔄 Automatic synchronization | Send history when reconnecting |
| 📶 Data recovery | Transmit offline stored positions |
| 📡 Multiple channels | Alternate between WiFi/GPRS/BLE |
| 🔁 Configurable retries | Control sending persistence |
Commands
Configure automatic sending
SCXDL<Ena>,<Dst>,<Reint>,<Time>,<Order>The 5th field Order (datalog drain order) is available from firmware v1.09.23: 0 = FIFO (oldest first, default), 1 = LIFO (newest first). It is optional and backward-compatible: commands with 2 or 4 fields do not change the Order value, which persists in NVS (CXDL.ORD).
Cancel pending sending
SCXDLECancels pending report sending but keeps data in LOG.
Query
QCXDLResponse
RCXDL<Ena>,<Dst>,<Reint>,<Time>,<Order>QCXDL returns the Order field at the end of the configuration.
Parameters
| Parameter | Description | Values | Default |
|---|---|---|---|
| Ena | Enable | 0 = Disabled, 1 = Enabled | 0 |
| Dst | Sending destination | TRM, GPRS, WIF, BTH, ALL | - |
| Reint | Retries | 0 = Infinite, 1-999 = Amount | 0 |
| Time | Time between retries | Tenths of second (100 = 10s) | 0 |
| Order | Drain order (optional, v1.09.23+) | 0 = FIFO, 1 = LIFO | 0 |
Destinations
| Destination | Description |
|---|---|
| TRM | Serial terminal (USB/RS232) |
| GPRS | Cellular connection |
| WIF | WiFi |
| BTH | Bluetooth |
| ALL | Alternates between WIF and GPRS automatically |
The ALL destination keeps the channel open until it becomes impossible to continue, then switches to the other destination automatically.
Examples
Automatic sending via WiFi without limit
>SCXDL1,WIF,0,0<Sends all LOG records via WiFi, retrying infinitely without pause.
GPRS sending with 3 retries every 10 seconds
>SCXDL1,GPRS,3,100<Attempts to send 3 times with 10 seconds wait between attempts.
Alternating WiFi/GPRS sending
>SCXDL1,ALL,0,50<Alternates between WiFi and GPRS, retrying infinitely every 5 seconds.
LIFO drain (newest first)
>SCXDL1,GPRS,0,50,1<Sends via GPRS prioritizing the newest LOG records (Order=1).
Change only the order, keeping the rest
>SCXDL1,GPRS,0,50,0< // back to FIFOA command with 2 or 4 fields (e.g. >SCXDL0< or >SCXDL1,GPRS,3,100<) keeps the Order previously stored in NVS.
Cancel ongoing sending
>SCXDLE<Response: >RCXDLEOK<
Runtime state (QCXDLST)
From firmware v1.09.23, QCXDLST returns the internal state of the sending engine for remote diagnostics.
>QCXDLST<
>RCXDLST 0,1024,2048,1536,12,1,0<
// Order=0 (FIFO), RefMin=1024, RefMax=2048, ScanRef=1536,
// Pending=12, Enable=1, Reset=0| Field | Description |
|---|---|
| Order | Active drain order (0=FIFO, 1=LIFO) |
| RefMin | Minimum pending reference in the LOG |
| RefMax | Maximum pending reference in the LOG |
| ScanRef | Current scan reference |
| Pending | Records pending to send |
| Enable | Sending engine active (0/1) |
| Reset | Engine reset flag (0/1) |
The RCXDLST response carries a space after the prefix (RCXDLST ...), unlike RCXDL (no space). Keep this in mind when parsing both responses.
Operation Flow
-
Configure destination:
>SCXDL1,TRM,1,1< -
Generate LOG record:
>GCQ00H;@LOG< -
Device sends automatically:
>RCQ00000000000000-2778128-064258630020907F0000000000000130606FFFF1518;#0002;ID=869084063093789;*30< -
Disable automatic sending:
>SCXDL0<
Compatibility
See Also
- DL Command - Datalog query and management
- @LOG Destination - Save reports in LOG