IDEC MICROSmart FC6A Series Ladder Programming Manual page 540

Automation organizer windldr
Hide thumbs Also See for MICROSmart FC6A Series:
Table of Contents

Advertisement

26: S
CRIPT
Example 7.30 Count a string
Script
[D0100] = STRLEN([D0200]);
Operation Description
Finds the length (character count) of the string starting from D0200 and stores the result in D0100.
Note: The NULL terminating character (0x00) is the end of the string. (The terminating character is not included in the string length.)
Device
Stored Value
'A' = 0x41
Upper Byte
D0200
'B' = 0x42
Lower Byte
'C' = 0x43
Upper Byte
D0201
'D' = 0x44
Lower Byte
'E' = 0x45
Upper Byte
D0202
'F' = 0x46
Lower Byte
'G' = 0x47
Upper Byte
D0203
0x00
Lower Byte
Device
Stored Value
'A' = 0x41
Upper Byte
D0200
'B' = 0x42
Lower Byte
'C' = 0x43
Upper Byte
D0201
0x00
Lower Byte
'E' = 0x45
Upper Byte
D0202
'F' = 0x46
Lower Byte
'G' = 0x47
Upper Byte
D0203
0x00
Lower Byte
Example 7.31 Concatenate strings
Script
STRCAT([D0100], [D0200]);
Operation Description
Appends the string starting from D0200 to the string starting from D0100.
Note: The NULL terminating character (0x00) is the end of the string. (The terminating character is not included in the string length.)
Device
Stored Value
'A' = 0x41
Upper Byte
D0100
'B' = 0x42
Lower Byte
'C' = 0x43
Upper Byte
D0101
0x00
Lower Byte
Device
Stored Value
'D' = 0x44
Upper Byte
D0200
'E' = 0x45
Lower Byte
'F' = 0x46
Upper Byte
D0201
'G' = 0x47
Lower Byte
0x00
Upper Byte
D0202
0x00
Lower Byte
26-38
Character count
Terminating character
Character count
Terminating character
Terminating
Concatenate
character
Terminating character
FC6A S
MICROS
L
ERIES
MART
Device
Stored Value
D0100
7
Device
Stored Value
D0100
3
Device
Stored Value
'A' = 0x41
Upper Byte
D0100
'B' = 0x42
Lower Byte
'C' = 0x43
Upper Byte
D0101
'D' = 0x44
Lower Byte
'E' = 0x45
Upper Byte
D0102
'F' = 0x46
Lower Byte
'G' = 0x47
Upper Byte
D0103
0x00
Lower Byte
P
M
ADDER
ROGRAMMING
ANUAL
Terminating character
FC9Y-B1726

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents