Text middle MID
Dest = Count characters from Position.
Text'LOT-0098-B'
From5
Count4
Dest'0098'
| Tag | After two scans |
|---|---|
| LotCode | 'LOT-0098-B' |
| LotLen | 4 |
| LotNum | '0098' |
| LotPos | 5 |
How it's used
Use MID to read a field from the middle of a code.
Text'LOT-0098-B'
From
Count
Dest'0098'
| Tag | Value |
|---|---|
| LotCode | 'LOT-0098-B' |
| LotNum | '0098' |
4 characters from position 5: 0098.
Operands
| Operand | Data type | Read or write |
|---|---|---|
| Source | STRING or a number | Reads |
| Count | DINT or a number | Reads |
| Position | DINT or a number | Reads |
| Dest | STRING | Writes |
Common mistakes
- Starting positions at zeroString positions start at 1. Check the count and range against the source length.