The OW-SERVER v2 supplies the DS2423's external counter data by default within the Details.XML file. However, using the low level commands gives the programmer greater flexibility in when (and how) the device is read. This knowledge base article discusses how to work with the DS2423 external counters and an OW-SERVER v2 bus master using the low level commands.
The general process for interacting with the DS2423 Counter is as follows:
- Discover the device
- Read the results
- Parse the results
- Reading count data
The following is an annotated example of the specific commands to send and typical responses received from the OW-SERVER v2 to accomplish the steps above. In the examples below, TX= data transmitted to the OW-SERVER v2, and RX= data received from the OW-SERVER v2.
The datasheet for the DS2423 can be downloaded from here:
Discover the Device
In this example, the DS2423 is the only device on the channel 1 of the OW-SERVER v2.
TX- R1 | Reset the bus on port 1. |
RX- P | Presence Pulse received. |
TX- S1 | Performs a standard device search on port 1. |
RX- 9000000004A4661D | The ROM Id of the DS2423 is received. ROM Ids for the DS2423 will always end with same family code "1D". |
Reading the External Counter
TX- R1 | Reset the bus on port 1. |
RX- P | Presence Pulse received. |
TX- A19000000004A4661D | Address the DS2423 having ROMId 9000000004A4661D on port 1. |
RX- + | Command accepted. |
TX- W1A5DF01FFFFFFFFFFFFFFFFFFFFFF | Write Block of data: A5DF01FFFFFFFFFFFFFFFFFFFFFF |
RX- A5DF01000F7B33000000000037A4 | Response includes Input Counter A. |
TX- R1 | Reset the bus on port 1. |
RX- P | Presence Pulse received. |
TX- A19000000004A4661D | Address the DS2423 having ROMId 9000000004A4661D on port 1. |
RX- + | Command accepted. |
TX- W1A5FF01FFFFFFFFFFFFFFFFFFFFFF | Write Block of data: A5FF01FFFFFFFFFFFFFFFFFFFFFF |
RX- A5FF01008204000000000000DE99 | Response includes Input Counter B. |
Parse the results
The responses from the previous Write Blocks contain the Input data:
Input A
A5DF01000F7B33000000000037A4
A5 DF01 00 0F7B3300 00000000 37A4
A5 = Read Memory + Counter (page 8 on DS2423 Spec Sheet)
DF01 = Indicate the first byte to be read
00 = Last Byte on page 14
0F7B3300 = Counter A
37A4 = CRC
Input B
A5FF01008204000000000000DE99
A5 FF01 00 82040000 00000000 DE99
A5 = Read Memory + Counter (page 8 on DS2423 Spec Sheet)
FF01 = Indicate the first byte to be read
00 = Last Byte on page 15
82040000 = Counter B
DE99 = CRC
Reading Count Data
The count data is organized least significant byte first.
Input A | LSB first 0x0F7B3300 = MSB first 0x00337B0F = 3373839 Decimal |
Input B | LSB first 0x82040000 = MSB first 0x00000482 = 1154 Decimal |
Comments
0 comments
Article is closed for comments.