Electronic Scale ================== 1.Electronic scale information +++++++++++++++++++++++++++++++++++++ .. list-table:: Electronic scale information table :widths: 20 20 :header-rows: 1 * - Host Model - D1w * - Measuring range - 100g-15kg/30kg(Double range) * - Certified division value - 5g/10g * - Safe overload (%FS) - 120 * - Destroy overload (%FS) - 150 * - Working temperature (℃) - -10℃~40℃ * - Working humidity - 10%~85% No condensation * - Creep(%FS/30min) - +-0.02 * - Equipment dealer/model - W23 * - Porter rate - 9600 * - Access mode - Serial(/dev/ttyS4) 2. Measurement quantity related basic knowledge +++++++++++++++++++++++++++++++++++++++++++++++++ **Boot zero point/zero clearing** After the power on of the electronic scale weighing AD system, read the weight quantity signal and save it as the reference point of boot, namely the boot zero point. **Manual zero clearing** After the electronic scale has obtained the boot zero point, if an article with a range less than 2% of full range is placed on the scale pan, it can be cleared with a command, with a weight quantity of 0. **Tare weight** Tare weight is applied for goods with package. The weight quantity of the package should be excluded when calculating the price. At this time, you may first place the package onto the scale pan, conduct the tare removal operation. Then the weight quantity of the package is namely tare weight. You may also directly input the set package tare weight without weighing. **Weigh with tare removal** It is operated by weighing in and out. Packing the goods on the weighing plate, as a slave weight removed, the net weight should be 0, the slave weight should be the packing weight. **Digital tare removal** Tare removal operation with direct setting input without weighing 3.Electronic scale software development ++++++++++++++++++++++++++++++++++++++++ The method of application ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `Link Electronic scale sdk downloads `_ Binding the electronic scale service to obtain relevant data for the electronic scale **Initialization** Open the serial port and obtain the net weight and state of the electronic scale by means of an interface callback .. code-block:: xml :linenos: :emphasize-lines: 0 Electronic mElectronic = new Electronic.Builder() //default path .setDevicePath(“/dev/ttyS4”) //default porter rate .setBaudrate(9600) .setReceiveCallback(new ElectronicCallback { @Override public void electronicStatus(String weight, String weightStatus) { //Callback in child thread ... }}) .builder() .. list-table:: Electronic Parameters :widths: 15 30 :header-rows: 1 * - Parameters - Description * - Weight - Unit(kg) * - scale state - 46:overweight, 53:Normal, 55:unstable, 56:Successful manual peeling, 57: Failure of manual peeling Get the function of zero clearing and peeling of electronic scale by direct calling method * **zero clearing** *mElectronic.turnZero()* * **Weigh with tare removal** *mElectronic.removePeel()* * **Manual peeling** *mElectronic.manualPeel(int peelWeight)* * **Turn off the electronic scale** *mElectronic.closeElectronic()* Hybrid uses WebView to call the scale ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `Demo source code `_ JavaScript API to call the scale ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ iMin provides electronic scale service plug-in, users can search for iMinprinter plug-in through iMin App Store, download and install, and print web content through the browser using the electronic scale function. Demo Case(You can open your chrome browser and enter the URL below to experience.) https://mp.imin.sg/ElectronicScale/index.html Use JavaScript API Establishing a connection can be done in the following 3 steps: 1. Download the JS library file `Download the JS library `_ 2. Add the js file to your project 3. Initialize the connection 1. Get the scale weight Function:void electronicScaleGetWeight() .. code-block:: java :linenos: :emphasize-lines: 8 //Initialize the connection var IminPrintInstance = new IminPrinter(); IminPrintInstance.connect().then(async (isConnect) => { if (isConnect) { var weight = 0; // Get the scale weight IminPrintInstance.electronicScaleGetWeight(function (data) { // alignmentMode Scale status code: 53=normal; 46=overweight; 55=No Stable Weight // weight The weight of the item that the scale currently weighs if (data.alignmentMode === 53) { weight = data.weight; console.log('weight:'+ weight); } else { if (data.alignmentMode === 46) { console.log('Exceeding maximum weight'); } else { console.log('The state is unstable'); } } }) } }) parameter: alignmentMode --> Scale status code: 53=normal; 46=overweight; 55=No Stable Weight weight --> The weight of the item that the scale currently weighs 2. Electronic scale peeling Function:void electronicScaleRemovePeel() .. code-block:: java :linenos: :emphasize-lines: 1 IminPrintInstance.electronicScaleRemovePeel(); 3. Zero the electronic scale Function:void electronicScaleTurnZero() .. code-block:: java :linenos: :emphasize-lines: 1 IminPrintInstance.electronicScaleTurnZero(); 4. End of weighing Function:void electronicScaleEnd() .. code-block:: java :linenos: :emphasize-lines: 1 IminPrintInstance.electronicScaleEnd();