- Linux MultiMedia Studio Computer Accessories User Manual

PC Based Motion Control
MN1278 05.2001
37
Functions called from the host fall into two categories. Those functions that replicate Mint keywords are known
as Mint Motion Library calls (MML) and those functions which are general communications functions are known
as Mint Interface Library calls (MIL).
Example:
The following code is a Visual Basic extract showing a host application set up a move on a NextMove BX. The
TMintController object has been added to the form and named ‘myController’.
‘ Set up some data
Dim axis0(1) As Integer
Dim isIdle As Boolean
axis0 = 0
' Create handle to NextMove: node, comm port, baud rate, open
myController.setNextMoveBXLink 2, 1, 19200, 1
‘ Set move parameters on axis 0
myController.setSpeed 0, 40!
myController.setAccel 0, 400!
myController.setDecel 0, 400!
myController.doReset 0
‘ Load the move and start it
myController.setMoveR 0, 100
myController.doGo 1, axis0
‘ Wait until move is completed
Do
myController.getIdle 0, isIdle
Loop Until isIdle
4.1 Limitations of PC based applications
There are a number of event handlers available in Mint such as #ONERROR. Only NextMove PCI supports
events to the host. This means that event handlers can be installed in the host application that are called directly
when a Mint event occurs. For other controllers, the event handlers must be placed in a Mint program.
Commands called from the host execute slower than if called directly on the controller. See Appendix 2 for
example timings.
The host functions take priority over the Mint program running on the controller. If MML functions are called
continuously from the host, this will slow the execution speed of the Mint program.