-
Oct 5th, 2014, 11:37 PM
#1
Thread Starter
Fanatic Member
accessing USB HID device
Hi All,
This is driving me nuts, I have a DYMO postal scale which comes with USB. I wish to read the weight into my application.
The DYMO website has a app called InstaRate which can read the weight fine so it can be done. however no mention of how to.
The scale installs itself as a HID device, I have tried to find examples of how to read these but cant find anything that works (or understand it).
This code can find the device but provides no way to read as far as i can see
Code:
Imports SimpleHID
Public Class Form1
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Dim infoSetsForAllDevices = HIDManager.GetInfoSets()
For Each sss In infoSetsForAllDevices
ListBox1.Items.Add(sss.ProductString)
Dim device = New HIDDevice()
device.Init(sss.DevicePath)
Next
End Sub
End Class
can someone please help me figure this out? i feel im close but have reached the end of my rope
My CodeBank Submissions
- Listbox with transparency and picture support - Click Here
- Check for a true internet connection - Click Here
- Open Cash drawer connected to receipt printer - Click Here
- Custom color and size border around form - Click Here
- Upload file to website without user logins, includes PHP - Click Here
- List All Removable USB Storage Devices - Click Here
- Custom On/Off Slide Control - Click Here
- Insert multiple rows of data into one database table using parameters - Click Here
- Trigger USB/Serial Cash Drawer - Click Here
-
Oct 5th, 2014, 11:53 PM
#2
Re: accessing USB HID device
What are the other methods apart from Init available for device?
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
-
Oct 6th, 2014, 12:14 AM
#3
Thread Starter
Fanatic Member
Re: accessing USB HID device
the whole list (not just methods)
-Dispose
-Equals
-FeatureButtonCaps
-FeatureValueCaps
-GetHashcode
-GetType
-HidCaps
-Init
-InputButtonCaps
-InputValueCaps
-OutputButtonCaps
-OutputValueCaps
-ReadInputReport
-ReferanceEquals
-ToString
-WriteOutputReport
im assuming its got to do with writeoutputreport but it wants values that i have no idea on.......
My CodeBank Submissions
- Listbox with transparency and picture support - Click Here
- Check for a true internet connection - Click Here
- Open Cash drawer connected to receipt printer - Click Here
- Custom color and size border around form - Click Here
- Upload file to website without user logins, includes PHP - Click Here
- List All Removable USB Storage Devices - Click Here
- Custom On/Off Slide Control - Click Here
- Insert multiple rows of data into one database table using parameters - Click Here
- Trigger USB/Serial Cash Drawer - Click Here
-
Oct 6th, 2014, 03:38 AM
#4
Re: accessing USB HID device
Maybe it is WriteOutputReport(sss.something)?
Edit:
Not sure if Reading a Stamps.com USB Scale from C# will be of use or not? Yes, I know the code is in C# but you might see similarities between that and what you want to do.
Last edited by Nightwalker83; Oct 6th, 2014 at 03:54 AM.
Reason: Adding more!
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
-
Oct 6th, 2014, 06:47 AM
#5
Re: accessing USB HID device
why would it be write? wouldn't it be the read method? You want to READ the scale... no?
-tg
-
Oct 6th, 2014, 06:57 PM
#6
Re: accessing USB HID device
Originally Posted by techgnome
why would it be write? wouldn't it be the read method? You want to READ the scale... no?
The way I look at it is that the machine allows you to load the input back in to the machine and that is where "ReadInputReport" is used.
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
-
Oct 6th, 2014, 07:50 PM
#7
Thread Starter
Fanatic Member
Re: accessing USB HID device
well that method was part of someones libaray. I saw the stamps link before but couldnt compile a dll for mike obriens libaray but got an older version and managed to, so for all out there the libaray is at: https://github.com/mikeobrien/HidLibrary and the code i used is as follows
Code:
Imports HidLibrary
Public Class Form1
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Dim inData As HidDeviceData
Dim scale As HidDevice
Dim weight As Decimal
'USB\VID_0922&PID_8004
scale = HidDevices.Enumerate(&H922, &H8004).FirstOrDefault 'VID and PID from device manager
If scale IsNot Nothing Then
scale.OpenDevice()
inData = scale.Read(250)
weight = Convert.ToDecimal(inData.Data(4)) + (Convert.ToDecimal(inData.Data(5) * 255) + Convert.ToDecimal(inData.Data(5)))
ListBox1.Items.Add(weight)
scale.CloseDevice()
scale.Dispose()
End If
End Sub
End Class
Last edited by bensonsearch; Oct 6th, 2014 at 08:52 PM.
My CodeBank Submissions
- Listbox with transparency and picture support - Click Here
- Check for a true internet connection - Click Here
- Open Cash drawer connected to receipt printer - Click Here
- Custom color and size border around form - Click Here
- Upload file to website without user logins, includes PHP - Click Here
- List All Removable USB Storage Devices - Click Here
- Custom On/Off Slide Control - Click Here
- Insert multiple rows of data into one database table using parameters - Click Here
- Trigger USB/Serial Cash Drawer - Click Here
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|