1 800 642-6446 Toll-free
1 585 657-6151 In New York
VelmexControls
Velmex
|
BiSlide
|
XSlide
Download
Download Driver
How To
Add To Your Project
Call From Your Project
Driver Functions
LoadDriver
ReleaseDriver
DriverTerminalShowState
PortOpen
PortClose
PortIsOpen
PortSendCommands
PortReadReply
PortCountChars
PortSearchForChars
PortClear
PortRemoveChars
MotorPosition
PortWaitForChar
PortWaitForCharWithMotorPosition
DriverResetFunctions
Example Code
Examples
VXM Driver Documentation - Visual Basic .NET 2003 - Examples
All functions assume you followed directions in the "How To Add To Your Project"
Examples
Minimal Code
WITHOUT
Wait
Below is the MINIMUM amount of code to make a motor move.
Public Function App_Path() As String
Return System.AppDomain.CurrentDomain.BaseDirectory()
End Function
Private Vxm As ClsVxmDriverVbNet2003
Private DriverLoaded As Integer
Public AppPath As String
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Vxm = New ClsVxmDriverVbNet2003 'Set the class wrapper to use driver
AppPath = App_Path()
Dim DriverLoaded As Long
DriverLoaded = Vxm.LoadDriver(AppPath + "Driver\VxmDriver.dll")
End Sub
Private Sub Form1_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
Vxm.DriverTerminalShowState(0, 0) 'Use 0 to hide Terminal if was shown earlier
VXM.PortClose 'Close the port in case still open
VXM.ReleaseDriver
VXM = Nothing
End Sub
Private Sub BtnMoveMotor_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnMoveMotor.Click
Vxm.PortOpen(1, 9600)
Vxm.PortSendCommands("F,C,I1M400,I1M-400,R")
Vxm.PortClose()
End Sub
Minimal Code
WITH
Wait
Below is the MINIMUM amount of code to make a motor move if you want your code to wait for the VXM program to finish before your code continues.
Public Function App_Path() As String
Return System.AppDomain.CurrentDomain.BaseDirectory()
End Function
Private Vxm As ClsVxmDriverVbNet2003
Private DriverLoaded As Integer
Public AppPath As String
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Vxm = New ClsVxmDriverVbNet2003 'Set the class wrapper to use driver
AppPath = App_Path()
Dim DriverLoaded As Long
DriverLoaded = Vxm.LoadDriver(AppPath + "Driver\VxmDriver.dll")
End Sub
Private Sub Form1_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
Vxm.DriverTerminalShowState(0, 0) 'Use 0 to hide Terminal if was shown earlier
VXM.PortClose 'Close the port in case still open
VXM.ReleaseDriver
VXM = Nothing
End Sub
Private Sub BtnMoveMotorWait_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnMoveMotorWait.Click
Vxm.PortOpen(1, 9600)
Vxm.PortSendCommands("F,C,I1M400,I1M-400,R")
Vxm.PortWaitForChar("^", 0)
Vxm.PortClose()
End Sub