为了将我的USB HID兼容设备与LabView一起使用,我必须创建一个自定义USB驱动程序。这工作正常,除非我连接新设备(相同的VID和PID,不同的GUID)窗口自动使用标准的hid.dll驱动程序而不是我的自定义驱动程序。因此,在我手动更改驱动程序之前,新设备无法与LabView一起使用。由于这应该在半自动化过程中使用,因此这种手动驱动程序更改是不可行的。 有没有办法告诉Windows使用我的自定义驱动程序,只要连接了具有相同VID和PID的设备?或者我做错了什么?
编辑:
安装驱动程序槽驱动程序向导5.3后的Setupapi.app.log文件:
>>> [Build Driver List - USB\VID_0483&PID_1208&MI_01\8&35506E0F&1&0001]
>>> Section start 2018/03/27 12:52:34.409
cmd: "C:\Program Files (x86)\IVI Foundation\VISA\WinNT\NIvisa\DriverWizardInstallInf64.exe" C:\Users\LOCALA~1\AppData\Local\Temp\LVTEMP~1.TMP
cpy: Policy is set to make all digital signatures equal.
<<< Section end 2018/03/27 12:52:34.413
<<< [Exit status: SUCCESS]
>>> [Build Driver List - USB\VID_0483&PID_1208&MI_01\8&35506E0F&1&0001]
>>> Section start 2018/03/27 12:52:34.413
cmd: "C:\Program Files (x86)\IVI Foundation\VISA\WinNT\NIvisa\DriverWizardInstallInf64.exe" C:\Users\LOCALA~1\AppData\Local\Temp\LVTEMP~1.TMP
cpy: Policy is set to make all digital signatures equal.
! sig: Verifying file against specific (valid) catalog failed! (0x00000057)
! sig: Error 87: The parameter is incorrect.
! sig: Verifying file against specific Authenticode(tm) catalog failed! (0x80092003)
! sig: Error 0x80092003: An error occurred while reading or writing to a file.
<<< Section end 2018/03/27 12:52:34.421
<<< [Exit status: SUCCESS]
>>> [DIF_SELECTBESTCOMPATDRV - USB\VID_0483&PID_1208&MI_01\8&35506E0F&1&0001]
>>> Section start 2018/03/27 12:52:34.422
cmd: "C:\Program Files (x86)\IVI Foundation\VISA\WinNT\NIvisa\DriverWizardInstallInf64.exe" C:\Users\LOCALA~1\AppData\Local\Temp\LVTEMP~1.TMP
<<< Section end 2018/03/27 12:52:34.423
<<< [Exit status: SUCCESS]
。由Driver Wizard 5.3创建的.inf文件:
;===========================================================================
; This file was generated using:
; NI-VISA Driver Development Wizard version 5.3
;===========================================================================
;
; This file is for use with Windows 8/7/Vista. This will not work on Windows
; XP. This Windows Setup Information File contains the information
; NI-VISA needs in order to access your instrument. Do not modify the
; contents of this file unless you are sure about what you are doing.
;
;===========================================================================
;
; Windows Vista/7 Installation:
; To apply the contents of this file to a system's settings, right-click
; this file and choose "Install". If the device was plugged in before this
; file is installed, the device will need to be removed from the "Unknown
; Devices" class in the Windows Device Manager.
;
;===========================================================================
;
; Windows 8 Installation:
; To apply the contents of this file to a system's settings, a catalog file
; must be generated and signed using either a personal certificate or a
; certificate obtained from a Certificate Authority (CA). For detailed
; instructions on how to install your INF on Windows 8, visit
; http://ni.com/info and enter the Info Code INFWin8.
;
;===========================================================================
;
; Removal:
; At installation, Windows copies the file into the %SystemRoot%\inf
; directory using the alternate filename oem##.inf. You may have
; to search all the files to find the one from which this is copied.
; Remove that file and its associated .pnf file (if it exists) from
; %SystemRoot%\inf. Either reboot the computer, or perform a
; "Scan for hardware changes" from the Windows Device Manager.
;
;===========================================================================
[Version]
Signature=$WINDOWS NT$
Class=visaUsbDevice
ClassGUID={A3330EDF-239D-4206-833B-1D58952613D5}
Provider=%Vendor0%
DriverVer=03/26/2018,1.0
CatalogFile=JumpSensor.cat
;===========================================================================
; Default Installer
;===========================================================================
[DefaultInstall]
CopyINF=JumpSensor.inf
[DestinationDirs]
[SourceDisksNames]
[SourceDisksFiles]
;===========================================================================
; Class Installer
;===========================================================================
[ClassInstall32]
AddReg=AddClass_AddReg
[AddClass_AddReg]
HKR,,,0,%DeviceClassString%
HKR,,Icon,,"-20"
;===========================================================================
[Manufacturer]
%Vendor1%=USBList,NTamd64
[USBList]
%USB\VID_0483&PID_1208&MI_00.DeviceDesc%=WinUsb_Inst, USB\VID_0483&PID_1208&MI_00
%USB\VID_0483&PID_1208&MI_01.DeviceDesc%=WinUsb_Inst, USB\VID_0483&PID_1208&MI_01
[USBList.NTamd64]
%USB\VID_0483&PID_1208&MI_00.DeviceDesc%=WinUsb_Inst, USB\VID_0483&PID_1208&MI_00
%USB\VID_0483&PID_1208&MI_01.DeviceDesc%=WinUsb_Inst, USB\VID_0483&PID_1208&MI_01
[PreCopySection]
HKR,,NoSetupUI,,1
[WinUsb_Inst]
Include = winusb.inf
Needs = WINUSB.NT
[WinUsb_Inst.hw]
AddReg=WinUsb_Inst_HW_AddReg
[WinUsb_Inst.Services]
Addservice = WinUsb, 0x00000002, WinUsb_AddService
[WinUsb_AddService]
DisplayName = %WinUsb_Service_DisplayName%
ServiceType = %SERVICE_KERNEL_DRIVER%
StartType = %SERVICE_DEMAND_START%
ErrorControl = %SERVICE_ERROR_NORMAL%
ServiceBinary = %12%\WinUSB.sys
[WinUsb_Inst_HW_AddReg]
HKR,,DeviceInterfaceGUIDs, 0x10000,"{761ED34A-CCFA-416b-94BB-33486DB1F5D5}"
[Strings]
Vendor0="STMicroelectronics"
Vendor1="STMicroelectronics"
USB\VID_0483&PID_1208&MI_00.DeviceDesc="JUMP Sensor"
USB\VID_0483&PID_1208&MI_01.DeviceDesc="JUMP Sensor"
DeviceClassString="NI-VISA USB Devices"
WinUsb_Service_DisplayName="WinUSB Driver"
SERVICE_BOOT_START = 0x0
SERVICE_SYSTEM_START = 0x1
SERVICE_AUTO_START = 0x2
SERVICE_DEMAND_START = 0x3
SERVICE_DISABLED = 0x4
SERVICE_KERNEL_DRIVER = 0x1
SERVICE_ERROR_IGNORE = 0x0
SERVICE_ERROR_NORMAL = 0x1
SERVICE_ERROR_SEVERE = 0x2
SERVICE_ERROR_CRITICAL = 0x3