Script Type Function Block

Script type function blocks let you create custom programs in Vehicle Spy.  Your script - think of it as a recipe or a list of steps - can transmit messages, wait for events, and change things.  Potential uses for this function block include simulation, diagnostics, and automated testing.  Vehicle Spy also has various debugging features to help find and remove any problems in your scripts.

Scripts are created in the Scripting and Automation -> Function Blocks view.  Click the "+" button and select the Script function block type at the top of Function Blocks view to create a new function block.  You can give your function block a name in the description column .  This is very useful in situations that require multiple function blocks. 

Your script consists of a sequence of steps.  You may use as many steps as you need.  On each step you may enter one command.  Double click in a blank field in the Description column for a drop down menu containing all available commands.  After you choose a command in the Description column, the field directly adjacent in the Value column will update to display the final setup procedure for the step.

If you add too many steps, get them out of order, or need to copy and paste a step you will be using multiple times, you can use the row of buttons just above the script grid .  These buttons include "Insert Step After", "Insert Step Before", "Delete", "Copy", and "Paste".

The button located to the right of the paste button controls script display tracking.  When enabled, the script step display area will scroll itself to track the current script step being run.  This feature can be useful for large scripts that are unable to have all steps displayed at once. 

A thin colored line left of the step numbers helps to indicate which steps have been edited (green) or have been run (red).  Keep in mind that Vehicle Spy will start executing commands at step 1 and continue executing them until a Stop command is reached. 

As an example, Figure 1 shows a script that will wait for a certain signal value, transmit a message, clear stats, and start over again.



Figure 1: The Script function block lets you create custom programs in Vehicle Spy.

  Vehicle Spy Documentation - (C) Copyright 1997-2011 Intrepid Control Systems, Inc.

Last Update: Monday, August 23, 2010