# Build the OnStartup Task

The OnStartup Task will be executed using the OnStartup script, and a Notify PLC block will send the NDM NotifyAcquisitionReady signal to the PLC, after the PLC has set the Trigger Enabled bit.

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

1. Write the OnStartup script.

   Note: For more information about the OnStartup script, see the Controlling the Startup State of a Deployed Project topic.

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

3. Enter the following script: $Tasks.OnStartup.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 AcquisitionReady, 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.