Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Reading from DYMO scales

Featured Replies

Recently bought some DYMO M10 scales and wanted to grab the weight from them.

Turns out this is not as easy as you think talking to USB, but after a lot of crashing out and frustration I managed to get a proof of concept working, so here to share...

You will need hid4java and jna, best grabbing them from Maven

 

// ReadDYMO
// 17_02_28 JR
// v1.0
// read weight from Dymo M10 scales
//requires hid4java.jar and jna.jar

import org.hid4java.*
import org.hid4java.jna.*

import java.nio.ByteBuffer

// specifc to these scales
Short VENDOR_ID = 0x0922
Short PRODUCT_ID = 0x8003

Short raw_weight = 0
DATA_MODE_OUNCES = 11

message = new byte[8]

hidServices = HidManager.getHidServices()
devices = hidServices.getAttachedHidDevices()

dymo = hidServices.getHidDevice(VENDOR_ID, PRODUCT_ID, null)

if (dymo){
	val = dymo.read(message, 1000)
	dymo.close()
} //end if

hidServices.shutdown()

if (dymo){ 
	byte[] data = [ message[5], message[4] ]
	wrapped = ByteBuffer.wrap(data)
	raw_weight = wrapped.getShort()
	if ( message[2] == DATA_MODE_OUNCES ) { 
		scale = 10.power(message[3].toString().toShort())
		weight = (raw_weight * scale) + ' oz'
		oz = true
 	} else { 
		weight = raw_weight + ' g'
		oz = false	
	} //end if
	return weight
} else {
	return '0'
} //end if

 

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.