Using multi-encoder function you can do this process easily. Please read manual.