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
clifolder 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.
| Command | What it does | Changes the logger? |
|---|---|---|
info | Shows the logger's model, serial number, firmware, clock, SD card and active configuration | No |
diag | Shows the logger's hardware: channels fitted, GNSS module, accelerometer | No |
download | Lists or downloads the logs on the logger | No |
convert-file | Converts one log, or an XML configuration to .rxc | No logger needed |
convert-folder | Converts every log in a folder | No logger needed |
configure | Sends a configuration file to the logger | Yes |
set-time | Sets the logger's clock | Yes |
format | Clears the logger's internal storage | Yes: erases the logs |
reflash | Reprograms the logger's firmware | Yes |
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:
| Block | What it tells you |
|---|---|
Logger | Model, Serial number, Connection, and whether the logger is Locked |
Firmware | Version, Build, Feature level, Microcontroller |
Clock | Logger time, PC time and the difference, for example Logger vs PC: -5225358 s (60.5 days behind) |
SD card | Capacity, Free space, the number of Partitions and the number of logs on each (Logs on Master, Logs on Backup 1, …) |
Active configuration | Name, 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
- 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.
- 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.
| Option | Meaning |
|---|---|
--list | List 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 |
--all | Download 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 |
--overwrite | Replace 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 extension | File |
|---|---|
.mf4 | ASAM MDF4 |
.asc | ASCII Logging File |
.blf | Vector binary frames |
.trc | Peak Can Trace File |
.cst | Comma separated trace |
.mat | Matlab 5.0 |
.parquet | Apache Parquet |
.csv | Comma 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, …
| Option | Values |
|---|---|
-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 code | Meaning |
|---|---|
0 | The command did what was asked |
1 | It could not: no logger, a file that does not exist, a log that cannot be converted |
2 | The 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
| Symptom | Cause | What to do |
|---|---|---|
REXGEN is not connected | No logger is plugged in, or the REXDESK window is open and using it | Plug the logger in; close REXDESK |
Several loggers are connected (...). Choose one with --serial. | More than one logger is plugged in | Add --serial <serial> |
there is no data channels to export! when converting to .csv | The log holds only raw CAN frames and no signal database was given, so there are no channels to put in columns | Add -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 -C | The logs were recorded by a trigger with a pre-trigger time | Convert without -C, one file per log |
file does not exist | The path after -I is wrong | Check the path; put it in quotes if it contains spaces |
Desired output file type or format not specified | convert-folder was run without -F | Add -F and a format |
-T is ignored without -R | -T was given on its own | Add -R <ms> <method> |