11 - 97 11 - 97
MELSEC-Q
11 INSTRUCTIONS AND FUNCTIONS
Program Example
10 ' Searches for the specified characters
20 A$="AD51HMitsubishiPLC"
30 A=INSTR(2,A$,"PLC")
:
' Searches for PLC from a character string
40 PRINT "A$=";A$
:
' Displays the character string
50 PRINT "PLC is the ";A;"th character"
:
' Displays the position where 'PLC' was
detected
60 END
RUN
A$=AD51HMitsubishiPLC
PLC is the 10th character
OK
REMARK
See the KINSTR, KLEN, and LEN functions.