Hello Ramkumar,
Thank you for contacting National Instruments. Onboard programs are an efficient way to add more determinism to your application, but in no way will they speed up the application. To get started with onboard programming I would recommend looking at the Onboard Programming Tutorial:
http://zone.ni.com/devzone/conceptd.nsf/webmain/f03a6de53c744c5886256857005ecdbe?OpenDocument
This tutorial also includes several examples that will show you different applications with onboard programming. The output of any vi used in an onboard program is available to that program and it is just a matter of connecting the wires. If you are interested in passing user input to onboard programs then you will need to use Onboard Variables to pass information from your windows application to the onboard program. For details about Onboard Variables refer to the NI-Motion VI Help installed with the NI-Motion drivers under "Start>>Programs>>National Instruments>>NI-Motion>>Documentation>>NI-Motion VI Help". On the search tab search for the key words "Onboard Variables". And, You can use Stop Motion.vi in your onboard program.
For the second part of your question, you will not be able to setup the feedback for axis 2 as the secondary feedback of axis 1. It seems like you are using analog feedback for your motors, I have also included a link to a tutorial on using analog feedback:
http://zone.ni.com/devzone/conceptd.nsf/webmain/83c7fa75780a8b57862568470000650c?OpenDocument
Hope this helps you out. Have a great day!
Regards,
Nipun Mathur
Applications Engineer
National Instruments