Jump to content

Hadin

Members
  • Posts

    11
  • Joined

  • Last visited

Recent Profile Visitors

8,406 profile views

Hadin's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Well done, I currently want to implement data acquisition on many simple machines, indeed many controls can not be obtained with the autoit handle, but based on this article how to use the ability, whether there is a big brother to give an example, thank you. like calc.exe?Use windbg to obtain the handle base address?
  2. The dxdiag 10.00.17763 version cannot be started. Can you match earlier versions of DLL files? Thank you very much, if you can, I'm sure there will be more devices available.
  3. Hi,Danyfirex,The function call still fails. $hDeviceHandle:0x00E15B28 !>21:03:11 AutoIt3.exe End.rc:-1073741819
  4. Hi,Danyfirex,Thank you for your attention and reply. I saw the invoking method of Libusb.dll that you wrote above, and I tried to use it. Therefore, I also found relevant forums such as German, French, and Chinese. There is no such information, and I can only query it in the official libusb documentation. I also tried to translate it into autoit , I tried to understand what you translated, and then to translate the rest, but without the C language foundation, I did nothing. This open source library is very practical for future applications, more USB devices and protocols will be used in Windows systems in the future. But most of our use is RS232 COM applications, so there is an urgent need to learn USB communication. API page:https://libusb.sourceforge.io/api-1.0/libusb_api.html libusb_get_device_descriptor,Official API Description: ◆ libusb_get_device_descriptor() int libusb_get_device_descriptor ( libusb_device * dev, struct libusb_device_descriptor * desc ) Get the USB device descriptor for a given device. This is a non-blocking function; the device descriptor is cached in memory. Note since libusb-1.0.16, LIBUSB_API_VERSION >= 0x01000102, this function always succeeds. Parameters dev the device desc output location for the descriptor data Returns 0 on success or a LIBUSB_ERROR code on failure I tried to add a libusb_get_device_descriptor function to your base, but it didn't work at all. Func _libusb_get_des($prt) Local $tagSTRUCT1 = "struct;byte blength;byte bdescriptortype;word bcdusb;byte bdeviceclass;byte bdevicesubclass;byte bdeviceprotocol;byte bmaxpacketsize0;word idvendor;word idproduct;word bcddevice;byte imanufacturer;byte iproduct;byte iserialNumber;byte bnumconfigurations;endstruct" Local $tSTRUCT1 = DllStructCreate($tagSTRUCT1) If @error Then MsgBox($MB_SYSTEMMODAL, "", "DllStructCreate error: " & @error) Return False EndIf ConsoleWrite("$tagSTRUCT1:OK" &@CRLF) Local $aCall = DllCall($g_hlibusb, "int", "libusb_get_device_descriptor", "ptr", $prt, "struct", DllStructGetPtr($tSTRUCT1)) If @error Or Not $aCall[0] Then Return SetError(1, 0, 0) ConsoleWrite("libusb_get_device_descriptor:"&$aCall[0] &@CRLF) Return $aCall[0] EndFunc Here's my device information: =========================== USB Port7 =========================== Connection Status : 0x01 (Device is connected) Port Chain : 1-7 Properties : 0x01 IsUserConnectable : yes PortIsDebugCapable : no PortHasMultiCompanions : no PortConnectorIsTypeC : no ConnectionIndex : 0x07 (Port 7) CompanionIndex : 0 CompanionHubSymLnk : USB#ROOT_HUB30#4&31765f9e&0&0#{f18a0e88-c30c-11d0-8815-00a0c906bed8} CompanionPortNumber : 0x19 (Port 25) -> CompanionPortChain : 1-25 ========================== Summary ========================= Vendor ID : 0x0720 (Keyence Corporation) Product ID : 0x3014 USB Version : 2.00 -> wrong, Device is Full-Speed only Port maximum Speed : High-Speed (Companion Port 1-25 supports SuperSpeed) Device maximum Speed : Full-Speed Device Connection Speed : Full-Speed Self powered : yes Demanded Current : 100 mA Used Endpoints : 8 ======================== USB Device ======================== +++++++++++++++++ Device Information ++++++++++++++++++ Device Description : KEYENCE SR-700 Device Path 1 : \\?\USB#VID_0720&PID_3014#5&aaebba4&0&7#{24074605-7ee7-4f86-8dd5-87d6e091969e} Device Path 2 : \\?\USB#VID_0720&PID_3014#5&aaebba4&0&7#{a5dcbf10-6530-11d2-901f-00c04fb951ed} (GUID_DEVINTERFACE_USB_DEVICE) Kernel Name : \Device\USBPDO-2 Device ID : USB\VID_0720&PID_3014\5&AAEBBA4&0&7 Hardware IDs : USB\VID_0720&PID_3014&REV_0002 USB\VID_0720&PID_3014 Driver KeyName : {36fc9e60-c465-11cf-8056-444553540000}\0005 (GUID_DEVCLASS_USB) Driver : \SystemRoot\System32\drivers\KEYENCE_SR-700.sys (Version: 2.0.3.1 Date: 2020-07-22) Driver Inf : C:\WINDOWS\inf\oem78.inf Legacy BusType : PNPBus Class : USB Class GUID : {36fc9e60-c465-11cf-8056-444553540000} (GUID_DEVCLASS_USB) Service : KEYENCE_SR-700 Enumerator : USB Location Info : Port_#0007.Hub_#0001 Location IDs : PCIROOT(0)#PCI(1400)#USBROOT(0)#USB(7), ACPI(_SB_)#ACPI(PCI0)#ACPI(XHC_)#ACPI(RHUB)#ACPI(HS07) Container ID : {98e9b4ce-38f0-11ec-9113-6c4b90e9bb70} Manufacturer Info : KEYENCE CORPORATION Capabilities : 0x84 (Removable, SurpriseRemovalOK) Status : 0x0180600A (DN_DRIVER_LOADED, DN_STARTED, DN_DISABLEABLE, DN_REMOVABLE, DN_NT_ENUMERATOR, DN_NT_DRIVER) Problem Code : 0 Address : 7 HcDisableSelectiveSuspend: 0 EnableSelectiveSuspend : 0 SelectiveSuspendEnabled : 0 EnhancedPowerMgmtEnabled : 0 IdleInWorkingState : 0 WakeFromSleepState : 0 Power State : D0 (supported: D0, D3, wake from D0) +++++++++++++++++ Registry USB Flags +++++++++++++++++ HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\usbflags\072030140002 osvc : REG_BINARY 00 00 ---------------- Connection Information --------------- Connection Index : 0x07 (Port 7) Connection Status : 0x01 (DeviceConnected) Current Config Value : 0x01 (Configuration 1) Device Address : 0x04 (4) Is Hub : 0x00 (no) Device Bus Speed : 0x01 (Full-Speed) Number Of Open Pipes : 0x07 (7 pipes to data endpoints) Pipe[0] : EndpointID=1 Direction=OUT ScheduleOffset=0 Type=Bulk wMaxPacketSize=64 bInterval=0 Pipe[1] : EndpointID=1 Direction=IN ScheduleOffset=0 Type=Bulk wMaxPacketSize=64 bInterval=0 Pipe[2] : EndpointID=2 Direction=OUT ScheduleOffset=0 Type=Bulk wMaxPacketSize=64 bInterval=0 Pipe[3] : EndpointID=2 Direction=IN ScheduleOffset=0 Type=Bulk wMaxPacketSize=64 bInterval=0 Pipe[4] : EndpointID=3 Direction=OUT ScheduleOffset=0 Type=Bulk wMaxPacketSize=64 bInterval=0 Pipe[5] : EndpointID=3 Direction=IN ScheduleOffset=0 Type=Bulk wMaxPacketSize=64 bInterval=0 Pipe[6] : EndpointID=4 Direction=IN ScheduleOffset=0 Type=Interrupt wMaxPacketSize=64 bInterval=10 Data (HexDump) : 07 00 00 00 12 01 00 02 00 00 00 08 20 07 14 30 ............ ..0 02 00 01 02 00 01 01 01 00 04 00 07 00 00 00 01 ................ 00 00 00 07 05 01 02 40 00 00 00 00 00 00 07 05 .......@........ 81 02 40 00 00 00 00 00 00 07 05 02 02 40 00 00 ..@..........@.. 00 00 00 00 07 05 82 02 40 00 00 00 00 00 00 07 ........@....... 05 03 02 40 00 00 00 00 00 00 07 05 83 02 40 00 ...@..........@. 00 00 00 00 00 07 05 84 03 40 00 0A 00 00 00 00 .........@......
  5. Hi,Danyfirex,DevMode: I looked for a long time for examples of USB device connections (including forums for autoit other languages) and couldn't find what I needed because it wasn't COM communication, until I saw hope here, and now I'm facing a USB 2.0 device communication, but I don't have a C language basis. In the libusb API document still cannot be converted to AUTOIT. Libusb Description Document:https://libusb.sourceforge.io/api-1.0/libusb_api.html How do I determine which model my device is? it's a barcode reader. in the USB DeviceViewer (Companion Hub Symbolic Link Name): USB#ROOT_HUB30#4&31765f9e&0&0#{f18a0e88-c30c-11d0-8815-00a0c906bed8} in the regedit Device Parameters :\??\USB#VID_0720&PID_3014#5&aaebba4&0&7#{a5dcbf10-6530-11d2-901f-00c04fb951ed} libusb_class_code { LIBUSB_CLASS_PER_INTERFACE = 0x00, LIBUSB_CLASS_AUDIO = 0x01, LIBUSB_CLASS_COMM = 0x02, LIBUSB_CLASS_HID = 0x03, LIBUSB_CLASS_PHYSICAL = 0x05, LIBUSB_CLASS_IMAGE = 0x06, LIBUSB_CLASS_PTP = 0x06, LIBUSB_CLASS_PRINTER = 0x07, LIBUSB_CLASS_MASS_STORAGE = 0x08, LIBUSB_CLASS_HUB = 0x09, LIBUSB_CLASS_DATA = 0x0a, LIBUSB_CLASS_SMART_CARD = 0x0b, LIBUSB_CLASS_CONTENT_SECURITY = 0x0d, LIBUSB_CLASS_VIDEO = 0x0e, LIBUSB_CLASS_PERSONAL_HEALTHCARE = 0x0f, LIBUSB_CLASS_DIAGNOSTIC_DEVICE = 0xdc, LIBUSB_CLASS_WIRELESS = 0xe0, LIBUSB_CLASS_MISCELLANEOUS = 0xef, LIBUSB_CLASS_APPLICATION = 0xfe, LIBUSB_CLASS_VENDOR_SPEC = 0xff } can you share your script? (like how to read the description, how to connect and communicate, how to determine the device model), thank you very much.
  6. When I compress the binary data with Base64 encoding, $FileBinary: tringLen($FileBinary)/1024/1024=106MB: The upload is successful, but the download and reading may fail. Therefore, I checked the output in _ADO_Execute and _ADO_Recordset_ToArray and determined that the problem occurred in _ADO_Recordset_ToArray, as shown in the following figure.(There's no problem with small files.) Local $Ruturn=_ADO_Execute($SqlConnet,"select abinary,aVersion from TB_a_Test WHERE filename like '%Docx%';",True,True) Error Problem Location: Func _ADO_Recordset_ToArray(ByRef $oRecordset, $bFieldNamesInFirstRow = False) ...... ConsoleWrite("Pass4"&@CRLF) $oRecordset.moveFirst() ConsoleWrite("Pass5"&@CRLF) Local $aRecordset_GetRowsResult = $oRecordset.GetRows() ConsoleWrite("Pass6"&@CRLF) ...... Endfunc ;;;;;;;;;;;;;;;Output ConsoleWrite: Pass4 Pass5 !>11:00:58 AutoIt3.exe End.rc:-1073741819 ;;;;;;;;;;;;;;;Output
  7. Hi,mLipok,Skysnake,Thanks for the reply: Here's how I got a problem: #include <..\USclude\ADO.au3> #include <Array.au3> Global Enum $sDriver,$sServer,$sPort,$sDatabase,$sUser,$sPassword,$AppName Global Static $ConStr[7] $ConStr[$sDriver]= 'PostgreSQL Unicode' $ConStr[$sServer]= '192.168.1.1' $ConStr[$sPort]= '5432' $ConStr[$sDatabase]= 'Main_DB' $ConStr[$sUser]= 'postgres' $ConStr[$sPassword]= 'password' $ConStr[$AppName]= 'ADO_TestApp' Local $sConnectionString = 'Driver={' & $ConStr[$sDriver] & '};'& _ 'DATABASE=' & $ConStr[$sDatabase] & ';'& _ 'SERVER=' & $ConStr[$sServer] & ';'& _ 'PORT=' & $ConStr[$sPort] & ';'& _ 'UID=' & $ConStr[$sUser] & ';'& _ 'PWD=' & $ConStr[$sPassword]& ';'& _ 'APP='& $ConStr[$AppName]&';' Local $SqlConnet = _ADO_Connection_Create() If @error Then Exit(ConsoleWrite("Error"&@CRLF)) _ADO_Connection_OpenConString($SqlConnet, $sConnectionString) Local $SelectPath=@DesktopDir&'\85MB.docx';one large-capacity file Local $FileHw=FileOpen($SelectPath,16) Local $FileBinary=FileRead($FileHw) FileClose($FileHw) ;$FileBinary: StringLen($FileBinary)/1024/1024=159.64MB Local $DB_Statement="insert into TB_a_Test(InsertTime,WIBinary)values(now(),'"&$FileBinary&"')" Local $oRecordset = _ADO_Execute($SqlConnet, $DB_Statement) The upload error occurs only when the file size is greater than 60 MB and the error is reported when the function _ADO_Execute is running [Local $oRecordset = $oConnection.Execute($sQuery)]. ;;in Postgresql errorcode: ! 1668 == 0 ############################### ADO.au3 v.2.1.19 BETA (1379) : ==> COM Error intercepted ! $oADO_Error.description is: No memory available to store statement $oADO_Error.windescription: **** $oADO_Error.number is: 80020009 $oADO_Error.lastdllerror is: 0 $oADO_Error.scriptline is: 1379 $oADO_Error.source is: Microsoft OLE DB Provider for ODBC Drivers $oADO_Error.helpfile is: $oADO_Error.helpcontext is: 0 ############################### ;;in SQL Server errorcode: ! 1668 == 0 ############################### ADO.au3 v.2.1.19 BETA (1379) : ==> COM Error intercepted ! $oADO_Error.description is: [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionWrite (send()). $oADO_Error.windescription: ***** $oADO_Error.number is: 80020009 $oADO_Error.lastdllerror is: 0 $oADO_Error.scriptline is: 1379 $oADO_Error.source is: Microsoft OLE DB Provider for ODBC Drivers $oADO_Error.helpfile is: $oADO_Error.helpcontext is: 0 ############################### Is this method not applicable to large-capacity files that are read in binary mode and saved to the database? Currently, small-capacity files are not affected,
  8. Hi,mLipok,I'm in trouble and I need your help: I want to use Sqlserver or PostgreSQL to upload and download large files for management. The Sqlserver uses varbinary(max), the PostgreSQL uses BYTEA, and the Autoit is fileopen(file,16) . After binary files are read and uploaded, all small files can be used. However, if a single file is larger than 85 MB, an unknown error occurs and the memory is insufficient. For example, if a large file is successfully uploaded, an error is reported during ADO query. We haven't found a way to do it yet, thank you. #include <..\USclude\ADO.au3> #include <Array.au3> Global Enum $sDriver,$sServer,$sPort,$sDatabase,$sUser,$sPassword,$AppName Global Static $ConStr[7] $ConStr[$sDriver]= 'PostgreSQL Unicode' $ConStr[$sServer]= '192.168.1.1' $ConStr[$sPort]= '5432' $ConStr[$sDatabase]= 'Main_DB' $ConStr[$sUser]= 'postgres' $ConStr[$sPassword]= 'password' $ConStr[$AppName]= 'ADO_TestApp' Local $sConnectionString = 'Driver={' & $ConStr[$sDriver] & '};'& _ 'DATABASE=' & $ConStr[$sDatabase] & ';'& _ 'SERVER=' & $ConStr[$sServer] & ';'& _ 'PORT=' & $ConStr[$sPort] & ';'& _ 'UID=' & $ConStr[$sUser] & ';'& _ 'PWD=' & $ConStr[$sPassword]& ';'& _ 'APP='& $ConStr[$AppName]&';' Local $SqlConnet = _ADO_Connection_Create() If @error Then Exit(ConsoleWrite("Error"&@CRLF)) _ADO_Connection_OpenConString($SqlConnet, $sConnectionString) Local $Ruturn=_ADO_Execute($SqlConnet,"select abinary,aVersion from TB_a_Test WHERE filesname like '%MyExcel.docx%';",True) _ArrayDisplay($Ruturn) It should not be the database problem, but the setting or method limitation of the ado. Ask for help.thanks verymuch!
  9. turn off monitors: DllCall("Dxva2.dll", "int", "SetVCPFeature", "handle", $tPhysicalMonitor.hPhysicalMonitor, _ "byte", 0xD6, "int",0x05) ;0x04 can too. turn on monitors: DllCall("Dxva2.dll", "int", "SetVCPFeature", "handle", $tPhysicalMonitor.hPhysicalMonitor, _ "byte", 0xD6, "int", 0x01)
  10. Hi,friend: Recently, the VNC connection was implemented on Autoit. The DLL VNCX was available on the forum. However, it was found that the keyboard information was transmitted in conflict with the local hotkey. I wanted to use the VNC RFB protocol for TCP communication. I searched for documents for several days. Currently, the version can be determined according to the protocol, however, the DES encryption interaction is always incorrect. I don't think the request is right, but I only have AOtu. Can someone help you transcode the code? Mycode: #Include "DES.au3" Func _ECB($InString) local $Key = Binary('mypass') local $Data = Binary($InString) Local $KEYS=_DesEncryptKey($Key) Local $KESYEN=_DesDecryptKey($Key) local $Encrypt = _DesCryptECB($KEYS, $Data) local $Decrypt = _DesCryptECB($KESYEN, $Encrypt) ConsoleWrite('=== Encrypt Two Block With DES ECB Mode ===' & @CRLF) ConsoleWrite('Encrypt: ' & $Encrypt & @CRLF & 'Decrypt: ' & $Decrypt & @CRLF & @CRLF) Return $Encrypt EndFunc Trying to use this will not solve the problem; This is the protocol document:: https://github.com/rfbproto/rfbproto/blob/master/rfbproto.rst https://www.vidarholen.net/contents/junk/vnc.html https://www.vidarholen.net/contents/junk/VNCEncrypt.java https://gitlab.yam-it.net/yam-it/bearmetal_console/commit/c539e4dcdadc79819ed56a57b5a70c3c4c4e31a7
×
×
  • Create New...