The External Data Source property of a DataBlock is a useful way of storing test data in an external file rather than in an MxVDev TestCase. It is also an easy way to import data for a single signal. Using an external data source has several advantages:
•It is a more efficient way of storing data. An external CSV file is smaller than an equivalent XML TestCase (.mxc) file .
•Multiple TestCases can use a single data file.
•It is useful way to reduce memory usage when working large data sets such as image data.
•Have test data created from a simulation run in Simulink
•Capture test data from test stand instrumentation, such as a digital scope, or CANoe
•Create your own test data using an Excel spreadsheet
•Create a data file from internal MxVDev signal data
•Have data exported from a TestCase
The External Data Source property allows you to use an external data file to specify the commanded values or expected results for a particular Signal.
•When you have a DataBlock with an external data source, if you re-select the Data Location option as Internal, the data that was read from the file remains in the TestCase as a sequence of Transitions. This is one way to import data from a file.
•When loading external data, only the transitions in the selected DataBlock's range are loaded.
•The times in the external data file should be relative to the DataBlock's start time.
To use external data for a DataBlock:
1.Move the cursor over the Signal Plot area to display the name of the DataBlock in a pop-up bubble.
2.Right-click to display the DataBlock menu:
3.Select Properties to display the DataBlock Properties dialog shown below.
4.Click External in the Data Location panel to display the External Data Source Properties panel.
Use the DataBlock Properties form to provide the following:
•Data Location: Check External to attach an external data file to this Signal. If you attach external data to a signal, and then check Internal, the Signal will retain the values that were read from the file. In this way, you can import data from a data file directly into a TestCase, and you will no longer require the external data file.
•Data Source File: Click to select the file containing the test data.
•After No More Data in Source File: Choose how to behave if the data file is not long enough to specify the value of the signal at every step in the TestCase. You can specify:
oHold Last Value: The signal maintains its value at the last step for which there was data. Note that for Message Signals, selecting this option results in no more messages being generated after the external data has been used.
oRepeat Data Set: When the end of the file is reached, return to the beginning and repeat the content of the data file for subsequent steps.
The View Data File button brings up the associated data file for inspection.
Note: If your file contains quotes, Excel is not recommended for editing as it may add or remove quotes unexpectedly.
If the amount of data in the data file exceeds the current number of samples in the TestCase's active range, the system displays:
Choosing Yes expands the active range by moving the stop point. Choosing No leaves the stop point where it is, which means that not all data in the file will be used when the associated test case is executed.
Note that an output signal can also be loaded with data from an external data source.
Two file formats are supported for importing signal values:
You can create an external data file from internal MxVDev Signal data. Right-click on the Signal Plot Area, select the Signal Menu, then choose the option Save to External Data File. This creates a text file in the External Data Source (two-column) format. This is useful if you want to edit a signal manually as a sequence of numbers. You can also use it to reduce memory usage. The file-naming convention <TestCaseName><SignalName>.dat may be helpful.