# Add the Script Block and References

With the Marking output pin in place on your ViDi Sub Task block, to access the data, a Script block must be used. Before the Script block can access the Marking data, the appropriate References must be added.

Tip: If you will have multiple Script blocks accessing ViDi Tool Block data, every Script block will need to have the same References. To make this process easier, consider creating a Script block as a Template. For more information, see the Templates topics in the Cognex Designer Help file.

1. In the Task containing the ViDi Sub Task block, add a Script block.

2. Drag the Marking output pin onto the Script block to automatically create the input pin for the Script block.

   The auto-pin creation will also automatically assign the correct data type to the pin, as well as initialize the Script block.

3. Double-click the Script block to access the Script Editor and the Properties of the Script block.

4. In the Script block's Properties, press the ... button to edit the References, which launches the Script References dialog.

5. From the Script References dialog, add the ViDi.NET.Interfaces.dll (DeepLearning Vision section) and the WindowsBase.dll (System section) to the Local References.

6. Press the Accept button to close the Script References dialog.

Tip:

If you are missing a reference, when you compile the script, you will get an error message alerting you to the specific reference that is missing.