4 - 1 4 - 1
MELSEC-Q
4 THE EXCHANGE BETWEEN THE PLC AND BUFFER MEMORY
4
4 THE EXCHANGE BETWEEN THE PLC AND BUFFER MEMORY
4.1 PLC Numeric Data and BASIC Numeric Data
Data handled within the PLC are generally integers. It handles integers (not including
decimals) between –32768 and 32767 for one word (16 bits) and –2147483648
through 2149483647 for two words (32 bits).
However, data handled within BASIC are generally real numbers and integers. It
handles real numbers from (10
-38
through 10
38
) integers from –32768 through 32767
(not including decimals).
As shown above, data is handled differently between the PLC and BASIC. Therefore, it
is necessary to perform data conversion between real numbers and integers to
communicate with the PLC.
• 1-word processing
Real
Number
Integer
CINT function
Real number
Real Number
Integer
Integer
CDBL/CSNG Function
BASIC
BASIC
PLC CPU
PLC CPU
PLC CPU
BASIC
• 2-word processing
CISN/CIDB
function
CSNI/CDBI
function
Integer x 2
(Saved in an array)
Real number
BASIC
The 2-word integer
value is divided into
upper 16 bit and
lower 16 bit.
The two 1-word integer
values are placed together
as upper level and lower
level and treated as
a 2-word integer.
2-word
integer value
PLC
Содержание A1SD51S
Страница 183: ...11 13 11 13 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS RUN Before swap A 0 H924 A 1 H1159 After swap A 0 H1159 A 1 H924 OK...
Страница 331: ...11 161 11 161 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the CON ON OFF STOP and ZOPEN functions and Section 7 4...
Страница 557: ...11 387 11 387 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the CHR SPACE and SPC functions...
Страница 629: ...11 459 11 459 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the ZOPEN ZSEND and ZCNTL instructions and Section 7 3 4...
Страница 645: ...11 475 11 475 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the ZEVENT ZSIGNAL and DEF ZEVENT instructions...