By threading the timer routine, you separate it from the main process which would be your CNC application. Isolate the timer functions in another form and create a separate process for that form. This is called multi threading, and it allows the processor to give that thread the attention needed for this process (your CNC application).
Lets use people as an example. Picture yourself standing in the middle of 6 people, who are giving you command. 5 of those people represent a diffrent process running on the computer, and the 6th person is your CNC application. You as the processor turns to each person in your circle and asks for instructions. As each person gives to an instruction to you, you complete it and turn to the next person in the circle. When you get an instruction from the CNC person, you execute it and move on to the next person.
So if the CNC person, asks you for the current system time, you give it to him or her, and then move on. By the time you get back to the CNC person, the process as a whole has actually lost ns(nano seconds). Lets say the CNC hears the time from you and it is time to move a Motor, the next command he will give you is to move the motor. You as the CPU comply and move onto the next person (process). When you get back to the CNC person again, he has a list of commands for you but is limited to only one command at time. This limit is your timing issue.
By creating another person(process) and call her Timer Girl. You will actually give your CNC application more face to face time, and therefore speed up your application. Because now you have two people working on your CNC application.
It has been a long time, since I have heard from anyone on this project, if you would like more help, can you update the Zip file and post it here please
Carl Boudreau
Developer / Architect
VB.Net , ASP.Net, VB6, ASP, MSSQL, mySQL - and more...
612-220-8720
cboudrea@pressenter.com