Use REXDESK from the command line

rexdesk-cli does the routine jobs without opening the REXDESK window: read what a logger is and what is on it, download its logs, and convert logs to other formats. It is made for scripts and scheduled tasks.

Before you start

  • Open a PowerShell or Command Prompt window in the cli folder inside the REXDESK program folder.
  • For a command that talks to a logger, close the REXDESK window first. Only one program can use the logger at a time.
  • Converting files that are already on the PC needs no logger.

See what is available

rexdesk-cli help
rexdesk-cli help download
rexdesk-cli version

help lists the commands, help <command> shows the options of one, and version prints the version, for example rexdesk-cli 1.0.0.791.

CommandWhat it doesChanges the logger?
infoShows the logger's model, serial number, firmware, clock, SD card and active configurationNo
diagShows the logger's hardware: channels fitted, GNSS module, accelerometerNo
downloadLists or downloads the logs on the loggerNo
convert-fileConverts one log, or an XML configuration to .rxcNo logger needed
convert-folderConverts every log in a folderNo logger needed
configureSends a configuration file to the loggerYes
set-timeSets the logger's clockYes
formatClears the logger's internal storageYes: erases the logs
reflashReprograms the logger's firmwareYes

Choose the logger

With one logger plugged in, every command uses it. With more than one, add --serial and the serial number as REXDESK shows it in the status bar:

rexdesk-cli info --serial <serial>

Without it the command stops and lists the loggers it found:

REXGEN is not connected
Several loggers are connected (<serial 1>, <serial 2>). Choose one with --serial.

Read the logger: info

rexdesk-cli info

The answer comes in under a second, in five blocks:

BlockWhat it tells you
LoggerModel, Serial number, Connection, and whether the logger is Locked
FirmwareVersion, Build, Feature level, Microcontroller
ClockLogger time, PC time and the difference, for example Logger vs PC: -5225358 s (60.5 days behind)
SD cardCapacity, Free space, the number of Partitions and the number of logs on each (Logs on Master, Logs on Backup 1, …)
Active configurationName, GUID and Size of the configuration the logger is running

Nothing is changed on the logger. diag works the same way and lists the hardware: CAN channels, digital and analog inputs, LIN, the GNSS module and the accelerometer.

Download logs: download

  1. List the logs of a partition:
rexdesk-cli download --list --partition Backup1

Each log is shown with its number, name, start and end time, size and whether it is encrypted. Nothing is downloaded.

  1. Download the ones you want into a folder:
rexdesk-cli download --last 2 --partition Backup1 -O C:\logs

Each file is reported as it arrives, for example Downloading <name>_BK1.rxd (58.0 KB)... [ OK ]. The folder is created if it does not exist.

OptionMeaning
--listList the logs with their numbers. Nothing is downloaded
--last <n>Download the n logs recorded most recently
--log <numbers>Download by number from --list: 3, "1,4,7" or a range 2-5
--allDownload every log of the partition
-O <folder>Where to save. Logs are saved as .rxd (.rxe when encrypted) under the same names Internal Storage gives them
--partition <p>Master (the default), Backup1, Backup2 or Backup3
--overwriteReplace files that already exist. Without it they are skipped

--last goes by the order in which the logs were recorded, not by the dates in their names. If the logger's clock was wrong, the most recent log is not always the one with the latest date.

Listing a partition reads every log entry on the card. On a card with several hundred logs this takes about half a minute. --last on the Master partition does not need the full list and starts at once.

Convert one log: convert-file

The format is chosen by the extension of the output file:

rexdesk-cli convert-file -I C:\logs\<log>.rxd -O C:\out\<log>.mf4

The line ends with [ OK ] when the file is written.

Output extensionFile
.mf4ASAM MDF4
.ascASCII Logging File
.blfVector binary frames
.trcPeak Can Trace File
.cstComma separated trace
.matMatlab 5.0
.parquetApache Parquet
.csvComma separated values

To decode CAN frames into named signals, attach a DBC file to the bus it describes with -S, once per bus:

rexdesk-cli convert-file -I <log>.rxd -O <log>.csv -S can0 C:\dbc\<file>.dbc

Put every channel on the same time step

In a CSV file each channel normally keeps its own sample times, so most rows have values in only some columns. -R resamples to a fixed step in milliseconds, and -T starts every channel from the same moment:

rexdesk-cli convert-file -I <log>.rxd -O <log>.csv -R 100 near -T zero duplicate duplicate

The sampled channels now share one row every 0.1 s: 0.00000, 0.10000, 0.20000, …

OptionValues
-R <ms> <method>The step in milliseconds, then near (the sample nearest in time) or last (the sample before)
-T <axis> <begin> <end>zero starts the time axis at 0 s, first at the first sample in the file. <begin> and <end> say what to write before a channel's first sample and after its last: nothing or duplicate. All three values are needed, and -T is only used together with -R

Convert a folder of logs: convert-folder

rexdesk-cli convert-folder -I C:\logs -O C:\out -F mf4

Each log is reported with [ OK ], and the output folder holds one file per log under the same name.

-F takes the same formats as above, without the dot: mf4, asc, blf, trc, cst, mat, parquet, csv. Add -C to join all the logs into one output file.

Use it in a script

Every command ends with an exit code a script can test:

Exit codeMeaning
0The command did what was asked
1It could not: no logger, a file that does not exist, a log that cannot be converted
2The command line itself is wrong: an unknown command, a missing value, a file type that is not supported

For example, in PowerShell, download the newest log every time the script runs and convert whatever is in the folder:

rexdesk-cli download --last 1 -O C:\logs
if ($LASTEXITCODE -ne 0) { exit 1 }
rexdesk-cli convert-folder -I C:\logs -O C:\out -F mf4

Troubleshooting

SymptomCauseWhat to do
REXGEN is not connectedNo logger is plugged in, or the REXDESK window is open and using itPlug the logger in; close REXDESK
Several loggers are connected (...). Choose one with --serial.More than one logger is plugged inAdd --serial <serial>
there is no data channels to export! when converting to .csvThe log holds only raw CAN frames and no signal database was given, so there are no channels to put in columnsAdd -S <bus> <file>.dbc, or convert to a trace format such as .asc or .mf4
<log> uses trigger pre-buffers; logs with pre-buffers can't be merged with -CThe logs were recorded by a trigger with a pre-trigger timeConvert without -C, one file per log
file does not existThe path after -I is wrongCheck the path; put it in quotes if it contains spaces
Desired output file type or format not specifiedconvert-folder was run without -FAdd -F and a format
-T is ignored without -R-T was given on its ownAdd -R <ms> <method>

Back to REXDESK