11: Monitor
Filtering
Figure 11-10 Monitor Filtering (1 of 2)
The response to each poll will be sliced up according to your filter rules. The objective is to simply slice enough so you can subsequently point to the data fields you want to mine.
Note the raw data in the grey box above; it reflects what was received from the serial device. See "Uptime" in the top right
STEP 1 - STRATEGY
Carefully examine the form of the response you received from a particular poll. Look for cues in the response to locate your desired information. Consider if the form of the response might have variations depending on the serial device state.
STEP 2 - SETUP
Use Monitor Explorer or directly configure settings in Monitor Filter Configuration. Rules are performed sequentially, but note that you can point each Rule to either the raw source (0) or a result of a previous rule (R.f). Each rule (R) slices the raw input into multiple fields (f), so with a dot between them (R.f) you are selecting a particular sliced result from a Rule.
STEP 3 - TEST
Testing is rapid and simplified using Monitor Explorer. You can see the response data sliced into pieces right in your browser windows.
Sample Configuration |
| |
First slice the response into lines, point to the one | Figure | |
containing Uptime, then slice between the caption | ||
| ||
and the time value. |
|
Setup as follows:
-We could see the Carriage Return / Line Feed sequence in our raw source.
-Rule 1 points to the raw source (Source 0), Mode = Delimiters, Delimiter 1 Binary String = "[0x0d 0x0a]".
-We can see our Uptime is in the sixth field.
-Rule 2 dices that field (Source 1.6) further, to split the caption from the value.
-We see that a colon (:) separates the caption from the data, but the data also contains colons.
-Rule 2 Mode - Delimiters, Delimiter 1 Binary String = " :" (that's a space followed by a colon). We use the space so it will match the transition from caption to value, but not match within the Uptime value itself.
Testing with this, confirm that the desired data is contained in a single field.
xPico® | 62 |