Open APIREXGEN 1REXGEN 2REXGEN 2 IMU GNSSREXGEN AirREXGEN ProREXLIBRARYDeveloper
REXLIBRARY: convert RXD logs and XML configurations in your own code
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.
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.
| 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
Still stuck?
Our engineers answer support questions on every Influx Technology product.