- Download 58
- File Size 157.18 KB
- File Count 1
- Create Date May 2, 2016
- Last Updated August 11, 2016
Background target example
Normally if you would like to show 10 targets on the screen at once you would have to send 10 VCodes at a time each cycle. This is not much of a problem, but now imagine you would like to show 30 targets at a time, this can be a bit cumbersome. The "show target in background" block helps get around this. A background target is one that is always shown in its "current" state until you send a new command that overrides the current state. Background VCodes are the same as normal VCodes except for 2 small things:
The target type is (normal target type + 100). i.e. a circle is 101.
There is an ID with the VCode that can be 1-1500. This is how you interact and change your permanent target states.
This sample task makes use of the "set target in background" block. The example protocol defines 30 targets of which 10 are shown at a time. When a target is touched its color changes. This is meant purely as an example of how to properly use background targets that are defined in your target table.
The example is made with MATLAB 2013a and compiled for Dex 3.5
P.S. For some reason this task can take a very long time to compile (5+ minutes on my machine that normally takes 1-2 minutes to compile a task)