Roclink protocol

Hello, I use Roclink protocol to get some data from my Floboss 407 and have a question how to correctly send a query to the device to get data with opcode 130.  For example, I am wanna get the last 60 values from history. For this except "point number" and "number values requested"(hex 3C), I need "starting history pointer". How is get this "starting history pointer"?

For example query structure: unit(01) group(02) unit(03) group(01) opcode(hex82 dec130) length(05) ram area(00) point  number(FE) number values requested(3B) starting history pounter(0D 03) check sum(D6 E3) 

  • Hello Paul,

    The history memory works as a first-in-first-out (FIFO) queue. For the hourly history data, there are 840 entries in that queue. The "starting history pointer" is a number between 0 and 839, which says where you want to start collecting data from that queue. If you ask for a starting history pointer of 0 every time, you won't get the most recent records every time. Instead you must figure out where the pointer is for the most recently written entry (between 0 and 839).

    You learn what the current history pointer number through opcode 120. So before you can send the proper Opcode 130 request for history, you must first send an opcode 120 request to learn the current history pointer number. Then the history pointer is returned as offset 12, 14, or 16 (depending on RAM area) assuming hourly history. If getting daily history, there are other set of offsets from the opcode 120 response to parse.

    The details are in the ROC Protocol manual, at the link below. If you don't have a copy of this, please use it for a reference. Especially because it looks like there are specific rules, as it relates to different versions of FB407 firmware.