Timing and Programming Considerations for Onboard Motion Programming
Hardware: Motion Control
Problem: I understand that for an onboard motion application that the controller is required to provide a certain amount of time for my application. However, the program does not run deterministically. Is this expected behavior?
Solution: Yes. The following 3 characteristics of NI-Motion onboard programs explain how they work and why they are not deterministic:
- You only specify the minimum garunteed time slice that will be given to your onboard program. If the motion board does not have a lot of other tasks to complete during its program loop, then more time will be alotted to your onboard program. For example, if you specified a minimum onboard program time of 2ms, your actual alotted time might actually be 34ms or 21ms.
- There is no way to tell the motion board how many iterations of your program will run during each program loop. So, if you program takes 1ms to run and you were alotted 10 ms of program loop time, then your program will run 10 times. If the next program loop, you were only alotted 5 ms of onboard programming time, your program will run 5 times. As mentioned in the first bullet, you cannot specifiy how much time will be alotted each program loop, you can only specify a minimum amount of time to be alotted, this makes it impossible to know how many times your program will run each program loop.
- You cannot specify at what time during the program loop that your onboard program will run (in other words, the phase of your alotted time). For example, one onboard programming time slice might occur during the first 10 ms of the program loop, while the next 10 ms might occur in the middle (or at the end) of the program loop.
Onboard programs are usefull when:
- No host interaction is needed.
- A program needs to run independently of what the host is doing.
- Non-vital motion processing tasks need to happen in the background.
- A program needs to be run immediately on startup of the motion controller and you do not want or need host VI interaction.
For greater control and determinism for the motion control system, National Instruments offers the LabVIEW Real-Time (RT) module motion control system, which consists of a PXI chassis, PXI motion controller or controllers, LabVIEW RT, and NI-Motion driver software.
More information about onboard programming can be found in the NI-Motion Users Manual that installs with the driver. You can also find this information in the related links below.
Related Links: Product Manuals: NI-Motion User Manual
Attachments:
Report Date: 04/18/2007
Last Updated: 05/02/2007
Document ID: 48HGMS4M