Im trying to read data from the DS1923 Ibutton throgh the DS9490 USB adapter, and i think is not reading anything beacause all i get is 0xFF.. heres the code, can someone tell me what is wrong in the syntaxis?
outBuffer = new byte[size];
adaptador.Reset();
GeneralDelay(100);
bool get = adaptador.SelectDevice(DalSemi.OneWire.Utils.Convert.ToByteArray(device)); // Match ROM
byte[] dataPacket = new byte[11+size];
byte[] pass = DS1923_SendPass(missionParam.ReadAccess_Pass);
dataPacket[0] = DS1923_cmdReadmemory; //Comand
dataPacket[1] = (byte)addressStart; //Address from wich I want to Read
dataPacket[2] = (byte)(addressStart >> 8);
for (int i = 0; i < pass.Length; i++) // filling with the password
dataPacket[i + 3] = (byte)pass[i];
for (int i = 0; i < size; i++)
dataPacket[i + 11] = (byte)0xff; //bytes where from the read command will be written
for( int i = 0; i<3;i++)
adaptador.DataBlock(dataPacket, 0, 11+size);
for (int i = 0; i < size; i++)
{
outBuffer[i] = dataPacket[i+11];
MessageBox.Show(outBuffer[i] + "");
}
adaptador.Reset();
}
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Im trying to read data from the DS1923 Ibutton throgh the DS9490 USB adapter, and i think is not reading anything beacause all i get is 0xFF.. heres the code, can someone tell me what is wrong in the syntaxis?
outBuffer = new byte[size];
adaptador.Reset();
GeneralDelay(100);
bool get = adaptador.SelectDevice(DalSemi.OneWire.Utils.Convert.ToByteArray(device)); // Match ROM
byte[] dataPacket = new byte[11+size];
byte[] pass = DS1923_SendPass(missionParam.ReadAccess_Pass);
dataPacket[0] = DS1923_cmdReadmemory; //Comand
dataPacket[1] = (byte)addressStart; //Address from wich I want to Read
dataPacket[2] = (byte)(addressStart >> 8);
for (int i = 0; i < pass.Length; i++) // filling with the password
dataPacket[i + 3] = (byte)pass[i];
for (int i = 0; i < size; i++)
dataPacket[i + 11] = (byte)0xff; //bytes where from the read command will be written
for( int i = 0; i<3;i++)
adaptador.DataBlock(dataPacket, 0, 11+size);
for (int i = 0; i < size; i++)
{
outBuffer[i] = dataPacket[i+11];
MessageBox.Show(outBuffer[i] + "");
}
adaptador.Reset();
}
Hello,
Sorry for the late reply. Check that you are following the correct command sequence, you can find it in the Datasheet for the device.
https://www.ibuttonlink.com/products/ds1923?_pos=1&_sid=752b0b9f3&_ss=r