! float!=integer
Float are limited about number of digits so having a too long word will flush detailed info....VS a double integer that will keep them...
In my world integer and float aren't equal ???
! float!=integer
In my world integer and float aren't equal ???
Float are limited about number of digits so having a too long word will flush detailed info....VS a double integer that will keep them...
RSLogix500 Help said:Math Overflow Selected S:2/14
Set this bit to 1 when you intend to use 32-bit addition and subtraction.
When this bit is set and the result of an ADD, SUB, MUL, or DIV instruction cannot be represented in the destination address (underflow or overflow): the overflow bit is set S:0/1, the overflow trap bit is set S:5/0, and the destination address contains the unsigned truncated least significant 16 bits of the result.
When this bit is reset (default) and the result of an ADD, SUB, MUL, or DIV instruction cannot be represented in the destination address (underflow or overflow): the overflow bit is set S:0/1, the overflow trap bit is set S:5/0, and the destination address contains 32767 if the result is positive or -32768 if the result is negative.
Overflow Trap S:5/0
When this bit is set (1) by the controller, it indicates that a mathematical overflow has occurred in the ladder program.
Carry S:0/0
This bit is set (1) by the controller if a mathematical carry or borrow is generated. Otherwise the bit remains cleared.
Overflow S:0/1
This bit is set (1) by the controller when the result of a mathematical operation does not fit in its destination. Otherwise the bit remains cleared.
Zero Bit S:0/2
This bit is set (1) by the controller when the result of math or data handling instructions is zero.
Sign Bit S:0/3
This bit is set (1) by the controller when the result of math or data handling instructions is negative.
Math Register (32 bit ) S:14-S:13
Use this double register to produce 32-bit signed divide and multiply operations, precision divide or double divide operations, and 5-digit BCD conversions. These two words are used in conjunction with the MUL, DIV, DDV, FRD, and TOD math instruction. The math register value is assessed upon execution of the instruction and remains valid until the next MUL, DIV, DDV, FRD, or TOD instruction is executed in the user program.
Look again.
maybe it's just me.. but I take the simple way.
I use 2 or even 3 integer files for larger numbers.
add 1 to item1..when reaches 999 increment item2 - zero item1
add 1 to item3 when item2 reaches 999 - zero item2
zero item3,item2, item1 when item3 it reaches it goal
gives me 3 integer files. item3,item2,item1 (999,999,999)
just gotta display it right
keep adding integers to get to the largest digit you want.
now this makes calculations with that number kinda odd. btw. but it can be done.