Galaniz
Member
I have another simple question. This time it is in regards to Proworx use of signed and unsigned integers in the SUB function. The modicon manual states "
How is it determined if the output will be signed or unsigned. I uploaded a program with a SUB instruction. The top register is 40100 (set to 92 in register editor) middle is register 40108 (set to 275) and the bottom is 40116 (reads 183). The radix is set to decimal for all and when I changed the radix to signed for 40116 it was still positive 183. How would I set the output to read negative or is there something I am missing. I am converting over to compactlogix so if the SUB is actually subtracting and taking the absolute value I would like to figure that out now.
Thanks
Gabriel
The SUB instruction performs a signed or unsigned 16-bit subtraction (value 1 -
value 2) on the top and middle node values, then posts the signed or unsigned
difference in a 4x holding register in the bottom node."value 2) on the top and middle node values, then posts the signed or unsigned
How is it determined if the output will be signed or unsigned. I uploaded a program with a SUB instruction. The top register is 40100 (set to 92 in register editor) middle is register 40108 (set to 275) and the bottom is 40116 (reads 183). The radix is set to decimal for all and when I changed the radix to signed for 40116 it was still positive 183. How would I set the output to read negative or is there something I am missing. I am converting over to compactlogix so if the SUB is actually subtracting and taking the absolute value I would like to figure that out now.
Thanks
Gabriel