7.11.2 FILL
Function
FILL is called filling array elements and implements filling assignment to the specified range of the target array
LD graphics
Parameter description
| Interface variable | Declaration | Data type | Description |
|---|---|---|---|
| COUNT | Var_Input | UDINT | Number of elements |
| IN | Var_Input | Any_elementary without STRING | Used to populate target range elements |
| DEST | var_IN_OUT | Any_elementary without STRING | The first element in the target range to which the contents of the original range are to be copied |
| Function name | Return value | BOOL | Returns the instruction status, TRUE means the instruction is executed correctly, FALSE means the instruction execution error |
warning
- This command can only be executed when the data types of the source variable (IN) and the target variable (DEST) are the same or support implicit conversion, and the DEST actual parameter can only be an array member variable
Corresponding syntax
- COUNT: Number of target elements
- IN: fill element
- DEST: Fill to the first element in the target range
Example
-
LD sample pictures are shown below:

-
ST example is shown in the following code:
r:=FILL(COUNT:=1,IN:=sarr[11],DEST:=darr[5]);