# Build the OnShutdown Task

The OnShutdown Task will be executed using the OnShutdown script, and a Notify PLC block will send the NDM NotifyAcquisitionDisabled signal to the PLC to disable the triggering of images by the camera.

Note: For more information, see the NDM Notification Functions and NDM Status Signals Descriptions topics.

1. Write the OnStartup script.

2. Double-click the OnShutdown script under the Scripting > Application node in the Project Explorer.

3. Enter the following script: $Tasks.OnShutdown.Run();
4. Add a Notify PLC block to the Task.
5. Configure the Selected Device property to the Cognex Communications Card or Vision Controller.

6. Set the Notification Method Type property to AcquisitionDisabled, as shown in the Notification Settings dialog below:

7. Set the Notify PLC block's input pin to the CameraIndex tag by right-clicking the pin and selecting Assign to Tag, which will launch the Tag Selector dialog, where you can select the CameraIndex tag.