Chapter 4 NI-DNET Programming TechniquesNI-DNET User Manual 4-12 ni.com2. Initialize the array to all zero.for (I = 0; I < 4; I++)OutputAsm [I] = 0;3. Assume you have two boolean variables, RunFwd and ResetFault,of type NCTYPE_BOOL. For LabWindows/CVI, these variables couldbe accessed from front panel buttons. The following code inserts theseboolean variables into OutputAsm.if (RunFwd)OutputAsm [0] |= 0x01;if (FaultReset)OutputAsm [0] |= 0x04;4. Assume you have an integer variable SpeedRef of typeNCTYPE_INT16. For LabWindows/CVI, this variable could beaccessed from a front panel control. The following code inserts thisinteger variable into OutputAsm.*(NCTYPE_INT16 *)(&( OutputAsm[2])) = SpeedRef;5. Write the output assembly to the remote device.status = ncWriteDnetIO(objh, sizeof(OutputAsm),OutputAsm);For information on NI-DNET’s C language data types and their equivalentDeviceNet data types, refer to Chapter 1, NI-DNET Data Types, of theNI-DNET Programmer Reference Manual.Using Explicit Messaging ServicesThe NI-DNET Explicit Messaging Object represents an explicit messagingconnection to a remote DeviceNet device. You use ncOpenDnetExplMsgto configure and open an NI-DNET Explicit Messaging Object.The following sections describe how to use the Explicit Messaging Object.Get and Set Attributes in a Remote DeviceNet DeviceThe two most commonly used DeviceNet explicit messages are the GetAttribute Single service and the Set Attribute Single service. These servicesare used to get or set the value of an attribute contained in a remote device.The easiest way to execute the Get Attribute Single service on a remotedevice is to use the NI-DNET ncGetDnetAttribute function. The