- Linux MultiMedia Studio Computer Accessories User Manual
Using the Library with Various Languages
MN1278 05.2001
29
6. In the Form_Load module we will tell the COM server which type of controller we want to communicate
with. These means the code will depend on the controller you have. The Consts should be editted to match
your system,
- MintDrive
Private Sub Form_Load()
Const NodeNumber = 10
Const CommPort = 1
Const Baudrate = 57600
myController.setMintDriveLink(NodeNumber, CommPort, Baudrate, True)
End Sub
- NextMove PC
Private Sub Form_Load()
Const NodeNumber = 0
Const Address = &H23C
myController.setNextMovePCLink(NodeNumber, Address)
End Sub
- NextMove PCI
Private Sub Form_Load()
Const NodeNumber = 0
Const CardNumber = 0
myController.setNextMovePCI1Link(NodeNumber, CardNumber)
End Sub
7. Add a command button, and place the following code behind it.
Private Sub Command1_Click()
Dim bState As Boolean
'*********************************************
' Read the state of the drive enable for axis 0
'*********************************************
myController.getDriveEnable 0, bState
'*********************************************
' Toggle the state of the enable
'*********************************************
myController.setDriveEnable 0, (bState = False)
End Sub
8. This code should now work. At this stage, an error handler will be added. Change the getDriveEnable code
to access an axis that does not exist. E.g.
myController.getDriveEnable -1, bState
This should create the following error when run.