⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmmain.frm

📁 usb pci detection to usb port device
💻 FRM
📖 第 1 页 / 共 5 页
字号:
         Alignment       =   2  'Center
         BorderStyle     =   1  'Fixed Single
         Caption         =   "M.m"
         Height          =   345
         Left            =   1830
         TabIndex        =   8
         Top             =   210
         Width           =   825
      End
      Begin VB.Label lblBusScanTime 
         Alignment       =   1  'Right Justify
         Caption         =   "Bus Scan Time (msec):"
         Height          =   255
         Left            =   120
         TabIndex        =   7
         Top             =   990
         Width           =   1695
      End
      Begin VB.Label lblBoardStatus 
         Alignment       =   1  'Right Justify
         Caption         =   "Board:"
         Height          =   255
         Left            =   120
         TabIndex        =   6
         Top             =   630
         Width           =   1695
      End
      Begin VB.Label lblFirmwareRev 
         Alignment       =   1  'Right Justify
         Caption         =   "Firmware Revision:"
         Height          =   255
         Left            =   120
         TabIndex        =   5
         Top             =   240
         Width           =   1695
      End
   End
   Begin VB.TextBox lblPCIMemoryAddress 
      Alignment       =   2  'Center
      Height          =   315
      Left            =   9930
      TabIndex        =   3
      Top             =   1800
      Width           =   1500
   End
   Begin VB.TextBox lblWindowsHandle 
      Alignment       =   2  'Center
      Height          =   315
      Left            =   9930
      TabIndex        =   2
      Top             =   1200
      Width           =   1500
   End
   Begin VB.CommandButton LocateEnableCard 
      Caption         =   "(Reset) Locate and Enable Card"
      Height          =   555
      Left            =   9930
      TabIndex        =   1
      Top             =   60
      Width           =   1515
   End
   Begin VB.TextBox lblLocateCardError 
      Alignment       =   2  'Center
      Height          =   315
      Left            =   9930
      TabIndex        =   0
      Top             =   600
      Width           =   1500
   End
   Begin VB.Label Label8 
      Alignment       =   2  'Center
      Caption         =   "Card GeniusBus SBA"
      Height          =   255
      Left            =   9930
      TabIndex        =   56
      Top             =   3330
      Width           =   1500
   End
   Begin VB.Label Label7 
      Alignment       =   2  'Center
      Caption         =   "Card Setup Error"
      Height          =   255
      Left            =   9930
      TabIndex        =   55
      Top             =   2730
      Width           =   1500
   End
   Begin VB.Label Label6 
      Alignment       =   2  'Center
      Caption         =   "PCI Memory Address"
      Height          =   255
      Left            =   9930
      TabIndex        =   54
      Top             =   2130
      Width           =   1500
   End
   Begin VB.Label Label5 
      Alignment       =   2  'Center
      Caption         =   "Windows Handle"
      Height          =   255
      Left            =   9930
      TabIndex        =   53
      Top             =   1530
      Width           =   1500
   End
   Begin VB.Label Label4 
      Alignment       =   2  'Center
      Caption         =   "Locate Card Error"
      Height          =   255
      Left            =   9930
      TabIndex        =   52
      Top             =   930
      Width           =   1500
   End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private I                As Integer 'Used in Timer sub
Private HardwareStatus   As Byte    'Ditto
Private BusStatus        As Byte    'Ditto
Private Sub ChangeSetup_Click()
Dim Setup As GENI_SETUP
    With Setup
        .broadcast_control_data_length = CByte(Val(lblBCDLenValue.Text))
        .directed_control_data_length = CByte(Val(lblDCDLenValue.Text))
        .io_buffer_length = CByte(Val(lblIOBufferLenValue.Text))
        .reference_address = CInt(Val(lblRefAddrValue.Text))
    End With 'Setup
    GENI_Change_Setup Setup
End Sub
Private Sub Check1_Click()
    Timer1.Enabled = Check1.Value
End Sub
Private Sub Command1_Click()
    IO_Display.Show
End Sub
Private Sub Disable_Card_Click()
    GENI_Destruct
End Sub
Private Sub Form_Load()
    lblCard.Caption = cGEGENIUS
    lblLocateCardError.Text = LocationResult
    lblWindowsHandle.Text = hWin32Device
    lblPCIMemoryAddress.Text = MemoryBaseAddress
    lblCardSetupError.Text = InitializationResult
    lblCardSBA.Text = SerialBusAddress
    lblDeviceAddressValue.Caption = Node
    If BaudRate = Baud_153p6kEXT Then
        lblBaudRateValue.Caption = "153.6k EXT"
    ElseIf BaudRate = baud_153p6kstd Then
        lblBaudRateValue.Caption = "153.6k Std"
    ElseIf BaudRate = Baud_38p4k Then
        lblBaudRateValue.Caption = "38.4k"
    ElseIf BaudRate = Baud_76p8k Then
        lblBaudRateValue.Caption = "76.8k"
    End If
    If Outputs = OutputsEnabled Then
        lblOutputsValue.Caption = 1
    ElseIf Outputs = Outputsdisabled Then
        lblOutputsValue.Caption = 0
    End If
    Me.Show
    Text7.Text = 0
    Text8.Text = 0
    Text10.Text = 1
End Sub
Private Sub Form_Unload(Cancel As Integer)
    GENI_Destruct
    End
End Sub
Private Sub lblSBA_Click(Index As Integer)
    With DeviceConfig(Index)
        lblOutputsEnable.Caption = .outputs_disable
        lblBCDLenTagValue.Caption = .broadcast_control_data_length
        lblDCDLenTagValue.Caption = .directed_control_data_length
        lblCircuitCfg.Caption = .block_config
        lblRefAddrTagValue.Caption = .reference_address
        lblDeviceType.Caption = .model_number
    End With
    Select Case DeviceConfig(Index).model_number
    Case 0
        lblDeviceTypePart.Caption = "[###]"
        lblDeviceTypeDescription.Caption = "No Device Present"
    Case 2
        lblDeviceTypePart.Caption = "[IC660HHM500]"
        lblDeviceTypeDescription.Caption = "Hand-held monitor HHM PhaseA"
    Case 5
        lblDeviceTypePart.Caption = "[IC660HHM501]"
        lblDeviceTypeDescription.Caption = "Hand-held monitor HHM"
    Case 64
        lblDeviceTypePart.Caption = "[IC660CBD100]"
        lblDeviceTypeDescription.Caption = "8 circuit discrete block 115VAC Grouped PhaseA"
    Case 65
        lblDeviceTypePart.Caption = "[IC660CBS100]"
        lblDeviceTypeDescription.Caption = "8 circuit discrete block 115VAC 125VDC Isolated PhaseA"
    Case 69
        lblDeviceTypePart.Caption = "[IC660BBD100]"
        lblDeviceTypeDescription.Caption = "8 circuit discrete block 115VAC 2A Grouped"
    Case 70
        lblDeviceTypePart.Caption = "[IC660BBS100 / IC660BBS101]"
        lblDeviceTypeDescription.Caption = "8 circuit discrete block 115VAC 125VDC Isolated"
    Case 71
        lblDeviceTypePart.Caption = "[IC660??????]"
        lblDeviceTypeDescription.Caption = "8 circuit discrete block 220VAC Grouped"
    Case 82
        lblDeviceTypePart.Caption = "[IC660BBD101]"
        lblDeviceTypeDescription.Caption = "8 circuit discrete block 115VAC LowLeakage Grouped"
    Case 67
        lblDeviceTypePart.Caption = "[IC660CBD021]"
        lblDeviceTypeDescription.Caption = "16 circuit discrete block 24VDC 48VDC Sink PhaseA"
    Case 68
        lblDeviceTypePart.Caption = "[IC660CBD020]"
        lblDeviceTypeDescription.Caption = "16 circuit discrete block 24VDC 48VDC Source PhaseA"
    Case 72
        lblDeviceTypePart.Caption = "[IC660BBD021 / IC660BBD023]"
        lblDeviceTypeDescription.Caption = "16 circuit discrete block 24VDC 48VDC Sink"
    Case 73
        lblDeviceTypePart.Caption = "[IC660BBD020 / IC660BBD022]"
        lblDeviceTypeDescription.Caption = "16 circuit discrete block 12VDC 24VDC 48VDC Source"
    Case 79
        lblDeviceTypePart.Caption = "[IC660BBR101]"
        lblDeviceTypeDescription.Caption = "16 circuit discrete block Normally Open Relay"
    Case 80
        lblDeviceTypePart.Caption = "[IC660BBR100]"
        lblDeviceTypeDescription.Caption = "16 circuit discrete block Normally Closed Relay"
    Case 81
        lblDeviceTypePart.Caption = "[IC660BBD110]"
        lblDeviceTypeDescription.Caption = "16 circuit discrete block 115VAC Input"
    Case 74
        lblDeviceTypePart.Caption = "[IC660BBD025]"
        lblDeviceTypeDescription.Caption = "32 circuit discrete block 5VDC 12VDC 24VDC Sink"
    Case 75
        lblDeviceTypePart.Caption = "[IC660BBD024]"
        lblDeviceTypeDescription.Caption = "32 circuit discrete block 12VDC 24VDC Source"
    Case 131
        lblDeviceTypePart.Caption = "[IC660BBA100]"
        lblDeviceTypeDescription.Caption = "4 input / 2 output analog block Voltage Current 115VAC"
    Case 132
        lblDeviceTypePart.Caption = "[IC660BBA020]"
        lblDeviceTypeDescription.Caption = "4 input / 2 output analog block Voltage Current 24VDC 48VDC"
    Case 128
        lblDeviceTypePart.Caption = "[IC660CBA100]"
        lblDeviceTypeDescription.Caption = "4 input / 2 output analog block Voltage Current 115VAC PhaseA"
    Case 129
        lblDeviceTypePart.Caption = "[IC660CBA020]"
        lblDeviceTypeDescription.Caption = "4 input / 2 output analog block Voltage Current 24VDC 48VDC PhaseA"
    Case 140
        lblDeviceTypePart.Caption = "[IC660BBA104]"
        lblDeviceTypeDescription.Caption = "4 input / 2 output analog block Current Source 115VAC 125VDC"
    Case 141
        lblDeviceTypePart.Caption = "[IC660BBA024]"
        lblDeviceTypeDescription.Caption = "4 input / 2 output analog block Current Source 24VDC 48VDC"
    Case 142
        lblDeviceTypePart.Caption = "[IC660BBA105]"
        lblDeviceTypeDescription.Caption = "6 output analog block Current Source 115VAC 125VDC"
    Case 143
        lblDeviceTypePart.Caption = "[IC660BBA025]"
        lblDeviceTypeDescription.Caption = "6 output analog block Current Source 24VDC 48VDC"
    Case 144
        lblDeviceTypePart.Caption = "[IC660BBA106]"
        lblDeviceTypeDescription.Caption = "6 input analog block Current Source 115VAC 125VDC"
    Case 145
        lblDeviceTypePart.Caption = "[IC660BBA026]"
        lblDeviceTypeDescription.Caption = "6 input analog block Current Source 24VDC 48VDC"
    Case 134
        lblDeviceTypePart.Caption = "[IC660BBA103]"
        lblDeviceTypeDescription.Caption = "6 input thermocouple block 115VAC 125VDC"
    Case 135
        lblDeviceTypePart.Caption = "[IC660BBA023]"
        lblDeviceTypeDescription.Caption = "6 input thermocouple block 24VDC 48VDC"
    Case 136
        lblDeviceTypePart.Caption = "[IC660BBA101]"
        lblDeviceTypeDescription.Caption = "6 input RTD block 115VAC 125VDC"
    Case 137
        lblDeviceTypePart.Caption = "[IC660BBA021]"
        lblDeviceTypeDescription.Caption = "6 input RTD block 24VDC 48VDC"
    Case 32
        lblDeviceTypePart.Caption = "[IC660BBD120]"
        lblDeviceTypeDescription.Caption = "High speed counter (types A,B,C) block"
    Case 127
        lblDeviceTypePart.Caption = "[IC660BPM100]"
        lblDeviceTypeDescription.Caption = "PowerTRAC block"
    Case 1
        lblDeviceTypePart.Caption = "[IC660CBB900]"
        lblDeviceTypeDescription.Caption = "Series 6 Bus Controller PhaseA"
    Case 3
        lblDeviceTypePart.Caption = "[IC660CBB901]"
        lblDeviceTypeDescription.Caption = "Series 6 Bus Controller Wout Diags PhaseA"
    Case 6
        lblDeviceTypePart.Caption = "[IC660CBB902]"
        lblDeviceTypeDescription.Caption = "Series 6 Bus Controller"
    Case 7
        lblDeviceTypePart.Caption = "[IC660CBB903]"
        lblDeviceTypeDescription.Caption = "Series 6 Bus Controller Wout Diags"
    Case 10
        lblDeviceTypePart.Caption = "[IC697BEM731]"
        lblDeviceTypeDescription.Caption = "Series 90-70 Bus Controller"
    Case 15
        lblDeviceTypePart.Caption = "[IC693BEM331]"
        lblDeviceTypeDescription.Caption = "Series 90-30 Bus Controller"
    Case 160
        lblDeviceTypePart.Caption = "[IC697BEM733]"
        lblDeviceTypeDescription.Caption = "Series 90-70 Remote I/O Scanner"
    Case 13
        lblDeviceTypePart.Caption = "[IC693CMM301]"
        lblDeviceTypeDescription.Caption = "Series 90-30 Communications Module"
    Case 14
        lblDeviceTypePart.Caption = "[IC693CMM302]"
        lblDeviceTypeDescription.Caption = "Series 90-30 Enhanced Communications Module"
    'Case 160
        'lblDeviceTypePart.Caption = "[IC670GBI001]"
        'lblDeviceTypeDescription.Caption = "Field Control Genius Bus Interface Unit"
    Case 161
        lblDeviceTypePart.Caption = "[IC200GBI001]"
        lblDeviceTypeDescription.Caption = "VersaMax Genius Bus Interface Unit"
    Case 4
        lblDeviceTypePart.Caption = "[IC660ELB9xx]"
        lblDeviceTypeDescription.Caption = "ISA-bus and PCI-bus GENI type device"
    Case Else
        lblDeviceTypePart.Caption = "[???]"
        lblDeviceTypeDescription.Caption = "UNKNOWN DEVICE PRESENT"
    End Select
End Sub
Private Sub LocateEnableCard_Click()
    GENI_Destruct
    Setup.Show
End Sub
Private Sub Read_Memory_Click()
Dim I       As Long
Dim j       As Long
Dim k(8192) As Byte
Dim l       As Long
Dim b       As Long
Dim Address As Long
    Text4.Text = vbNullString
    I = CLng(Text7.Text)
    j = CLng(Text8.Text)
    b = CLng(Text10.Text)
    For l = 0 To I
        Address = (j + l)
        CopyMemory k(l), ByVal Address, b
        Text4.Text = Text4.Text & " " & CStr(k(l))
    Next l
End Sub
Private Sub Timer1_Timer()
    If LocationResult = (GENI_NoError) Then
        lblRefAddrValue.Text = GetVar(MemoryBaseAddress + SRI_GENI_SETUP_OFFSET + 1, 2)
        lblBCDLenValue.Text = GetVar(MemoryBaseAddress + SRI_GENI_SETUP_OFFSET + 3, 1)
        lblDCDLenValue.Text = GetVar(MemoryBaseAddress + SRI_GENI_SETUP_OFFSET + 4, 1)
        lblIOBufferLenValue.Text = GetVar(MemoryBaseAddress + SRI_GENI_SETUP_OFFSET + 5, 1)
        For I = 0 To 31
            With DeviceConfig(I)
                .device_present = GetVar((MemoryBaseAddress + SRI_Device_Config_Offset(I) + 2), 1)
                If .device_present Then
                    .model_number = GetVar((MemoryBaseAddress + SRI_Device_Config_Offset(I)), 1)
                    .outputs_disable = GetVar((MemoryBaseAddress + SRI_Device_Config_Offset(I) + 1), 1)
                    .reference_address = GetVar((MemoryBaseAddress + SRI_Device_Config_Offset(I) + 3), 2)
                    .broadcast_control_data_length = GetVar((MemoryBaseAddress + SRI_Device_Config_Offset(I) + 5), 1)
                    .directed_control_data_length = GetVar((MemoryBaseAddress + SRI_Device_Config_Offset(I) + 6), 1)
                    .block_config = GetVar((MemoryBaseAddress + SRI_Device_Config_Offset(I) + 7), 1)
                    lblSBA(I).Text = .model_number
                End If
            End With
        Next I
        lblFirmwareRevValue.Caption = GetVar(MemoryBaseAddress + SRI_GENI_STATUS_OFFSET, 1)
        lblBoardStatusValue.Caption = GetVar(MemoryBaseAddress + SRI_GENI_STATUS_OFFSET + 1, 1)
        lblBusScanTimeValue.Caption = GetVar(MemoryBaseAddress + SRI_GENI_STATUS_OFFSET + 6, 2)
        HardwareStatus = GetVar(MemoryBaseAddress + SRI_GENI_STATUS_OFFSET + 2, 1)
 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -