Mitsubishi Electronics FXCPU Welding System User Manual


 
5.8 Standard Character String Functions
182
FXCPU Structured Programming Manual
(Application Functions)
Explanation of function and operation
1) This function extracts specified number of characters from an arbitrary position of a character string
stored in devices specified in , and outputs the obtained data to devices specified in . The value
specified in specifies the number of characters to be extracted.
The value specified in specifies the head character position of characters to be extracted.
Example: When "5" is specified in and
2) A character string (data) stored in devices specified in indicates the data until "00H" is detected first
in units of byte in the range starting from the specified device.
3) When the number of characters to be extracted specified in is "0", this function does not execute
processing.
4) When the number of characters to be extracted specified in is "-1", this function outputs the final
character of a character string specified in to devices specified in .
Cautions
1) Use the function having "_E" in its name to connect a bus.
2) When handling character string data in structured programs, you cannot specify 16-bit devices directly,
different from simple projects. Use labels when handling character string data.
Use global labels when specifying labels.
Error
An operation error occurs in the following cases. The error flag M8067 turns ON, and D8067 stores the error
code.
1) When "00H" is not set in the corresponding device range after the device specified in
(Error code: K6706)
2) When the head character position specified in exceeds the number of characters of a character
string stored in devices specified in
(Error code: K6706)
3) When the number of characters specified in exceeds the range of devices specified in
(Error code: K6706)
4) When the number of devices after the device number specified in is smaller than the number of
devices required for storing an extracted character string
(In this case, "00H" cannot be stored after all character strings and the final character.)
(Error code: K6706)
5) When the value specified in is negative
(Error code: K6706)
6) When the value specified in is "-2" or less
(Error code: K6706)
7) When the value specified in exceeds the number of characters of a character string stored in
devices specified in
(Error code: K6706)
s d
n1
n2
n1 n2
"ABCDEF12345"
Head character
position of a
character string to
be extracted
= 5th character
n2
n1
"EF123"
42H(B)
41H(A)
43H(C)
31H(1)
44H(D)
00H
34H(4)
32H(2)
46H(F)
45H(E)
33H(3)
35H(5)
High-order byte Low-order byte
1st word
2nd word
3rd word
4th word
1st word
2nd word
3rd word
5th word
Number of characters to
be extracted = 5
6th word
46H(F)
45H(E)
31H(1)
32H(2)
00H
33H(3)
High-order byte Low-order byte
s
n1
n1
s d
s
n2
s
n1 d
d
n2
n1
n1
s