# Logging - Part 2: Function Block Setup

### 1. Control Function Block:

The control [function block](https://docs.intrepidcs.com/vspy-3-documentation/3.26.2/vehicle-spy-main-menus/main-menu-scripting-and-automation/function-blocks/function-blocks-types/script-type-function-block) is a script that will tell the capture function block to change partitions when the trigger condition is met.  There are a number of ways to do this script.  The basic functionality would be to:<br>

1. Set your index
2. Wait for condition to change partition
3. Change partition
4. Make sure you are accessing a valid partition

The script in the example is shown below.&#x20;

![](https://content.gitbook.com/content/IBP8B63pA3aIRGlHBRyH/blobs/Z66bPmx5IhPPlaGl2OT1/appnotCMPartControl.gif)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.intrepidcs.com/vspy-3-documentation/3.26.2/application-notes/application-note-coremini-partition-logging/logging-part-2-function-block-setup.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
