Attribute VB_Name = "General"
'*----------------------------------------------------------------------
'* (c) 2008 Microstrain, Inc.
'*----------------------------------------------------------------------
'* THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING
'* CUSTOMERS WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER
'* FOR THEM TO SAVE TIME. AS A RESULT, MICROSTRAIN SHALL NOT BE HELD LIABLE
'* FOR ANY DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY
'* CLAIMS ARISING FROM THE CONTENT OF SUCH SOFTWARE AND/OR THE USE MADE BY
'* CUSTOMERS OF THE CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH
'* THEIR PRODUCTS.
'*-----------------------------------------------------------------------
'MicroStrain, Inc.
'VB6 Sample Code for Inertia-Link and 3DM-GX2
'Demonstrates setting Data Rate
'Uses Data Communication Protocol 1.15
'Version 1.0.0
'1 November 2008
'Fritz, engineer
'Barry, developer
'Notes:
    'Written with Visual Basic 6.0 Service Pack 5
    'Built at 800 X 600 (32-bit color)
    'Uses native controls in standard IDE; no third party controls
    'Decimal equivalent of hex is used for all protocol commands
    'Non-packet protocol used
    'MSComm1 set at 115200,n,8,1 and InputMode=1(binary)
'*-----------------------------------------------------------------------
'Add revisions here
'*-----------------------------------------------------------------------
'byte array
Public arrBytes() As Byte
'sampling rate value
Public MySamplingRateValue As Double
'declare API call for delay function
Declare Function GetTickCount Lib "kernel32.dll" () As Long

Public Function Delay(Milliseconds As Long)
'pretty good delay timer; uses GetTickCount API
Dim StartTime As Long, EndTime As Long
StartTime = GetTickCount
EndTime = StartTime
Do While EndTime - StartTime < Milliseconds
    EndTime = GetTickCount
Loop
End Function
