Chapter 3 Developing Your ApplicationNI-DNET User Manual 3-10 ni.comStep 4. Stop CommunicationBefore you exit your application, stop communication to shut downDeviceNet connections to remote devices. Use the Interface Object tocall the ncOperateDnetIntf function with the Opcode parameter setto Stop.Step 5. Close ObjectsBefore you exit your application, close all NI-DNET objects using thencCloseObject function.Multiple Applications on the Same InterfaceThe NI-DNET software allows multiple NI-DNET applications to use thesame interface object simultaneously, as long as the interface configurationremains the same. For example, you can run both the SingleDeviceexample and SimpleWho on DNET0 as long as the Interface MacId,BaudRate, and PollMode parameters are the same in both applications(SimpleWho uses a PollMode of Scanned). Similarly, you can open uptwo copies of the SingleDevice example and communicate with twodifferent devices as if it were through a single application. These same rulesapply to the I/O Object and the Explicit Messaging Object.As long as all the configuration attributes are the same, any object can beopened multiple times. You can enable only one notification or wait(through ncWaitForState, ncCreateNotification, orncCreateOccurrence functions) for an object, no matter how manyhandles you have opened for that particular object. For example, if you arerunning two copies of the SingleDevice example on the same interfacewith the same connection types, the notification triggers in only oneapplication at a time.The synchronization of events and the protection of the object I/O data isthe responsibility of the application developer. Similarly, the applicationperformance might change based on the number of objects open and thefrequency of API calls made in each application. For example, several callsto ncGetDnetAttribute in one application might slow down anotherapplication running on the same interface.To ensure proper clean up of all the objects, each open call to an objectshould be matched by a close call to the same object, and each call toncOperateDnetIntf with NC_OP_START code should be matched bya call to the same function with NC_OP_STOP code.