Skip to main content

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

Alt text

Parameter description

Interface variableDeclarationData typeDescription
COUNTVar_InputUDINTNumber of elements
INVar_InputAny_elementary without STRINGUsed to populate target range elements
DESTvar_IN_OUTAny_elementary without STRINGThe first element in the target range to which the contents of the original range are to be copied
Function nameReturn valueBOOLReturns 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: alt text

  • ST example is shown in the following code:

r:=FILL(COUNT:=1,IN:=sarr[11],DEST:=darr[5]);