# Script Type Function Block: Commands

The script in a [Script Type 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) consists of a series of commands that instruct Vehicle Spy to perform certain actions. Each step in the script consists of one command, a set of parameters (if needed) and an optional comment.

Table 1 contains a list of all of the available commands for function block scripts. Each row has a short description of the command and the parameters associated with it, and includes a link to a page containing full details.

**Table 1: Function Block Script Commands**

| **Command**                                                                                                                                                                                                                                                                       | **Description**                                                                                                                                                                                                                                                                                           | **Parameters (Value Column)**                                                                                                                                                            |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [**Clear History**](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-commands/script-type-function-block-command-clear-history)                 | Clears the message history.                                                                                                                                                                                                                                                                               | --                                                                                                                                                                                       |
| [**Clear Stats**](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-commands/script-type-function-block-command-clear-stats)                     | Resets the statistical data for messages or networks.                                                                                                                                                                                                                                                     | Selection of whether to clear stats for one message, stats for one network, or all stats.                                                                                                |
| [**Comment**](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-commands/script-type-function-block-command-comment)                             | Documents the script with an explicit comment.                                                                                                                                                                                                                                                            | --                                                                                                                                                                                       |
| [**CoreMini Action**](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-commands/script-type-function-block-command-coremini-action)             | Starts, stops, or downloads [CoreMini](https://docs.intrepidcs.com/vspy-3-documentation/3.9.12/vehicle-spy-main-menus/main-menu-tools/utilities-coremini-console) scripts (**.vs3cmb** files) that run in ICS hardware while disconnected from a computer.                                                | Action to perform, and for a download, the storage medium and CoreMini file to use.                                                                                                      |
| [**DAQ Action**](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-commands/script-type-function-block-command-daq-action)                       | Starts, stops, calls, saves data from, or waits for the completion of a [VehicleScape DAQ](https://docs.intrepidcs.com/vspy-3-documentation/3.9.12/vehicle-spy-main-menus/main-menu-measurement/vehiclescape-daq) Job.                                                                                    | Action to perform and DAQ job to act upon.                                                                                                                                               |
| [**Diag Job Action**](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-commands/script-type-function-block-command-diag-job-action)             | Starts, stops, calls, saves data from, or waits for the completion of the specified [Diagnostics](https://docs.intrepidcs.com/vspy-3-documentation/3.9.12/vehicle-spy-main-menus/main-menu-spy-networks/diagnostics/diagnostics-view) Job.                                                                | Action to perform and diagnostic job to act on.                                                                                                                                          |
| [**Else**](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-commands/script-type-function-block-commands-if-else-else-if-end-if)                | Marks the end of the commands executed when an **If** or **Else If** expression evaluates as **True**, and the start of those executed when that expression is **False**.                                                                                                                                 | --                                                                                                                                                                                       |
| [**Else If**](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-commands/script-type-function-block-commands-if-else-else-if-end-if)             | Combines an **Else** and **If** statement. Marks the end of the commands executed in a preceding **If** or **Else If** block, and the start of a new set of commands executed if a specified condition is **True**.                                                                                       | Conditional expression created with the [Expression Builder](https://docs.intrepidcs.com/vspy-3-documentation/3.9.12/shared-features-in-vehicle-spy/shared-features-expression-builder). |
| [**End If**](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-commands/script-type-function-block-commands-if-else-else-if-end-if)              | Marks the end of an **If / Else / Else If / End If** control logic structure.                                                                                                                                                                                                                             | --                                                                                                                                                                                       |
| [**End Loop**](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-commands/script-type-function-block-commands-start-loop-and-end-loop)           | Marks the end of a loop begun by the **Start Loop** command.                                                                                                                                                                                                                                              | --                                                                                                                                                                                       |
| [**Function Block Action**](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-commands/script-type-function-block-command-function-block-action) | Starts, stops, calls, triggers, or saves the data of a function block.                                                                                                                                                                                                                                    | Action to perform and function block to act upon.                                                                                                                                        |
| [**If**](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-commands/script-type-function-block-commands-if-else-else-if-end-if)                  | Starts an **If / Else / Else If / End If** conditional logic structure, specifying an expression that, if it evaluates as **True**, causes the following commands to be executed until an **Else**, **Else If** or **End If** command is encountered.                                                     | Conditional expression created with the Expression Builder.                                                                                                                              |
| [**Jump If**](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-commands/script-type-function-block-command-jump-if)                             | Jumps to a specified step in the script if a specified condition is **True**; otherwise, continues with the next sequential step.                                                                                                                                                                         | Step number and expression created with the Expression Builder.                                                                                                                          |
| [**Jump To**](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-commands/script-type-function-block-command-jump-to)                             | Jumps to a specified step in the script.                                                                                                                                                                                                                                                                  | Step number.                                                                                                                                                                             |
| [**Load Message Data**](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-commands/script-type-function-block-command-load-message-data)         | Loads hex data from a file into a transmit message.                                                                                                                                                                                                                                                       | File name, file start index, length, message name, message start index, and fast load option.                                                                                            |
| [**Log Data**](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-commands/script-type-function-block-command-log-data)                           | Logs selected data to a file or monitoring device.                                                                                                                                                                                                                                                        | File name, log type, data to log and optional parameters.                                                                                                                                |
| neoVI PRO Action                                                                                                                                                                                                                                                                  | (This command is deprecated.)                                                                                                                                                                                                                                                                             | --                                                                                                                                                                                       |
| [**Pause**](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-commands/script-type-function-block-command-pause)                                 | Displays a message to the user in a dialog box, then waits for a button click from the user to either continue or terminate the script.                                                                                                                                                                   | A message for the user, which is created using the Expression Builder.                                                                                                                   |
| [**Read Data**](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-commands/script-type-function-block-command-read-data)                         | Reads data from a specified location in a file and stores it into one or more application signals.                                                                                                                                                                                                        | Name of file, location in file to read from, and signal(s) to hold data.                                                                                                                 |
| [**Set Value**](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-commands/script-type-function-block-command-set-value)                         | Set the value of a signal in Vehicle Spy.                                                                                                                                                                                                                                                                 | Expression defining signal to be set and value to be assigned.                                                                                                                           |
| [**Set Value If**](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-commands/script-type-function-block-command-set-value-if)                   | Combines an **If** and **Set Value** into a single command, assigning a value to a signal or variable and executing the following commands if an expression evaluates as **True.** This command guarantees that no signal values will change between evaluating the expression and making the assignment. | Conditional expression and assignment expression.                                                                                                                                        |
| [**Show Panel**](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-commands/script-type-function-block-command-show-panel)                       | Displays a specified graphical panel.                                                                                                                                                                                                                                                                     | Graphical panel window and specific panel to show.                                                                                                                                       |
| [**Sleep**](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-commands/script-type-function-block-command-sleep)                                 | When run within a [CoreMini](https://docs.intrepidcs.com/vspy-3-documentation/3.9.12/vehicle-spy-main-menus/main-menu-tools/utilities-coremini-console) script, forces the network interface hardware into a sleep state.  Not valid for function blocks run in Vehicle Spy.                              | --                                                                                                                                                                                       |
| [**Start Loop**](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-commands/script-type-function-block-commands-start-loop-and-end-loop)         | Starts a loop of steps that are repeated a number of times.                                                                                                                                                                                                                                               | Number of iterations for the loop, which can be a simple integer or an expression.                                                                                                       |
| [**Stop**](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-commands/script-type-function-block-command-stop)                                   | Ends the function block.                                                                                                                                                                                                                                                                                  | --                                                                                                                                                                                       |
| [**Test DTC**](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-commands/script-type-function-block-command-test-dtc)                           | Tests a received J1939 message for DTCs and copies the DTC information to an application signal.                                                                                                                                                                                                          | Receive message to test, DTCs to look for, application signal to store the data, and other settings.                                                                                     |
| [**Text API**](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-commands/script-type-function-block-command-text-api)                           | Sends a Text API command.                                                                                                                                                                                                                                                                                 | Text API string created using the Expression Builder, optional application signal to receive the string and optional remote server.                                                      |
| [**Transmit**](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-commands/script-type-function-block-command-transmit)                           | Transmits a message.                                                                                                                                                                                                                                                                                      | Transmit message to send.                                                                                                                                                                |
| [**Wait For**](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-commands/script-type-function-block-command-wait-for)                           | Waits a specified amount of time before moving to the next step.                                                                                                                                                                                                                                          | Number of seconds to wait, specified either numerically or through an expression.                                                                                                        |
| [**Wait Until**](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-commands/script-type-function-block-command-wait-until)                       | Waits until the desired condition is **True**, then moves on to the next script step.                                                                                                                                                                                                                     | Expression created with the Expression Builder.                                                                                                                                          |
