![DAP Technology 1394 Скачать руководство пользователя страница 161](http://html.mh-extra.com/html/dap-technology/1394/1394_operation-manual_509853161.webp)
Scriptor
161
Copyright © DapTechnology B.V., 2005-2019 - All Rights Reserved., 5/20/2019
11.2.4.7. Macros
In addition to the statements described in the previous section, the Script Editor also supports the use of
macros. Macros can be used by providing their name on an empty line in the script editor. After such a
name is entered, a property editor corresponding to that type of macro will show up. Available macro
editors will be covered in the next sections.
11.2.4.7.1 fillPacket
The fillPacket macro can be used to completely fill a packet buffer with constant data. Such constant data
is created with the
. The property editor should at least be provided a PacketID to fill and a
HeaderID or a DataID or both to read the data from.
If data has already been defined, the Header ID combo box and the Data ID combo box will contain the
names of all available data objects. Otherwise, the user can click on the "New" button to create a new
data object. When a data object has been selected in one of the combo boxes, the user can edit the data
by clicking on the "Editor" button. When filling a packet with data, the corresponding data size is updated
in the packet header if the header is already defined. The header can be defined by providing this macro
a data ID for the header or by setting the header in the script before this macro is invoked.
In the image below, an example is given that fills a packet with data from the "MyData" data object. As
can also be seen in the image below, the compiler 'knows' about the data object's name because it has
been defined by a "#define" statement in the script. So the user has the choice to provide this macro with
a defined name for the data, a numeric data ID (0 in this case) or even an integer variable set to the
correct value. Note that when providing a numeric Data ID or integer variable, the user should make sure
it really exists.
After filling in values in the property editor, the macro generates subnodes. Those subnodes are
generated by the macro and read-only to the user (as indicated by a gray color). When the script is
compiled, the line containing the macro call is not compiled itself, but only its subnodes. In this example
the generated code is a call to an API function to fill the packet.
11.2.4.7.2 setPacketDataFields and getPacketDataFields
This macro can be used to set individual field values in a packet. It is invoked by entering
"setPacketDataFields", and an editor shows up as can be seen on the right side of the picture below.
The packetID is the ID of the packet buffer which has to be filled. Change items in the 'Value' column to
setup the packet layout. Setting values in the value column will not write these values in the packet, these
values are only used to setup the correct packet layout in the editor. To actually write a field to the packet,
click on the 'set' cell. By default the value in the 'Value' column will be used as the field value. Change the
value in the 'Param Value' column if you'd like to use a variable or a different numeric value to set this
Содержание 1394
Страница 1: ...1394 Analyzer Operation Manual Hardware and Software Guide Doc DT PRO134MAN700E ...
Страница 11: ...1394AnalyzerOperationManual 11 456 The SCSI2 Connector 457 The SUBD connector ...
Страница 187: ...Scriptor 187 Copyright DapTechnology B V 2005 2019 All Rights Reserved 5 20 2019 ...
Страница 199: ...Scriptor 199 Copyright DapTechnology B V 2005 2019 All Rights Reserved 5 20 2019 ...
Страница 363: ...FormatEditor 363 Copyright DapTechnology B V 2005 2019 All Rights Reserved 5 20 2019 ...