PROTOCOL SOLUTIONS GROUP 3385 SCOTT BLVD SANTA CLARA, CA 95054 CATC Scripting Language Reference Manual for CATC USB Analyzers A Scripting L
4CHAPTER 2CATC Scripting Language for USB ValuesEscape SequencesThese are the available escape sequences in CSL:ListsA list can hold zero or more piec
5CHAPTER 2CATC Scripting Language for USB Valuesresult = null;VariablesVariables are used to store information, or data, that can be modified. A varia
6CHAPTER 2CATC Scripting Language for USB Valueswill create a local variable called Local, which will only be visible within thefunction Function. Add
7CHAPTER 3CATC Scripting Language for USB ExpressionsCHAPTER 3: EXPRESSIONSAn expression is a statement that calculates a value. The simplest type of
8CHAPTER 3CATC Scripting Language for USB Expressionsx=10Value_of_x = select {x<5:"Lessthan 5";x>=5:"Greater than or equal to 5&q
9CHAPTER 4CATC Scripting Language for USB OperatorsCHAPTER 4: OPERATORSAn operator is a symbol that represents an action, such as addition or subtract
10CHAPTER 4CATC Scripting Language for USB OperatorsThe associative operator () is used to group parts of the expression, forcing thoseparts to be eva
11CHAPTER 4CATC Scripting Language for USB Operators=+=-=*=/=%=>>=<<=&=^= |=Right to leftOperator Symbol AssociativityTable 4.1: Opera
12CHAPTER 4CATC Scripting Language for USB OperatorsOperatorSymbolDescriptionOperandTypesResultTypesExamplesIndex Operator[] Index orsubscriptRaw Byte
13CHAPTER 4CATC Scripting Language for USB OperatorsEquality Operators== Equal Integer-integer Integer 2==2String-string Integer "three" ==
CATC Scripting Language for USB LeCroy Corporation ii Document Disclaimer The information contained in this document has been carefully chec
14CHAPTER 4CATC Scripting Language for USB OperatorsBitwise Logical Operators~ BitwisecomplementInteger-integer Integer ~0b11111110 = 0b00000001&
15CHAPTER 4CATC Scripting Language for USB OperatorsAssignment Operators (continued)&= Bitwise ANDassignmentInteger-integer Integer a = 0b11111110
16CHAPTER 4CATC Scripting Language for USB Operators
17CHAPTER 5CATC Scripting Language for USB CommentsCHAPTER 5: COMMENTSComments may be inserted into scripts as a way of documenting what the scriptdoe
18CHAPTER 5CATC Scripting Language for USB Comments
19CHAPTER 6CATC Scripting Language for USB KeywordsCHAPTER 6: KEYWORDSKeywords are reserved words that have special meanings within the language. They
20CHAPTER 6CATC Scripting Language for USB Keywords
21CHAPTER 7CATC Scripting Language for USB StatementsCHAPTER 7: STATEMENTSStatements are the building blocks of a program. A program is made up of lis
22CHAPTER 7CATC Scripting Language for USB Statementsif(3-3||2-2)Trace ( "Yes" );else Trace ( "No" );will cause “No” to be printed
23CHAPTER 7CATC Scripting Language for USB StatementsThe examplefor(x=2;x<5;x=x+1)Trace ( x, "\n" );would output234The example above work
iiiCATC Scripting Language for USB Table of ContentsTABLE OF CONTENTSTableofContents ... iii1 Introduction ...
24CHAPTER 7CATC Scripting Language for USB StatementsTrace ( HiThere() );...HiThere(){a = "Hi there";return a;b = "Goodbye";return
25CHAPTER 7CATC Scripting Language for USB Statements...<last_statement>;}An example of a compound statement is{x=2;x+3;}It's also possible
26CHAPTER 7CATC Scripting Language for USB Statements
27CHAPTER 8CATC Scripting Language for USB PreprocessingCHAPTER 8: PREPROCESSINGThe preprocessing command %include can be used to insert the contents
28CHAPTER 8CATC Scripting Language for USB Preprocessing
29CHAPTER 9CATC Scripting Language for USB ContextCHAPTER 9: CONTEXTThe context is the mechanism by which transaction data is passed in and out of the
30CHAPTER 9CATC Scripting Language for USB Context
31CHAPTER 10CATC Scripting Language for USB FunctionsCHAPTER 10: FUNCTIONSA function is a named statement or a group of statements that are executed a
32CHAPTER 10CATC Scripting Language for USB Functionsthe parameter x will be assigned to 1, and the parameter y will be assigned to null,resulting in
33CHAPTER 11CATC Scripting Language for USB PrimitivesCHAPTER 11: PRIMITIVESPrimitive functions are called similarly to regular functions, but they ar
ivCATC Scripting Language for USB Table of Contents8 Preprocessing ...279 Context ...
34CHAPTER 11CATC Scripting Language for USB PrimitivesCommentsFormat is used to control the way that arguments will print out. The format stringmay co
35CHAPTER 11CATC Scripting Language for USB Primitives• A space will insert a space before a positive signed integer. This only works with theconversi
36CHAPTER 11CATC Scripting Language for USB Primitivesresult = C # The result is given inhexadecimal. The result in binary is 1100.In the call to GetN
37CHAPTER 11CATC Scripting Language for USB PrimitivesResolve()Resolve( <symbol_name string>)Return valueThe value of the symbol. Returns null i
38CHAPTER 11CATC Scripting Language for USB Primitives
39CHAPTER 12CATC Scripting Language for USB Decoder PrimitivesCHAPTER 12: DECODERPRIMITIVESAbort()Abort()Return valueAn integer that should be passed
40CHAPTER 12CATC Scripting Language for USB Decoder PrimitivesReturn valueNone.CommentsAdds a display cell to the current output context. Cells are di
41CHAPTER 12CATC Scripting Language for USB Decoder PrimitivesAddCell( "Warning", "Value5", "Warning cell",0x00BB22, _WA
42CHAPTER 12CATC Scripting Language for USB Decoder PrimitivesExample# Creates a data cell with 2 dwords (32-bit integers)of data.AddDataCell( '0
43CHAPTER 12CATC Scripting Language for USB Decoder PrimitivesAddSeparator()AddSeparator(<additional_info any>, ...)Return valueNone.CommentsCre
vCATC Scripting Language for USB Table of Contents14USBDecoders...55DecoderFiles ...
44CHAPTER 12CATC Scripting Language for USB Decoder PrimitivesReturn valueNone.CommentsBegins a cell block and adds a block header cell. This is a spe
45CHAPTER 12CATC Scripting Language for USB Decoder Primitives# This cell will be displayed when the red group iscollapsed:AddCell( "Red is"
46CHAPTER 12CATC Scripting Language for USB Decoder PrimitivesThe output of the example is:Complete()Complete()Return valueAn integer that should be p
47CHAPTER 12CATC Scripting Language for USB Decoder PrimitivesEndCellBlock()EndCellBlock()Return valueNone.CommentsEnds a cell block that was started
48CHAPTER 12CATC Scripting Language for USB Decoder PrimitivesPeekNBits()PeekNBits(<bit_count integer>)Return valueNone.CommentsReads bit_count
49CHAPTER 12CATC Scripting Language for USB Decoder PrimitivesReturn valueAn integer that should be passed back to the application unchanged.CommentsT
50CHAPTER 12CATC Scripting Language for USB Decoder Primitives
51CHAPTER 13CATC Scripting Language for USB ModulesCHAPTER 13: MODULESModules are a collection of functions and global data dedicated to decoding acer
52CHAPTER 13CATC Scripting Language for USB ModulesModule DataThere are several standard global variables that should be defined in a modulewhich are
53CHAPTER 13CATC Scripting Language for USB ModulesIconOptional. File name of an icon to display on the toolbar. Must be a 19x19 pixelbitmap file.Exam
viCATC Scripting Language for USB Table of ContentsPrepareZeroFieldForDlg() ...67PrepareFieldForDlgExt() ...
54CHAPTER 13CATC Scripting Language for USB Modules
55CHAPTER 14CATC Scripting Language for USB USB DecodersCHAPTER 14: USB DECODERSDecoding scripts for the CATC USB Analyzers can now be written in the
56CHAPTER 14CATC Scripting Language for USB USB DecodersWhen UsbScriptDecodeType=1, the decoding for the colored fields of the tracedisplay are handle
57CHAPTER 14CATC Scripting Language for USB USB DecodersUsbEndpTypeVal ue s: “Bulk” or “Interrupt”. Used to distinguish transfer types of theendpoints
58CHAPTER 14CATC Scripting Language for USB USB Decodersthe Mass Storage Class provides for Protocol 0x50 for Bulk-Only Trans-port, and Protocol 0 for
59CHAPTER 14CATC Scripting Language for USB USB DecodersUsbReqStrValue: This will contain the string you build up for the Request portion ofthe Reques
60CHAPTER 14CATC Scripting Language for USB USB DecodersUsbDecExtraInfoBytePosValue: The byte offset in this transfer where the information byte poten
61CHAPTER 14CATC Scripting Language for USB USB Decoders...tooltip = normal_tooltip + WARNING_SIGN +error_tooltip;Add...Cell( caption, value, tooltip,
62CHAPTER 14CATC Scripting Language for USB USB Decodersset Global_BitField_offset = 0; # global variablethat contains the offset, in bits, from the b
63CHAPTER 14CATC Scripting Language for USB USB DecodersCommentsSaves the global field settings. Can be used in conjunction withRestoreFieldSettings()
1CHAPTER 1CATC Scripting Language for USB IntroductionCHAPTER 1: INTRODUCTIONCATC Scripting Language (CSL) was developed to create scripts that would
64CHAPTER 14CATC Scripting Language for USB USB DecodersExampleval = Find(AttrIDValue_Table, PacketType);ShowDataBlock()ShowDataBlock(len, no_cells)Co
65CHAPTER 14CATC Scripting Language for USB USB DecodersExampleif(in.Expanded) Warning("Bad value", "This is exampleof Warning-cell.&qu
66CHAPTER 14CATC Scripting Language for USB USB DecodersAddSimplePLCell("LID", Format("%d", LID_number ),tooltip + AddWarningToolt
67CHAPTER 14CATC Scripting Language for USB USB DecodersExampleIncFieldOffset( 64 );PrepareFieldForDlg()PrepareFieldForDlg(field_name, str_value, tool
68CHAPTER 14CATC Scripting Language for USB USB DecodersCommentsZeroField means that the field to be added to out.FieldsList is not a datafield. Rathe
69CHAPTER 14CATC Scripting Language for USB USB DecodersCommentsWrites passed data to out.FieldList as a special field called ‘CAPTION’.ExampleAddCapt
70CHAPTER 14CATC Scripting Language for USB USB DecodersExampleAddDataBlockToDlg(72);CheckBadDataLength()CheckBadDataLength()CommentsChecks offset fro
71CHAPTER 14CATC Scripting Language for USB USB DecodersExamplePeekNBits_(16);GetNBits_()GetNBits_(offset, len)CommentsThis is a redefinition of the G
72CHAPTER 14CATC Scripting Language for USB USB DecodersCommentsExtracts a bit (bit_needed)fromsource.ExampleGetBit(3, peek_value);AddCaptionCell()Add
73CHAPTER 14CATC Scripting Language for USB USB DecodersAddPayLoadCell()AddPayLoadCell(caption, text, tooltip, addparam)CommentsDraws a payload cell.
2CHAPTER 1CATC Scripting Language for USB Introduction
74CHAPTER 14CATC Scripting Language for USB USB DecodersCommentsDraws a monocolor cell that is similar to the usual payload cell except that both theu
75CHAPTER 14CATC Scripting Language for USB USB DecodersCommentsUsed to begin new group of cells and a table in dialog view that allows the tooltipto
76CHAPTER 14CATC Scripting Language for USB USB DecodersCommentsCreates a monocolored cell. It is intended to be used to start a new group of cellsand
77CHAPTER 14CATC Scripting Language for USB USB DecodersCommentsCreates a monocolored cell. It is intended to be used to start a new group of cellsbut
78CHAPTER 14CATC Scripting Language for USB USB DecodersAddSimpleCellMonoCap()AddSimpleCellMonoCap(caption, text, tooltip, addparam)CommentsA ‘simple’
79CHAPTER 14CATC Scripting Language for USB USB DecodersCommentsUsed instead of AddPayLoadCell() for cells in group. ‘Block’ payload cellsuse view set
80CHAPTER 14CATC Scripting Language for USB USB DecodersComments‘Block’ payload cells use view settings contained in global view setting variableVS. T
81CHAPTER 14CATC Scripting Language for USB USB DecodersCommentsUsed to start a new group of cells and table in dialog view, similarly toAddPLCellMono
82CHAPTER 14CATC Scripting Language for USB USB DecodersCommentsUsed to determine whether an item defined with view_setting is shown.ExampleShowDataBl
83CHAPTER 14CATC Scripting Language for USB USB Decoders(UnsignedCompare(AttModifier, low_limit) < 0) ||(UnsignedCompare(AttModifier, high_limit) &
3CHAPTER 2CATC Scripting Language for USB ValuesCHAPTER 2: VALUESThere are five value types that may be manipulated by a script: integers, strings,lis
CATC Scripting Language for USB LeCroy Corporation 84 How to Contact LeCroy Type of Service Contract Call for technical support… US and Cana
Komentarze do niniejszej Instrukcji