IDEC MICROSmart FC6A Series Ladder Programming Manual page 535

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

Advertisement

Converting -12345 (when the data type is I (integer))
Device
Stored Value
D0200
Converting 1234567890 (when the data type is D (double word))
Device
Stored Value
D0200
1234567890
D0201
Converting -1234567890 (when the data type is L (long))
Device
Stored Value
D0200
-1234567890
D0201
Example 7.21 Convert string to decimal
Script
[D0100] = ASCII2DEC([D0200]);
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.
-12345
FC6A S
MICROS
ERIES
MART
Stored Value
Device
Upper Byte
D0100
'-' = 0x2D
D0101
'2' = 0x32
D0102
'4' = 0x34
D0103
0x00
Terminating character
Stored Value
Device
Upper Byte
D0100
'1' = 0x31
D0101
'3' = 0x33
D0102
'5' = 0x35
D0103
'7' = 0x37
D0104
'9' = 0x39
D0105
0x00
Terminating character
Stored Value
Device
Upper Byte
D0100
'-' = 0x2D
D0101
'2' = 0x32
D0102
'4' = 0x34
D0103
'6' = 0x36
D0104
'8' = 0x38
D0105
'0' = 0x30
L
P
M
ADDER
ROGRAMMING
ANUAL
Lower Byte
'1' = 0x31
'3' = 0x33
'5' = 0x35
0x00
Lower Byte
'2' = 0x32
'4' = 0x34
'6' = 0x36
'8' = 0x38
'0' = 0x30
0x00
Lower Byte
'1' = 0x31
'3' = 0x33
'5' = 0x35
'7' = 0x37
'9' = 0x39
0x00
Terminating character
FC9Y-B1726
26: S
CRIPT
26-33

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents