Download SmartLib User Guide
Transcript
set trig(Pattern.4.i) 0x0E
set trig(Pattern.5.i) 0x0F
Multi-Dimensional Arrays
-----------------------Some of the SmartLib commands have multi-dimensional arrays arguments,
such as HTHubSlotPorts and HTCardModels. We have provided the utility
functions ETMake2DArray and ETMake3DArray that create 2-dimensional and
3-dimensional arrays, respectively. Observe the following example of how
to create and use a multi-dimensional array:
ETMake3DArray HSP $MAX_HUBS $MAX_SLOTS $MAX_PORTS
HTHubSlotPorts HSP
for {set iPort 0} {$iPort < $MAX_PORTS} {incr iPort} {
for {set iHub 0} {$iHub < $MAX_HUBS} {incr iHub} {
for {set iSlot 0} {$iSlot < $MAX_SLOTS} {incr iSlot} {
puts $HSP($iHub,$iSlot,$iPort)
}
}
}
Pointers
-------In rare cases in the SmartLib, structure fields may be pointers to a
particular data type. An example of this is the "Data" field of the
HTVFDStructure data structure. In C/C++ form, the HTVFDStructure is
declared in et1000.h like this:
typedef struct
{
int Configuration;
int Range;
int Offset;
int* Data;
int DataCount;
} HTVFDStructure;
SmartLib User Guide
195