5-7
Largest Window Offset = (Record Size x Max Records) % 128.
Example:
Largest Window Index = Int([64 x 28928]/128) = Int(14464) = 14464.
Largest Window Offset = (64 x 28928) % 128 = 0.
6. Determine the ending Window Index and the ending Window offset using these formulas:
Ending Window Index = Int([Record Size x {Last Index + 1}]/128).
Ending Window Offset = (Record Size x [Last Index +1]) % 128.
Example:
Ending Window Index = Int([64 x {500 + 1}]/128 = Int(250.5) = 250.
Ending Window Offset = (64 x [500 + 1]) % 128 = 64.
7. Set the Window Mode to Download Mode by writing the Download Mode code (0000H) to the
Log Window Mode Register.
Example:
Write the value 0000H to the Window Mode for Historical Log 1, Register 38209.
8. Set the Window Index to the Starting Window Index.
Example:
Write the value 250 (00FAH) to the Historical Log 1 Window Index, Register 38145.
9. Read Window from starting offset to end of Window:
Starting offset = First Register of Window + (starting Window offset/2).
Example:
38273 + (64/2) = 38305.
Read from 38305 – 38356.
10. Increment the Window Index.
Example:
Write the value 251 (00FBH) to the Historical Log 1 Window Index, Register 38145.
11. Read the Window from beginning to end.
Example:
Read the Historical Log 1 Window from Register 38273 to 38336.
12. Repeat steps 10 and 11 until the largest or ending Window Index is reached.
—If the largest Window Index is reached, go to step 13.
—If the ending Window Index is reached, go to step 15.
Example:
If Window Index = 14464, go to step 13.
If Window Index = 250, go to step 15.