There are two command-line programs provided for the extraction of Data Logger data. They must be run on the logging host (which is the same as the R/T host in a typical installation). The dlxtract program will provide ASCII columnar output, and the dl2mat command creates Matlab Level-4 data files. Usage information for each command follows.
The PYToolkit also contains the dlxtractrem.py command line utility. It is similar to dl2mat. See the PYToolkit user manual for more details.
Data logger extraction utility $Revision$ - $Date$
Copyright Concurrent Computer Corp (2005-2011)
Usage: dlxtract -S testid/sesionid -v var1[,var2,..] [-s startframe] [-n number of values] [-i] [-E] [-A] [-R] [-F] [-i]
Options
-------
-E : print engineering value. Default if not specified
-A : print alternate value.
-R : print raw value.
-F : print run time flag.
-T : print time stamp.
-f : print frame number for record.
-i : print meta information about the test.
-s frame : start extracting at frame count.
-n nvalues : extract nvalues records.
-m : print meta records .
-t : test mode; just extract the data without printing anything.
-v variable_names : extract records for variables a,b,c,.. comma separated list of variables'.
-V file w/ variables to extract: When variable names contain , (commas) they cannot be specified on the
command line. In this case, the list of variables to extract
can be given in a file with one variable per line.
-S testid/sessionid : extract records corresponding to the testid/sessionid combination.
-p pathname : Directory name where the logger data files reside. This can be provided instead of
the testid/sessionid combination.
This program converts SimWB data logger data into Matlab readable data.
COMMAND USAGE
usage: dl2mat OPTIONS testId/sessionId
OPTIONS are:
-h detailed command help
-e no EU values
-a no ALT values
-f no FLAGS values
-l send all messages to SimWB logger
-m meta information only
-M meta naming information only
-N NAMEFILE meta naming information to file NAMEFILE
-H meta header information only
-v verbose output
-s use smart heuristics in generating tags (-n ignored)
-o OUTFILE store results to OUTFILE (default 'rtdata.mat')
-n ELEM use ELEM name elements when generating tags (default 2)
-t TAGFILE map names with TAGFILE
-w START,END extract data from the time window [START, END] (seconds, default all)
-x EXTFILE extract only items listed in file EXTFILE (default all)
-X EXTSTRING extract only items listed in EXTSTRING, delimited by commas
-S STRINGLEN extract only STRINGLEN bytes of string data
-z adjust time for zero start
-b BIAS bias time by this BIAS value
-T TNAME time parameter name (default 't')
-p PARENT parent of test directory is PARENT
-P PROJECT use this PROJECT
The primary command argument is the 'testId/sessionId' name (including the slash, '/')
of the recorded session data to be converted. Everything else is controlled via optional
command switches.
-e
By default the engineering values, alternate values and flags for each logged item
will be converted (becuase they are always recorded). The -e option inhibits
conversion of the engineering values.
-a
Like -e, but inhibits the conversion of the alternate values.
-f
Like -e, but inhibits the conversion of the flags.
-l
Messages (errors, warnings, etc) are also sent to the SimWB logger and displayed
in its message window.
-m
Print the meta information for all recorded values and then terminate (see META
INFORMATION).
-M
Print the meta name information only. This output can be stored and used as
a tag file later. (see NAME MAPPING)
-N NAMEFILE
Similar to -M, but the meta name information is written into NAMEFILE, and can
be done along with the extraction of data. (see NAME MAPPING)
-H
Print the meta header information for all recorded values and then terminate (see META
INFORMATION).
-v
Be verbose. The meta information (see META INFORMATION) will be displayed before
conversion, and item names are displayed as converted.
-z
Adjust the extracted time parameter so that it has a zero starting value.
-b BIAS
Bias the extracted time parameter by BIAS seconds. This will be done after -z (zero
starting value) time adjustment if you desire a specified non-zero start time.
-o OUTFILE
The Matlab data will be written into 'rtdata.mat' unless OUTFILE is specified.
-n ELEM
Use ELEM name elements (see NAME MAPPING) when creating tags from recorded names.
-s
Use the smart heuristics (see NAME MAPPING) when creating tags from recorded names.
-t TAGFILE
Use the name mapping from the tag file TAGFILE (see NAME MAPPING).
-w START,END
Define a time window, from START to END seconds, from which to extract the data. By
default all the data is extracted.
-x EXTFILE
EXTFILE is a file containing a list of item names to be extracted. The file should
contain one item name per line. Item names are matched first against the recorded
full names, and then the tag names.
-X EXTSTRING
EXTSTRING is a comma seperated list of item names to be extracted. Item names are
matched first against the recorded full names, and then the tag names.
-S STRINGLEN
Extract only STRINGLEN bytes of data from recorded strings. This can significantly
reduce the output data size, as strings are 1024 bytes long.
-T TNAME
A variable representing time must be included in the Matlab output. By default this
variable is named 't', but can be changed to TNAME with this option.
-p PARENT
The parent of the testId directory, in a default installation, is determined by
information in the /etc/ccursim.conf file. The data can be moved or copied somewhere
else as long as the directory and naming structure is preserved. If you want to
convert data that resides somewhere else, you can set the parent of the testId directory
with this option.
-P PROJECT
The project name under which this test/session was run.
NAME MAPPING
Matlab imposes limits on the length of variable names (see LIMITATIONS). If you have
recorded model parameters or signals, or heirarchically defined RTDB items, then these
names are likely too long. Without a defined name 'mapping', the converter attempts to
create a name from the Simulink name by breaking the name up into 'elements' (delineated
by a '/', and then a '.') and then shortening and replacing characters as needed until a
unique name is created. The number of elements used to create a name is controlled via
the -n option.
Alternately, a 'smart' algorithm can be employed that may yield better names, depending
on the model. First, RTDB items will be named using the last element of the entire name.
If the name begins with an '_', and the next character is a letter, the '_' is removed
(otherwise the '_' is replaced with a 'z'). Second, signals will be named using the last
element minus the '-Pn' suffix. Anything left over (assumed to be a parameter at this point)
follow the heuristics defined in the preceding paragraph.
If you want to specify your own names, simply put them in a 'tag' file and tell the
converter to use these mappings first via the -t option. The format is simple: the
first column is the tag name (which will be used as the variable name in the Matlab
file) and then everything following the tag (seperated by white space) is considered
to be the actual name in the data. You can see these names in the recorded data with
the -M option. For example:
sen_tctvlt MKS_09fwd_r1p3_hdfx/S:Plant/PlantSubSys//Sensors/Gain15/sen_tctvlt-P0
In this case the name sen_tctvlt would be used as the variable name instead of the
long name as it is seen in the model. The tag files are read first before the
converter tries to create it's own names. One quick plus - the output from the -M
option can be saved and reused as a tag file later.
One last thing to note: when converting strings it is often desireable to store only
a portion of the 1024 byte buffer. This can can be specified on a per-item basis via
the tag file. Simply append the desired length, enclosed in angle brackets, to the
tag name. For example:
buffer<10> MKS_09fwd_r1p3_hdfx/S:Plant/PlantSubSys/MOXA/Input1
would save the first 10 bytes of data from the RTDB string item defined above.
META INFORMATION
All the meta information known about the recorded items is displayed, including the
name mappings.
LIMITATIONS
The maximum Matlab name length used by this program is 61. This is actually two less
than the actual maximum, because alternate value and flag data names must also be
created by appending '_a' and '_f' to the item name.
Only scalars, vectors and 2-D arrays are supported.
You may see the following message when you start the converter with the -l option:
ccurLog_connect: connect() : No such file or directory
This can be safely ignored. It means that the convert could not connect to SimWB
for message display.
sprj
is a command line utility that can be used on the real-time
host to navigate to the specified project folder. The following is the usage
information for the command.
sprj is a utility to allow easy navigation to SimWB project folders.
usage: (The initial dot (.) is required)
$ . sprj Hardware-Tests/CAN # equivalent to "cd # /usr/local/ccursim/projects/__project.Hardware-Tests/__project.CAN"
$ . sprj Simulink # equivalent to "cd # /usr/local/ccursim/projects/__project.Simulink"