Open APIREXGEN 1REXGEN 2REXGEN 2 IMU GNSSREXGEN AirREXGEN ProREXLIBRARYDeveloper

REXLIBRARY: convert RXD logs and XML configurations in your own code

Updated

Call REXLIBRARY from your own .NET code to compile XML configurations for a REXGEN and convert its RXD logs into the formats your tools read.

What REXLIBRARY does

REXLIBRARY converts files. It compiles an XML configuration into the binary RXC file that a REXGEN loads. It also converts the RXD log files that a REXGEN records into standard formats. It does not talk to a logger. To configure a logger, set its clock, download logs or read live data over USB, use the REXGEN Open API. See REXGEN Open API: control a logger over USB from your own application.

RxLibrary.dll is this library. The Open API guide also describes it, but this guide is the reference. It targets .NET Standard 2.0, so it runs on Windows and on Linux.

Which library does what REXGEN OPEN API · TWO LIBRARIES Which library does what RxLibrary.dll works on files, on Windows or Linux XML file .xml RxLib.XmlToRxc compiles RXC file binary configuration RXD log from the logger RxLib.ConvertData converts MF4 BLF ASC TRC CSV MAT Parquet the output file's extension picks the format RGUSBdrv.dll the logger over USB, on Windows Your application on the PC REXGEN logger USB PC connection DeviceIsReady, GetFirmwareVersionExt is a logger ready, which firmware SendConfiguration sends an RXC file ReflashLogger writes a firmware file GetDateTime, SetDateTime reads or sets the clock, in UNIX time GetLogCount, GetSDLogInfo counts and describes the logs GetLogData copies a log to an RXD file on the PC FormatSDCard erases the internal storage InitLiveData, GetLiveData, StopLiveData live data, a 512-byte buffer at a time The RXC that RxLib.XmlToRxc writes is what SendConfiguration sends; the RXD that GetLogData writes is what RxLib.ConvertData reads. RGUSBdrv.dll needs the REXGEN USB driver (installed with REXDESK) and a logger with a USB PC connection; REXGEN Pro has none. Arrows point the way the data goes.

Get the source

The source is in the ReXlibrary repository on GitHub. Its README describes these parts.

BinRXD
Decodes RXD files and compiles XML configurations to RXC. Converts RXD to CSV, InfluxDB CSV, MDF, MATLAB, BLF, ASCII and TRC.
DbcParser
Reads DBC files.
InfluxShared
Shared units used by the other parts.
Matlab File
Writes MATLAB files.
MDF4xx
Writes MDF files.
RXD/RXDDemo
An example that validates an XML configuration against ReXConfig.xsd, compiles it to RXC and opens RXC files.
Demo/AWS_Lambda
An AWS Lambda function that converts files as they arrive in an S3 bucket. For the supported way to run it, see REXGEN Air: converting logs automatically with AWS Lambda.
MinIO/MinIOFileConvert
An example that does the same conversions for MinIO storage.

The repository also holds the configuration schema, ReXConfig.xsd, which the REXGEN XML guides use throughout. See REXGEN XML configuration: how it fits together. It also has folders that the README does not describe yet: A2lParser, Cloud and SharedTools.

Use RxLibrary.dll

Reference RxLibrary.dll in your project and add using RxLibrary;. Every call is a static method of the RxLib class. Build the DLL from the repository, or take it from the Open API demo. See REXGEN Open API: control a logger over USB from your own application.

RxLib.XmlToRxc()

XmlToRxc compiles an XML configuration into an RXC file. Both arguments are full paths. The second is where the method writes the RXC file. It returns true on success.

public static bool XmlToRxc(string xmlFileName, string rxcFileName)
if (!RxLib.XmlToRxc(@"C:\configs\fleet.xml", @"C:\configs\fleet.rxc"))
    Console.WriteLine("The configuration could not be compiled");

Validate the XML against the schema first. See REXGEN XML configuration: how it fits together. Then send the RXC to the logger with the Open API's SendConfiguration, or load the XML in REXDESK.

RxLib.ConvertData()

ConvertData converts an RXD log. The extension of the output path chooses the format. It returns true on success.

public static bool ConvertData(string inputpath, string outputpath, string customformat = null, string EncryptionKeyFile = null)
if (!RxLib.ConvertData(@"C:\logs\run1.rxd", @"C:\logs\run1.mf4"))
    Console.WriteLine(RxLib.LastConvertStatus());

// CSV in InfluxDB format
RxLib.ConvertData(@"C:\logs\run1.rxd", @"C:\logs\run1.csv", "InfluxDB");

The two optional arguments are recent additions. customformat selects a CSV variant: "InfluxDB" for InfluxDB CSV, "Regional" for regional separators. EncryptionKeyFile is the key file for an encrypted log.

ConvertData output formats by file extension
Extension Format Holds
.mf4 ASAM MDF4 Frames and channel values
.blf Vector binary log Frames
.asc ASCII trace Frames
.trc TRC trace Frames
.csv CSV, InfluxDB CSV or regional CSV Channel values
.mat MATLAB 5.0 Channel values
.parquet Apache Parquet Channel values
.xml REXGEN XML The configuration stored in the log

RxLib.LastConvertStatus()

LastConvertStatus returns a message about the last conversion. Read it when ConvertData returns false. Earlier documentation called this method RxLib.ConvertStatus().

public static string LastConvertStatus()

Licence

The ReXlibrary repository has no licence file at its root yet. Treat the code as source available. For questions about using the code in your own product, contact Influx Technology.

Related guides

Products in this guide

REXGEN 1

Vehicle black box

View REXGEN 1 Ask an engineer

REXGEN 2

Evidence data logger

View REXGEN 2 Ask an engineer

REXGEN 2 IMU GNSS

Motion & location data logging

View REXGEN 2 IMU GNSS Ask an engineer

REXGEN Air

CAN to cloud

View REXGEN Air Ask an engineer

REXGEN Pro

Edge data platform

View REXGEN Pro Ask an engineer

Still stuck?

Our engineers answer support questions on every Influx Technology product.