Velmex    |    BiSlide    |    XSlide
Image Fade Right
 
VXM Driver Documentation - Visual Basic .NET 2003 - PortWaitForCharWithMotorPosition
 
Image - VXM

All functions assume you followed directions in the "How To Add To Your Project"

PortWaitForCharWithMotorPosition

The "PortWaitForCharWithMotorPosition" function is a combination of PortWaitForChar and MotorPosition.

      This function is very helpful if needing to read motor position while waiting for a VXM program to end.

Limitations:
      Only motor 1 and motor 2 positions can be read while motor is moving

      The Textbox Handle is an IntPtr and cannot be passed directly
      This IntPtr must be converted to a Long before being passed to the driver
      (see example below).



Syntax:
      PortWaitForCharWithMotorPosition(ByVal CharToWaitFor As String, ByVal MotorNumber As Long, Optional ByVal ReportToWindowHwnd As Long, Optional ByVal TimeOutTime As Long) As Long



Parameters:
      CharToWaitFor = Character to wait for. (typically the "^")

      MotorNumber = Number of the motor you wish to have driver report position back

      ReportToWindowHwnd = Hwnd of the window you wish the position to appear

      (Optional) TimeOutTime = Time in MilliSeconds to wait

            (if character not found before the timeout then your code will continue.

            (if zero then driver will wait until either the character is found, or loss of communications)



Returns:
      0 if failed
      1 if successfull

Example:
      Dim CallPortWaitForCharMotorPosition As Long
      Dim TempPtr As IntPtr
      Dim HwndPositionWindow As Long
      TempPtr = Me.TextBox1.Handle
      HwndPositionWindow = TempPtr.ToInt32
      CallPortWaitForCharMotorPosition = VXM.PortWaitForCharWithMotorPosition("^", 1, HwndPositionWindow, 0)

Image Fade Bottom Image Fade Right Bottom