none
USB input monitoring RRS feed

  • Question

  • I am an experience programmer of 30 years.  In the old days I interfaced devices over RS232 ports, such as weighing machines.  It has been a while since I have had such a need.  A client just asked me to interface a software package with a Keyence machine that uses lasers to measure dimensions of his product.  I wrote the code and found that the device has a RS232 port but it is connect via an RS232 to USB cable.  I now need to know how to communicate with this machine through this port via VB.  The Keyence system came with software to signal the port to offer the data.  That needs to run.  I would like to have my program running alongside to "see" the output on the port and capture it.  The product software does not allow cut and paste or database interface in real time, which they need to prevent clerk manual copying to a log errors and simultaneous bar code entries of the actual product being evaluated.

    I have read that I need to use HID modules.  I downloaded sample code that is supposed to allow me to talk to a device if I know the Vendor ID and the product ID, which I do.  But, this code say that device doesn't exist. 

         success = HidD_GetAttributes(hidHandle, MyHid.DeviceAttributes)    where attributes seems to vendorID and ProductID

    I downloaded different sample code that lists devices found on USB ports and it does "see" the Keyence connected but does not contain any code to try to send or receive signals.

         moSearch = New Management.ManagementObjectSearcher("Select * from Win32_USBControllerDevice")       

            Offers my device as: "DeviceID is USB\VID_0720&PID_0013\5&1083D3C6&0&1"

    I could use some advice on how to code this interface via RS232 to USB input. 

    Thank you to anyone who can guide me.


    Tuesday, January 7, 2020 8:33 PM

All replies