Binary Fill
The Binary Fill action fills a BINARY
variable with a specified one byte value. You can use the
action to initialize or clear a BINARY variable. In
addition, you can choose to fill only a portion of the
variable. The fill character is a one byte value in the
range of 0 to FF (the digits A - F can be entered in upper
or lower case).
Parameter descriptions
The action provides these parameters:
Parameter | Description |
---|---|
Action Input
Type
|
The options are: Static - The specified Starting Offset cannot be changed unless you edit the trigger. Dynamic -The Starting Offset parameter becomes available from the Input tab. |
Starting Offset | The first byte of the variable to
fill with the Fill
Character. The offset is
calculated by the number of bytes
counted from the beginning of the
variable. If you select Dynamic as the Action Input Type, Starting Offset becomes available from the Input tab where you can specify a variable whose value can change at runtime. |
Fill Character | The single byte value used to fill
into the variable. The range value can
be anywhere from 0 to FF (the digits A
- F can be entered in upper or lower
case). This one byte value is entered as 2 digits using 0 - 9 and A - F. There is no need to prefix the one byte value with "0x". |
Bytes to Fill | The number of the bytes to fill. The
default is 8. The range value can be
anywhere from 1 to 2147483647, but can
not be larger than the length of the
BINARY variable. |
Input tab (Static)
If you select Static as the value for
Action Input Type, the Input tab appears
as follows:
Parameter | Description |
---|---|
Binary Buffer | The source binary buffer is entered
in the Value
column. The result of the Binary Fill action is copied from the internal replica of the source binary buffer to the destination binary buffer. If you want to fill a source binary buffer directly with the fill character value specified, then the Output tab Binary Buffer parameter should be set to the same variable as the Input tabBinary Buffer parameter. |
Input tab (Dynamic)
If you select Dynamic as the value for
Action Input Type, the
Input tab appears as follows:
Notice the Input tab provides an extra
parameter:
Parameter | Description |
---|---|
Binary Buffer | The source binary buffer is entered
in the Value
column. The result of the Binary Fill action is copied from the internal replica of the source binary buffer to the destination binary buffer. If you want to fill a source binary buffer directly with the fill character value specified, then the Output tab Binary Buffer parameter should be set to the same variable as the Input tabBinary Buffer parameter. |
Starting
Offset
|
The first byte of the variable to fill with the Fill Character. The offset is calculated by the number of bytes counted from the beginning of the variable. |
Output tab
Parameter | Description |
---|---|
Binary Buffer | Specifies the destination binary
buffer that stores the result of the
Binary Fill
action. The result of the Binary Fill action is copied from the internal replica of the source binary buffer to the destination binary buffer. If you want to fill a source binary buffer directly with the fill character value specified, then the Output tab Binary Buffer parameter should be set to the same variable as the Input tabBinary Buffer parameter. |
Binary Fill example 1
This example describes a trigger that uses the Binary Fill action to move a 1 byte value of 0xFF into the binary variable LocalVariables.bytes_1:
- A new trigger is named and an event
specified.
- Local variables are available for the trigger to
use.
- The Binary Fill action is added to
the trigger, and the parameter values filled in.
Notice that the value for the Fill Character parameter is specified as 2 hexadecimal digits. - From the Input tab, under
Value, the local variable
bytes_1 is assigned to the
action.
Notice the Output tab uses the same local variable bytes_1.
Binary Fill example 2
This example provides a trigger that uses the Binary Fill action to move a 1 byte value of 0x0C into the binary variable LocalVariables.bytes_2, offset 1. Before the move, the value of bytes_2 is 0x4142 which is ASCII AB.
After the move, the value of bytes_2 is 0x410C, since x0C was moved into the position at offset 1.
- A new trigger is named and an event
specified.
- Local variables are available for the trigger to
use.
- The Binary Fill action is added to
the trigger, and the parameter values filled in.
- From the Input tab, under
Value, the local variable
bytes_2 was assigned to the
action.
The input variable and output variable are assigned the same local variable bytes_2.
Binary Fill example 3
This example provides a trigger that uses the Binary Fill action to set the binary variable LocalVariables.bytes_3 to 0xAFAFAF.
- A new trigger is named and an event
specified.
- Local variables are available for the trigger to
use.
- The Binary Fill action is added to
the trigger, and the parameter values filled in.
Notice that Bytes to Fill is set to 3, and the starting offset is 0. This sets all three bytes of the variable to the same value.