text: <s>[INST] 1756-HSC Continuous counting... I am using an encoder on a process line and would like to accumulate length of material. I have an encoder wired to a 1756-HSC and am using it to measure cut lengths.I have an application program that runs in a periodic task of 10 ms. The PresentValue[0] is the input to a pulse multiplier:Mode = 1 RelativeWordsize = 32multiplier = 1000000 Output goes to InPlus on an UpDnCounter block. It works fine and is calibrated accurately except when the presentvalue[0] rolls over. When the rollover occurs I get a negative number on Pmul.Out and subtracts from the updown counter. How can I work around this? Thanks for the Help! dgross@nacsi.com [/INST] Answer to your issue is in this statement, taken from PMUL online help: When applying this block, it is important to note that the feedback data should not change by more than ½ the word size from one scan to the next, if rotational direction is to be properly differentiated. In the example above, if the feedback device is moving in a clockwise direction such that at scan ‘A’ it reads 0 and then scan ‘B’ it reads –2000, actual change in position is equivalent to +2096 counts in the clockwise direction. However, since these two values are more than ½ the words size, (or more than ½ the rotation of the physical device,) the PMUL instruction calculates that the feedback device rotated in the opposite direction and returns a value of –2000 instead of +2096. So, which is the count range of your HSC ?You have to change the WordSize in PMUL to remain in the right range, following the examples below. Here some examples: count range 65535 to -65536 ---- set WordSize = 17 bitcount range 2047 to -2048 ---- set WordSize = 12 bitcount range 255 to -256 ---- set WordSize = 9 bit Informations are in Logix5000 Process Control & Drives Instructions Reference Manual pages 261-262 Hope this helps… - fuzzy logic \\n </s>