I am trying to measure position using a cFP-QUAD-510. One problem is that there is no way to programmatically set the counter to a position. Another is that the counter sets itself to 2^32 counts when it goes from zero toward the "negative" direction then counts down. That is a problem when doing rotational position. Does anyone have a solution to this problem? I also have a problem finding the position using the given count because resetting after one rotation in the "negative" direction puts me bak to zero and then directly to 2^32 on the next count. My counts per revolution are 516131. So as you can probably tell I cannot divide the entire count evenly into revolutions either.
Instead of trying to set a counter to a particular value, store your value in your program and add or subtract your offset value each time you want to read the counter.
The counters are all 16 bit according to the manual and only store the counts of 0-65535, combining two registers gives a 32 bit value. Basically a U32. If you want it to have a negative sign, try reading the value as U32 and subtract 2147483648. Or try typecasting the U32 to an I32.