3-29
3
and Series PD have 32-bit registers which are accessed as two 16-bit registers.
The value is assumed to have three decimal places.
3.8.7 32-Bit Write
To write a set point of 1250 degrees (which is really 1250.000) to Registers
27 and 28, multiply the setpoint value (SP) by 1000 to get 1,250,000. Add
65536 to negative numbers. This produces the setpoint (SP) we want to send.
To determine the most significant word (MSW) for Register 27, divide the SP
by 2^16 or 65536. To determine the least significant word (LSW) for Register
28, subtract from the SP the result of multiplying the MSW by 2^16 or 65536.
i.e.
SP = 1250 * 1000 = 1250000
MSW = 1250000 / 65536 = 19
LSW = 1250000 - (19 * 65536) = 4816
The 8099 can write each register separately with standard write commands
or both registers can be written together with the Write Block command. Ex-
amples are:
W 27,19
'writes to register 27
W 28,4816
'writes to register 28
WB 27,2,19,4816
'writes to registers 27 and 28
3.8.8 32-Bit Read
To read a 32-bit value, two successive 16-bit registers are read and the user's
program then puts the values together to form the 32-bit result. An example
is reading a process variable from Registers 20 (MSW) and 21 (LSW). The
8099 can be used to read each register individually or to read two successive
registers. The commands are:
R? 20,1
'reads register 20
R? 21,1
'reads register 21
R? 20,2
'reads registers 20 and 21
Both sequences return two numbers to the user. The MSW is returned from
Register 20, the LSW from Register 21. Multiply the MSW by 2^16 or 65536
and add it to the LSW. Divide the result by 1000 to scale it to three decimal
places.
Reading = ((MSW * 65536) + LSW)/1000
Содержание 8099
Страница 20: ...1 16 1 This page intentionally left blank...
Страница 40: ...3 4 3 Figure 3 1 Status Reporting Structure Flash Data Corrupted...
Страница 156: ...Index 6 I This page intentionally left blank...