Skip to Content

CXDL Command - Automatic Datalog Sending

Configures automatic sending of datalog (LOG) records to the specified destination.


What is it for?

Use caseDescription
🔄 Automatic synchronizationSend history when reconnecting
📶 Data recoveryTransmit offline stored positions
📡 Multiple channelsAlternate between WiFi/GPRS/BLE
🔁 Configurable retriesControl 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

SCXDLE

Cancels pending report sending but keeps data in LOG.

Query

QCXDL

Response

RCXDL<Ena>,<Dst>,<Reint>,<Time>,<Order>

QCXDL returns the Order field at the end of the configuration.


Parameters

ParameterDescriptionValuesDefault
EnaEnable0 = Disabled, 1 = Enabled0
DstSending destinationTRM, GPRS, WIF, BTH, ALL-
ReintRetries0 = Infinite, 1-999 = Amount0
TimeTime between retriesTenths of second (100 = 10s)0
OrderDrain order (optional, v1.09.23+)0 = FIFO, 1 = LIFO0

Destinations

DestinationDescription
TRMSerial terminal (USB/RS232)
GPRSCellular connection
WIFWiFi
BTHBluetooth
ALLAlternates 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 FIFO

A 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
FieldDescription
OrderActive drain order (0=FIFO, 1=LIFO)
RefMinMinimum pending reference in the LOG
RefMaxMaximum pending reference in the LOG
ScanRefCurrent scan reference
PendingRecords pending to send
EnableSending engine active (0/1)
ResetEngine 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

  1. Configure destination:

    >SCXDL1,TRM,1,1<
  2. Generate LOG record:

    >GCQ00H;@LOG<
  3. Device sends automatically:

    >RCQ00000000000000-2778128-064258630020907F0000000000000130606FFFF1518;#0002;ID=869084063093789;*30<
  4. Disable automatic sending:

    >SCXDL0<

Compatibility

💾Firmware:v1.05.00
💾Firmware v1.05.00
SP-IOT
SM-IOT
Order field and QCXDLST from v1.09.23

See Also

Last updated