Hello,
I am building an application that requires trackig the raw counts from a quadrature encoder connected to a NI USB-6212. In order to count each rising and falling edge of both channel A and channel B, I have configured a DAQmx Linear Encoder Channel for 4X decoding with the units set to ticks. In order to prevent the counter from rolling over when the ticks become negative, I convert the U32 value from DAQmx Read to I32. So far this all works as expected. I would additionaly leik to retain to position of the encoder if the VI is stopped but remains in memory. For this reason I wire the value of the raw counts to a shift register which is read into the initial position input of the DAQmx Create Channel VI. For some reason, the DAQmx Create Channel VI quadruples whatever value is wired to the inital position input. I solve this by deviding the previous counts by 4 before writing to initial position. However, the problem occours that if the value of the previous count was not an even multiple of 4, the inital position must be rounded to the nearest integer, causing the count to jump when restarting the VI. How can I reset the inital postition to the exact value of the encoder at the end of the previous iteration?