FC6A S
ERIES
MICROS
MART
L
ADDER
P
ROGRAMMING
M
ANUAL
FC9Y-B1726
26-33
26: S
CRIPT
Converting -12345 (when the data type is I (integer))
Converting 1234567890 (when the data type is D (double word))
Converting -1234567890 (when the data type is L (long))
Example 7.21
Convert string to decimal
Script
Operation Description
Converts the stored string starting at D0200 to a decimal and stores the result in D0100.
The number of digits that can be converted is the maximum number of digits for each data type with added sign.
If the string to convert contains a NULL or characters that cannot be converted to numeric values, the string is converted up to
that character.
Notes:
• This function can be used with data types W (word), I (integer), D (double word), and L (long).
• The NULL terminating character (0x00) is added to the end of the string.
Device
Stored Value
Device
Stored Value
Upper Byte
Lower Byte
D0200
-12345
D0100
'-' = 0x2D
'1' = 0x31
D0101
'2' = 0x32
'3' = 0x33
D0102
'4' = 0x34
'5' = 0x35
D0103
0x00
0x00
Terminating character
Device
Stored Value
Device
Stored Value
Upper Byte
Lower Byte
D0200
1234567890
D0100
'1' = 0x31
'2' = 0x32
D0201
D0101
'3' = 0x33
'4' = 0x34
D0102
'5' = 0x35
'6' = 0x36
D0103
'7' = 0x37
'8' = 0x38
D0104
'9' = 0x39
'0' = 0x30
D0105
0x00
0x00
Terminating character
Device
Stored Value
Device
Stored Value
Upper Byte
Lower Byte
D0200
-1234567890
D0100
'-' = 0x2D
'1' = 0x31
D0201
D0101
'2' = 0x32
'3' = 0x33
D0102
'4' = 0x34
'5' = 0x35
D0103
'6' = 0x36
'7' = 0x37
D0104
'8' = 0x38
'9' = 0x39
D0105
'0' = 0x30
0x00
Terminating character
[D0100] = ASCII2DEC([D0200]);
Summary of Contents for MICROSmart FC6A Series
Page 1: ...B 1726 7 FC6A SERIES Ladder Programming Manual ...
Page 8: ...Preface 7 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Page 32: ...1 OPERATION BASICS 1 20 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Page 96: ...3 INSTRUCTIONS REFERENCE 3 18 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Page 130: ...4 BASIC INSTRUCTIONS 4 34 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Page 192: ...9 SHIFT ROTATE INSTRUCTIONS 9 12 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Page 272: ...12 DISPLAY INSTRUCTIONS 12 24 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Page 284: ...14 REFRESH INSTRUCTIONS 14 6 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Page 502: ...25 DATA LOG INSTRUCTIONS 25 22 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Page 546: ...26 SCRIPT 26 44 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Page 598: ...APPENDIX A 14 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...