-

MID_WSTRING

Type Function
Description Extracts a substring from the middle of a string connected to the input IN. L characters of IN are extracted, beginning at character position P.
Notes
  • P cannot be 0. The first position in a string is 1.
  • It is not possible to use the same string as input and output string. In this case there should be used an intermediate variable at the output. Then this intermediate variable has to be assigned to the input variable.
  • When the string output is longer than 80 characters and the FU/FB is directly connected to another FU/FB, temporary string variables of size 80 are used. Calculation/usage will fail. Use an intermediate local variable in-between.
  • Problem for calculation of position and length: Characters in WSTRING can have a size of 2 bytes or 4 bytes. Due to this, there may be calculation problems on 4-byte containing character STRINGs with 2-byte oriented position and length.
Parameters Inputs

IN

L

P

Output

OUT
Error behavior Error behavior
Additional information EN/ENO behavior