Fill array FILL

Writes Value into Count elements of an array line.

Value, through Repeat Count times, to Destination slice in the project.ValueRepeat Count timesDestination slice

How it works

While the rung is true, writes Value into Count elements of the Destination array, starting at Dest start. Value has the array's type. A Count of 0 writes nothing. A negative Count, or a range past the end of the array, is a fault and writes nothing at all.

Operands

OperandData typeRead or write
ValueBOOL, DINT, REAL or a numberReads
DestArray of BOOL, DINT, REALWrites
Dest startDINT or a numberReads
CountDINT or a numberReads

Common mistakes

  • Counting the last element as SizeElements count from 0, so an array of 10 has 0 to 9. Start 5 with Count 5 fills 5 to 9; Count 6 is a fault.