Velmex    |    BiSlide    |    XSlide
Image Fade Right
 
VXM Driver Documentation - PowerBasic - 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

      (see example below).



Syntax:
      FUNCTION PortWaitForCharWithMotorPosition(CharToWaitFor AS ASCIIZ, 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 HwndPositionWindow As Long
      CallPortWaitForCharMotorPosition = PortWaitForCharWithMotorPosition("^", 1, HwndPositionWindow, 0)

Image Fade Bottom Image Fade Right Bottom