Applications 5-9
MN1917
5.5.5
Adding program lines (code)
Each command button requires some Visual Basic program code, so that when the user clicks the button, a function
will be performed.
1. Right-click on the Init button, and choose View Code.
This will display the underlying code for the button.
The lines “
Private Sub btnInit_Click
” and
“
End Sub
” are essential and must not be deleted. All
code for a button must be entered between these two
lines.
2. Type the lines:
MintController1.setFlexPlusDrive2Link 2, 1, 57600, True
MintController1.getAAABuild lBuild
MintController1.doCancel 0
MintController1.setDriveEnable 0, True
3. Using the left drop down box at the top of the code
window, select another button.
4. In this way, code can be entered for each button. However, to save time, the complete form, buttons and code
have already been created in the file
VBA.xls
. See the next section.
Summary of Contents for Flex+DriveII
Page 1: ...Flex DriveII Demonstration Unit SERVO DRIVE Operating Manual 03 02 MN1917...
Page 2: ......
Page 6: ...1 2 General Information MN1917...
Page 8: ...2 2 Introduction MN1917...
Page 22: ...4 8 Basic Demonstrations MN1917...
Page 34: ...6 2 Specifications MN1917...
Page 40: ...Index MN1917...
Page 41: ......