Appendix A: Automating the Decoder
With the decoder table populated, run the script from the oscilloscope (or a PC if you have a remote connection to
the oscilloscope). The script will generate the comma-delimited file, ExampleTableSerialDecode.txt, which may be
imported into Excel or other spreadsheet software to show the table structure.
Example spreadsheet after importing ExampleTableSerialDecode.txt.
The first two rows of the imported file will show the total number of rows and columns in the table, in this example 8
rows and 34 columns. This indicates the range of your
RowA
and
ColA
keys.
The third row of the imported file will replicate the column headers of the Result Table (0), with individual records
(frames, messages, etc., depending on how you have "packetized" the decoding) appearing in subsequent rows (1-
n
).
Counting from 0 at the far left (Row Index Number), find the column of the data you wish to access. That will be the
ColA
key in your script.
Note: Do not confuse the number/letter of the cells in the imported file with the rows/columns of the Result
Table.
Hidden columns (whether hidden by you or the software) must still be counted, so, in the example above, PRIO is
column 3, making ID column 4, and so forth. So, if you wished to access the ID of record 6, the first argument of your
query would be: (6,4)
Within each column, Simple Cells contain a single value that appears at the specified location in the table. In the
above example, columns 0 through 2 are Simple Cells. Simple Cell VBS access syntax is:
vbs? 'return=app.SerialDecode.Decode1.out.Result.cellvalue(
RowA
,
ColA
)'
However, many cells of the Result Table are the Table Cell type, nested tables that may contain multiple "B" columns
and always three "B" rows that, when coupled with the column key, each return a different component of the
measurement: (0,
ColB
) = MeasuredValue, (1,
ColB
)= StartTime, (2,
ColB
) = StopTime. These cells can be identified by
the list of semi-colon delimited values within them. The first three values in the list are Col0, the second three values
are Col1, and so forth.
To access Table Cells, the (
RowB
,
ColB
) argument is sent in a second parenthesis, following the A "locators":
vbs? 'return=app.SerialDecode.Decode1.out.Result.cellvalue(
RowA
,
ColA
)(
RowB
,
ColB
)'
Although the image above does now show it, the ID and IDE columns each contain a single-column, three-row
nested table. To read the
values
from such columns, you would add the argument (0,0) following your "locators":
(
RowA
,4),(0,0) and (
RowA
,6),(0,0) respectively.
Reading the Data column (
RowA
,12) is more complicated, because it contains a
multi-column,
three-row nested
table, as indicated by the longer list of values. To access the full Data column value for each record, all
ColB
s must
be called by your script.
For example, if these were your decoder results:
31