www.vtiinstruments.com
APPENDIX C
105
// retrieve the response
CComSafeArray<
short
> ReadBuf;
SAFEARRAY* psaReadBuf;
digitizer->Channels->Item[name]->TEDS->ReadTEDS(&psaReadBuf);
std::cout <<
"DS2430 Write & Copy Scratchpad (ReadData)"
<<
std::endl;
ReadBuf.Attach(psaReadBuf);
PrintPacket(ReadBuf);
recLen = (
int
)ReadBuf.GetCount();
return
recLen;
}
If one looks closely, it becomes obvious that the WRITE_AND_COPY command is simply a
WRITE and a COPY command combined. There are multiple block length and data length bytes,
multiple commands, and all operations are performed that each of these commands did individually.
However, since they are issued in a single MLAN buffer, the device will not be powered down and
will not have a chance to lose its volatile data.
The example output of the WRITE_AND_COPY command is fairly long, but, like the code that
generates it, is very similar to an amalgamation of the WRITE_SCRATCHPAD and
COPY_SCRATCHPAD commands.
sent packet without errors
Packet length: 49
30 82 0A 23 24 0F 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11
12 13 14
15 16 17 18 19 1A 1B 1C 1D 1F 20 21 82 0A 03 02 55 A5 0B 01 82 85
got a packet without errors on receive
Packet length: 47
2E 82 00 0A 24 0F 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11
12 13 14
15 16 17 18 19 1A 1B 1C 1D 1F 20 21 FF FF 82 00 0A 02 55 A5
DS2431
C
OMMANDS
The DS2431 has the same command set as the DS2430, but some of the commands are different
and some give more arguments to the MLAN controller. Examples of these difference can be seen
in the TEDS example program included with the Digitizer or DSA driver.
A
DDITIONAL
N
OTES
Checksums
It should be noted that a “page” in the main memory of 1-wire device consists of 32 bytes according
to the IEEE 1451.4 specification. Each page of memory is supposed to have a one-byte checksum
as the first bit, which when added to the other 31 bits in the page (dropping any carry) makes the
result 0. In the example code there are no checks made to ensure that the user inserts a checksum
properly. If the user wishes to implement checksums (and, therefore, be fully compliant with the
IEEE 1451.4 standard), a proper checksum should be written to the first page of memory, updated
when memory is updated, and the checksums should be calculated and verified on reads.
Printing Packets
The function that prints the packet is called from the sender & receiver, just to make it easier to
determine which (sender vs. receiver) was doing the printing. Here is the code for the PrintPacket
function.
void
PrintPacket(CComSafeArray<
short
> buf)
Содержание EMX-4016B
Страница 6: ......
Страница 7: ...www vtiinstruments com Introduction 7 ...
Страница 83: ...www vtiinstruments com APPENDIX B 83 Figure 4 429 EMX 4016B Break Out Box Figure 4 30 EMX 4016M Break Out Box ...
Страница 84: ...VTI Instruments Corp APPENDIX B 84 Figure 4 31 EMX4016B Outline Drawing Figure 4 32 Drawing Represent ...
Страница 116: ......