You have a very complicated model in the code. I did not understand them all.
However, I found some syntax error in the code.
1. xs,ys should be an array. So I would suggest you put [npt] in the dimension field for those variables.
2. I add xsp,ysp to display value in the textfield
3. I also modified the action in the Pause22 VIEW element.
I modified your code, however, I do not know how to change those parameters/values. ys always give me 1.
Please check out the modified code.