# 16 bit division with 170 AAI 030 00 modicon analog input card

R

#### RagingKozak

I need to divide to numbers so that I can scale my raw values. My problem is that I have to use the above mentioned card and so far I have not been able to find an instruction that will divide one register by another. It always wants create the dividend value from 3xxxx and 3xxxx+1 instead of just 3xxxx. Is there anything I can use or do? Any help would be appreciated.

T

#### Terry

Which programming software are you using? Concept has an I_Scale block The function converts data from 16 bit integer format into REAL floating-point format.

J

#### Jim Dungar

If you are using 984 Ladder Logic the 16 bit (double precison) math always requires 2 consecutive registers (i.e 4xxxx and 4xxxx+1), this causes problems when directly addressing I/O cards.

A solution is to Block Move your analog input value into the second (implied) register of the math function. For example; BLKM 3xxxx to 4xxxx+1, then in the DIV16 block use 4xxxx as the operand

B

#### Brian Cervi

I don't understand your issue. Is it that when you divide one number (one register) by another number (register) your result ends up in two registers?? Well this is natural. How can you divide one number by another and not make provisions for a remainder. Even integer division results in remainders (eg 321 divided by 7). The hardware module (the AIN module) has NOTHING to do with the math in the software. Proworx software provides different math functions than concept but both provide the ability to "throw away" the remainder and use the absolute value.

Perhaps you could explain your problem better.

P

#### Pierre

The best thing to do is to convert the value to real and scale them using real operation. Integer division is a real headache (except for easy stuff like divide by 2,4,8 etc...). Operating on real values will increase the scan time on slower PLC without mathematical coprocessors eg Quantum 113-03. And to alleviate this, you can refresh and scale analogs in a round robbins fashion instead of all of them in one scan, or better get a PLC with a coproc.

good luck.