VERSION 5.00 Begin VB.Form Form1 Caption = "USB-DA12-8E Sample 0" ClientHeight = 5055 ClientLeft = 60 ClientTop = 450 ClientWidth = 7050 LinkTopic = "Form1" ScaleHeight = 5055 ScaleWidth = 7050 StartUpPosition = 3 'Windows Default Begin VB.TextBox Text1 Height = 4335 Left = 4440 Locked = -1 'True MultiLine = -1 'True TabIndex = 18 Text = "MainForm.frx":0000 Top = 480 Width = 2415 End Begin VB.CommandButton UpdateBtn Caption = "Update" Height = 375 Left = 2040 TabIndex = 16 Top = 3960 Width = 1215 End Begin VB.TextBox DACEdit Height = 285 Index = 7 Left = 1320 TabIndex = 7 Text = "000" Top = 3360 Width = 735 End Begin VB.TextBox DACEdit Height = 285 Index = 6 Left = 1320 TabIndex = 6 Text = "000" Top = 3000 Width = 735 End Begin VB.TextBox DACEdit Height = 285 Index = 5 Left = 1320 TabIndex = 5 Text = "000" Top = 2640 Width = 735 End Begin VB.TextBox DACEdit Height = 285 Index = 4 Left = 1320 TabIndex = 4 Text = "000" Top = 2280 Width = 735 End Begin VB.TextBox DACEdit Height = 285 Index = 3 Left = 1320 TabIndex = 3 Text = "000" Top = 1920 Width = 735 End Begin VB.TextBox DACEdit Height = 285 Index = 2 Left = 1320 TabIndex = 2 Text = "000" Top = 1560 Width = 735 End Begin VB.TextBox DACEdit Height = 285 Index = 1 Left = 1320 TabIndex = 1 Text = "000" Top = 1200 Width = 735 End Begin VB.TextBox DACEdit Height = 285 Index = 0 Left = 1320 TabIndex = 0 Text = "000" Top = 840 Width = 735 End Begin VB.Label Label9 Caption = "7" Height = 255 Left = 600 TabIndex = 26 Top = 3360 Width = 255 End Begin VB.Label Label8 Caption = "6" Height = 255 Left = 600 TabIndex = 25 Top = 3000 Width = 255 End Begin VB.Label Label7 Caption = "5" Height = 255 Left = 600 TabIndex = 24 Top = 2640 Width = 255 End Begin VB.Label Label6 Caption = "4" Height = 255 Left = 600 TabIndex = 23 Top = 2280 Width = 255 End Begin VB.Label Label5 Caption = "3" Height = 255 Left = 600 TabIndex = 22 Top = 1920 Width = 255 End Begin VB.Label Label4 Caption = "2" Height = 255 Left = 600 TabIndex = 21 Top = 1560 Width = 255 End Begin VB.Label Label3 Caption = "1" Height = 255 Left = 600 TabIndex = 20 Top = 1200 Width = 255 End Begin VB.Label Label2 Caption = "0" Height = 255 Left = 600 TabIndex = 19 Top = 840 Width = 255 End Begin VB.Label Label1 Caption = "Current" Height = 255 Left = 3000 TabIndex = 17 Top = 360 Width = 1215 End Begin VB.Label DACLabel Caption = "000" Height = 255 Index = 7 Left = 3240 TabIndex = 15 Top = 3360 Width = 735 End Begin VB.Label DACLabel Caption = "000" Height = 255 Index = 6 Left = 3240 TabIndex = 14 Top = 3000 Width = 735 End Begin VB.Label DACLabel Caption = "000" Height = 255 Index = 5 Left = 3240 TabIndex = 13 Top = 2640 Width = 735 End Begin VB.Label DACLabel Caption = "000" Height = 255 Index = 4 Left = 3240 TabIndex = 12 Top = 2280 Width = 735 End Begin VB.Label DACLabel Caption = "000" Height = 255 Index = 3 Left = 3240 TabIndex = 11 Top = 1920 Width = 735 End Begin VB.Label DACLabel Caption = "000" Height = 255 Index = 2 Left = 3240 TabIndex = 10 Top = 1560 Width = 735 End Begin VB.Label DACLabel Caption = "000" Height = 255 Index = 1 Left = 3240 TabIndex = 9 Top = 1200 Width = 735 End Begin VB.Label DACLabel Caption = "000" Height = 255 Index = 0 Left = 3240 TabIndex = 8 Top = 840 Width = 735 End End Attribute VB_Name = "Form1" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Dim DeviceIndex As Integer Private Sub Form_Load() Dim Dlg As DetectForm Dim Status As Long, PID As Long DeviceIndex = diOnly Status = QueryDeviceInfo(DeviceIndex, PID, 0, 0, 0, 0) If (Status <> ERROR_SUCCESS) Or Not ((PID = &H4003) Or (PID = &H4002)) Then Set Dlg = New DetectForm Dlg.Show vbModal DeviceIndex = Dlg.DeviceIndex Unload Dlg If DeviceIndex = -1 Then End End If End Sub Private Sub UpdateBtn_Click() Dim Count As Integer Dim current As Integer For Count = 0 To 7 current = "&H" + DACEdit(Count).Text DACDirect DeviceIndex, Count, current DACLabel(Count) = Hex(current) Next Count End Sub