www.vtiinstruments.com
EX1629 Onboard Memory
335
successful). If this value is not “07” on the device, or if a number other than 07 is passed in, it is
assumed that the communication with this device was accidental and the copy will not occur.
Please refer to the DS2431 data sheet for more information on the ES register.
Here is some more example MLAN output:
sent packet without errors
Packet length: 12
0B 82 0A 05 04 55 00 00 07 0B 01 82
got a packet without errors on receive
Packet length: 9
08 82 00 0A 04 55 00 00 07
READ_MEMORY_2431
Since the EX1629 can only read a buffer roughly corresponding to the size of the DS2430
memory and the DS2431 has almost five times that amount, reads of the DS2431 must be done in
segments. The read is actually done by making four calls to Send and Receive. If a larger receive
buffer were present, fewer calls could be made by increasing the returned data.
int read_memory_2431(int channel)
{
int sendLen, recLen = 0;
int totRecLen = 0;
int i = 0;
for (i=0; i< (((float)DS2431_MEMORY_LEN) /
((float)EX1629_MAX_TEDS_READ)) ; i++)
{
sendLen = 1; // reserve first byte for length
// access the current device with address in DATA_ID
SendPkt[+] = CMD_ML_ACCESS;
// construct a block of communication to MicroLAN
SendPkt[+] = CMD_ML_DATA;
SendPkt[+] = 4; // block length
SendPkt[+] = (2+EX1629_MAX_TEDS_READ); // data length
with 32 bytes of reads
// send the read memory command
SendPkt[+] = READ_MEMORY;
// send the address byte
SendPkt[+] = (i * EX1629_MAX_TEDS_READ);
SendPkt[+] = 0;
// request the result buffer as the last command
SendPkt[+] = CMD_GETBUF;
// set the length
SendPkt[0] = sendLen - 1;
// send and receive the frame
MLanHostPacketSend(SendPkt, channel);
recLen = MLanHostPacketReceive(RecPkt, channel,
MLAN_PACKET_SIZE);
to=recLen;
}
return totRecLen;
}
Each command is similar to the READ_MEMORY command for the DS2430. The only real
difference is the extra address field for offset, which is set to (i* EX1629_MAX_TEDS_READ).
This creates a loop through that increases the offset by 32 each time, and continues until the entire
memory is read. Once the end of the memory is reached, the device returns all “FF” bytes.
Содержание EX1629
Страница 310: ...VTI Instruments Corp 310 EX1629 Command Set...
Страница 342: ...VTI Instruments Corp 342 EX1629 Onboard Memory...