How to develop UHF reader in Google chome browser

Time:2019-12-10

Google Chrome doesn’t support OCX, so it can’t connect UHF reader and writer through OCX. It can only use RFID reader and writer cloud service plug-in to connect and operate UHF reader and writer yw-602h through JavaScript language. RFID reader cloud service plug-in supports not only Chrome browser, but also Firefox, ie, Safari, opera and other mainstream browsers.

There are the following interfaces under javascript:

1. UHF card reader search, card and label conforming to 18000-6c, G2

 G2_Inventory(isEPC)

2. Read the memory area of UHF label

 G2_Read(memType,StartPos, ReadLength,FormatID)

3. Memory area for UHF label writing

 G2_Write(memType,StartPos,FormatID, Data)

4. Rewrite UHF label EPC

G2_WriteEPC(EPCData)

5. Destroy UHF label

G2_KillTag()

6. Set UHF label memory protection

G2_SetProtected(ProtectByte, ProtectMode)

7. Erase the memory area of UHF label

G2_Earse(memType,StartPos, EarseLength)

8. Set UHF label reading protection

G2_SetReadProtected()

9. Unlock UHF label read protection

G2_SetUnlockReadProtected()

10. Set UHF label EAS alarm

G2_SetEASAlert(EAS)

11. Lock UHF label user area

G2_LockUser(UserAddr)

The calling code is also very simple. Only one line of code is needed to find the card. JavaScript script is used:
function G2Inventory()
{
var isEPC;
isEPC = 1
rfidreader.Repeat=0;
rfidreader.G2_Inventory(isEPC);
}
 

 

Callback return result:
rfidreader.onResult(function(resultdata)
{
switch(resultdata.FunctionID)
    {
    
case 14:
        document.getElementById("CloudReaderVer").value = resultdata.strData;
        break;
case 23:
 
if(resultdata.Result>0)
{
            document.getElementById("CardNo").value = resultdata.CardNo;
}
else
{
document.getElementById("CardNo").value= GetErrStr(resultdata.Result);
}
break;
    }
}
);