User manual

Table Of Contents
MAUI Oscilloscopes Remote Control and Automation Manual
Exposing Table Data
Tables are data arrays that may be one- or two-dimensional, and this is impossible to tell from looking at
the table as it is presented in MAUI.
Many tables have Variant cell types, which may contain other tables that also need to be indexed in order
to see the correct values. For example, were you to send this simple VBS query to get results from the
Spectrum Analyzer table:
vbs? 'return =app.SpecAnalyzer.SpecAnTable.Out.Result.CellValue(3,2)'
(3,2) represents the table (row,column) to return, but to specifically return the frequency value, you'd have
to send something like:
vbs? 'return =app.SpecAnalyzer.SpecAnTable.Out.Result.CellValue(3,2)(0,0)'
The first index indicates the row of table data wanted (3) from the Frequency column (2), but that single
cell contains an array of the Amplitude value (0,0), Start Frequency (1,0) and Stop Frequency (2,0). You
have to index first the principle table then the array inside that particular cell, hence the extra (0,0) to get
the amplitude value.
Likewise, the table that presents the results of any serial decoder software,
app.SerialDecode.Decoden.Out.Result, is a table with a table in each cell that you need to index at
(line,col). However, it only has a numeric value in (0,0) that needs to be indexed, as well.
Note: If the data in a cell of the Serial Decoder Result table is a string, there is no
(datatype,dataidx); if it is a number, there is an array to be indexed and it is always at (0,0).
The Serial Decode table presents a number of challenges in exposing results. See the sample script
D:\Scripts\Automation\ExampleTableSerialDecode.vbs, which iterates over the Serial Decode table and
dumps the data to a text file.
Tip: To see how this works, recall the Table Serial Decode entry from
D:\Scripts\Automation\AutomationExamplesLabNotebook.lnb. This will copy two waveforms into
M1 and M2 and apply the USB2 decoder to them.
Handling Different Cell Types
There are four cell "types" that may appear in a table. Each type must be handled differently in code.
l CellType 0 is a Variant (as in the Spectrum Analyzer and Serial Decoder tables). These cells may
hold different things, such as other table arrays, which may be either one- or two-dimensional.
l CellType 2 is a Param result (as in the Measure table). These are cells with single values.
l CellType 3 is a Boolean result. These are cells containing single, Boolean values, either 1|0 or
True|False.
l CellType 4 is the histicon cell of the Measure table. This not commonly used.
2-36