Forums › Forums › General Discussions › How to read the temperature code RFM200-AFR using NordicID API
Tagged: Nordic ID, RFM3200-AFR, temperature
- This topic has 1 reply, 2 voices, and was last updated 1 year, 3 months ago by
Gabe Seitz.
-
AuthorPosts
-
July 26, 2019 at 2:23 am #1919
I tried to follow the coding example for the Nordic ID reader from the AN002F40 application note as closely as I could, but there’s never any temp code data returned. I’m using the Nordic ID java api and not the C# api used in the application note example. Can you point out which step I’m not coding correctly?
public void readTempByEpc( byte[] epc ) {
String epcString = NurApi.byteArrayToHexString( epc );CustomExchangeParams tempSelect = new CustomExchangeParams();
tempSelect.bitBuffer = new byte[ NurApi.MAX_BITSTR_BITS / 8 ];try {
int txLen = 0;
txLen = NurApi.bitBufferAddValue( tempSelect.bitBuffer, 0xA, 4, txLen );
txLen = NurApi.bitBufferAddValue( tempSelect.bitBuffer, 0x0, 3, txLen );
txLen = NurApi.bitBufferAddValue( tempSelect.bitBuffer, 0x1, 3, txLen );
txLen = NurApi.bitBufferAddValue( tempSelect.bitBuffer, 0x3, 2, txLen );
txLen = NurApi.bitBufferAddEBV32( tempSelect.bitBuffer, 0xE0, txLen );
txLen = NurApi.bitBufferAddValue( tempSelect.bitBuffer, 0x0, 8, txLen );
txLen = NurApi.bitBufferAddValue( tempSelect.bitBuffer, 0x0, 1, txLen );
tempSelect.txLen = txLen;
tempSelect.asWrite = true; tempSelect.txOnly = true; tempSelect.noTxCRC = false;
tempSelect.rxLen = 0; tempSelect.rxTimeout = 20; tempSelect.appendHandle = false;
tempSelect.xorRN16 = false; tempSelect.noRxCRC = false; tempSelect.rxLenUnknown = false;
tempSelect.txCRC5 = false; tempSelect.rxStripHandle = false;NurInventoryExtended invExParams = new NurInventoryExtended();
invExParams.inventorySelState = 0;
invExParams.inventoryTarget = 0;
invExParams.Q = 0;
invExParams.rounds = 5;
invExParams.session = NurApi.SESSION_S0;new NurCmdInvReadConfig( true, NurApi.IRTYPE_EPCDATA, NurApi.BANK_PASSWD, 0xE, 1);
for( int cycle = 1; cycle <= 20; cycle++ ) {
api.inventory( 1, 1, 0 );
api.clearIdBuffer( true );
api.setExtendedCarrier( true );api.customExchangeByEpc( epc, tempSelect );
Thread.sleep( 3 );
System.out.println( “Read attempt ” + cycle );api.inventorySelectByEpc( 0, 0, 0, false, epc, epc.length );
api.fetchTags( true );
for (int n=0; n<api.getStorage().size(); n++) {
NurTag tag = api.getStorage().get(n);int tempCode = -1;
if( tag.getIrData() != null ) {
System.out.println( “SUCCESS” );
tempCode = tag.getIrData()[0] * 256 + tag.getIrData()[1];
}
System.out.println(String.format(“tag[%d] EPC ‘%s’ RSSI %d TempCode %Xh”, n, tag.getEpcString(), tag.getRssi(), tempCode));
}
}api.setExtendedCarrier( false );
api.clearIdBuffer( true );} catch( Exception e ) {
e.printStackTrace();
}}
0November 26, 2019 at 6:12 pm #2104Hi Daniel,
There’s many possible things that can be wrong, however we recently released complete sample code for Nordic ID fixed readers.
Check it out here: https://github.com/Axzon/reader-sample-code.
Best,
Gabe
0 -
AuthorPosts
- You must be logged in to reply to this topic.