# Logging - Part 2: Function Block Setup

### 1. Control Function Block:

The control [function block](https://docs.intrepidcs.com/vspy-3-documentation/3.9.12/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://2280262322-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC3KyOmcYmM6ZVd3OQDa1%2Fuploads%2FlrrxclN60q5nxiV3uXY0%2FappnotCMPartControl.gif?alt=media\&token=a6fdf79b-09d8-4134-870c-f37d7bd106bb)
