beautypg.com

National Instruments NI-DNET User Manual

Page 26

background image

Chapter 3

Developing Your Application

© National Instruments Corporation

3-7

NI-DNET User Manual

Figure 3-1. General Programming Steps for an NI-DNET Application

1. Open Interface object
2. Open all I/O and Explicit Messaging (EM)

objects required for your application

3. Call ncSetDriverAttr, if needed

Start communication

Your DeviceNet Application:
• Write output data
• Wait for available input data
• Read input data
• Get or Set DeviceNet Attribute
• Open/Close any new I/O or EM

connection if the interface PollMode
is not equal to NC_POLL_AUTO

Stop communication

Yes

No

1. Close I/O and EM objects.
2. Close the Interface object.

Start

End

Finished?