4

A common application is to scale analog input values with a MUL operation followed by a DIV and possibly an ADD operation. With a range up to 32000, using a MUL INT will overflow. Using an %AI value for a MUL DINT will also not work as the 32-bit I1 will combine 2 analog inputs at the same time. You must move the analog input to the low word of a double register, then test the sign and set the second register to 0 if positive or –1 if it was negative. Use the double register with the MUL DINT for a 32 product for the following DIV function.

For example, the following logic could be used to scale a +/–10 volt input %AI1 to +/– 25000 engineering units in %R5.

 

_____

 

_____

 

_____

ALW_ON

 

 

——] [——— MOVE————————————————— MOVE————————————————— LT_

——————————<+>

 

 

 

 

INT

 

INT

 

INT

 

 

 

%AI0001–IN

Q–%R0001

CONST –IN

Q–%R0002 %R0001 –I1

Q-

 

LEN

 

+00000 LEN

 

 

00001

 

00001

 

 

_____

 

_____

CONST –I2

 

 

 

 

 

 

+00000

_____

 

 

 

 

 

 

 

 

 

 

_____

 

 

 

 

 

 

 

 

 

 

 

 

 

<+>—————MOVE_–

 

 

 

 

 

 

 

 

 

 

 

 

 

 

INT

 

 

 

 

 

 

 

 

 

 

 

 

 

CONST –IN

Q–%R0002

 

 

 

 

 

–00001 LEN

 

 

 

 

 

 

 

00001

 

 

 

 

 

 

 

_____

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

_____

 

 

 

_____

ALW_ON

 

 

 

 

——] [——————————— MUL_————————————————————————————————— DIV_–

 

 

 

 

 

 

 

 

DINT

 

 

DINT

 

 

 

 

 

 

%R0001 –I1 Q–%R0003

 

%R0003 –I1

Q–%R0005

 

 

 

 

 

 

CONST –I2

 

CONST –I2

+0000025000

_____

 

+0000032000

_____

 

 

 

 

 

 

 

 

 

4-30

Series 90-30/20/Micro Programmable Controllers Reference Manual–September 1998

GFK-0467K

Page 111
Image 111
GE 90-30/20/Micro manual Alwon