
26: S
CRIPT
26-32
FC6A S
ERIES
MICROS
MART
L
ADDER
P
ROGRAMMING
M
ANUAL
FC9Y-B1726
Data type conversions
Example 7.16
Convert BCD to binary
Script
Operation Description
Converts the BCD value in D0100 to a binary value and stores it in D0200.
For example, if the BCD value 10 (16 as a binary value) is stored in D0100, 10 (binary value) is stored in D0200.
Example 7.17
Convert binary to BCD
Script
Operation Description
Converts the binary value in D0100 to a BCD value and stores it in D0200.
For example, if the binary value 16 (10 as a BCD value) is stored in D0100, 16 (BCD value) is stored in D0200.
Example 7.18
Convert float to binary
Script
Operation Description
Converts the float value in D0100 to a binary value and stores it in D0200.
For example, if the data type F (float) 1234.0 (0x449A4000 as a binary value) is stored in D0100, 1234 (binary value) is stored in
D0200. If the data type F (float) 1234.56 (0x449A51EC as a binary value) is stored in D0100, the value after the decimal point is
truncated and 1234 (binary value) is stored in D0200.
Example 7.19
Convert binary to float
Script
Operation Description
Converts the binary value in D0100 to a float value and stores it in D0200.
For example, if the binary value 1234 is stored in D0100, the float value 1234.0 (0x449A4000 as a binary value) is stored in D0200.
Example 7.20
Convert decimal to string
Script
Operation Description
Converts the decimal numeric value in D0200 to a string and stores it in order with D0100 as the starting address.
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.
Converting 1234 (when the data type is W (word))
[D0200] = BCD2BIN([D0100]);
[D0200] = BIN2BCD([D0100]);
[D0200] = FLOAT2BIN([D0100]);
[D0200] = BIN2FLOAT([D0100]);
DEC2ASCII([D0100], [D0200]);
Device
Stored Value
Device
Stored Value
Upper Byte
Lower Byte
D0200
1234
D0100
'1' = 0x31
'2' = 0x32
D0101
'3' = 0x33
'4' = 0x34
D0102
0x00
0x00
Terminating character
Содержание MICROSmart FC6A Series
Страница 1: ...B 1726 7 FC6A SERIES Ladder Programming Manual ...
Страница 8: ...Preface 7 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Страница 32: ...1 OPERATION BASICS 1 20 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Страница 96: ...3 INSTRUCTIONS REFERENCE 3 18 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Страница 130: ...4 BASIC INSTRUCTIONS 4 34 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Страница 158: ...6 DATA COMPARISON INSTRUCTIONS 6 10 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Страница 192: ...9 SHIFT ROTATE INSTRUCTIONS 9 12 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Страница 216: ...10 DATA CONVERSION INSTRUCTIONS 10 24 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Страница 248: ...11 WEEK PROGRAMMER INSTRUCTIONS 11 32 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Страница 272: ...12 DISPLAY INSTRUCTIONS 12 24 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Страница 284: ...14 REFRESH INSTRUCTIONS 14 6 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Страница 288: ...15 INTERRUPT CONTROL INSTRUCTIONS 15 4 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Страница 294: ...16 COORDINATE CONVERSION INSTRUCTIONS 16 6 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Страница 374: ...18 PULSE OUTPUT INSTRUCTIONS 18 78 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 Setting ...
Страница 450: ...20 DUAL TEACHING TIMER INSTRUCTIONS 20 4 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Страница 502: ...25 DATA LOG INSTRUCTIONS 25 22 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Страница 546: ...26 SCRIPT 26 44 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Страница 574: ...27 FLOW CALCULATION INSTRUCTIONS 27 28 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Страница 583: ...FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 28 9 28 USER DEFINED MACRO INSTRUCTION ...
Страница 584: ...28 USER DEFINED MACRO INSTRUCTION 28 10 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Страница 598: ...APPENDIX A 14 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...