3. Instructions
1096
CS/CJ/NSJ Series Instructions Reference Manual (W474)
Function
LENS$(650) calculates the number of characters from the
first word of the text string, designated by S, until the NUL
code (00 hex), including the NUL code itself, and outputs
the result to D as binary data. If there is a NUL at the
beginning of the text string, the result that is calculated will
be 0000 hex.
LENS$(650) can be processed in the background. Refer to the SYSMAC CS/CJ/NSJ Series PLC
Programming Manual (W394) or the CJ2 CPU Unit Software Operation Manual (W473) for details.
Example Programming
In this example, LENS$(650) is used to calculate the number of characters and output the result.
1
3
5
2
4
→
41
43
45
42
44
00
D: D200
D100
D200
S: D100
D101
D102
Text string: ABCDE