Text middle MID

Dest = Count characters from Position.

TagAfter two scans
LotCode'LOT-0098-B'
LotLen4
LotNum'0098'
LotPos5

How it's used

Use MID to read a field from the middle of a code.

TagValue
LotCode'LOT-0098-B'
LotNum'0098'

4 characters from position 5: 0098.

Operands

OperandData typeRead or write
SourceSTRING or a numberReads
CountDINT or a numberReads
PositionDINT or a numberReads
DestSTRINGWrites

Common mistakes

  • Starting positions at zeroString positions start at 1. Check the count and range against the source length.