ncOpenDnetExplMsg (Open DeviceNet Explicit Messaging)

NI-DNET Programmer

ncOpenDnetExplMsg (Open DeviceNet Explicit Messaging)

Purpose

Configure and open an NI-DNET Explicit Messaging Object.

Format

LabVIEW

C

NCTYPE_STATUS
ncOpenDnetExplMsg( NCTYPE_STRING	IntfName,
		 NCTYPE_UINT32	DeviceMacId,
		 NCTYPE_OBJH_P	ObjHandle);

Input

IntfName Name of DeviceNet interface
DeviceMacId MAC ID of the remote device

Output

ObjHandle Object handle you use with all subsequent function calls for the Explicit Messaging Object

Function Description

ncOpenDnetExplMsg configures and opens an NI-DNET Explicit Messaging Object and returns a handle that you use with all subsequent function calls for that object.

The Explicit Messaging Object represents an explicit messaging connection to a remote DeviceNet device. Since only one explicit messaging connection is created for a given device, the Explicit Messaging Object is also used for features which apply to the device as a whole.

Use the Explicit Messaging Object to do the following:

  • Execute the DeviceNet Get Attribute Single service on the remote device (ncGetDnetAttribute).
  • Execute the DeviceNet Set Attribute Single service on the remote device (ncSetDnetAttribute).
  • Send any other explicit message request to the remote device and receive the associated explicit message response (ncWriteDnetExplMsg, ncReadDnetExplMsg).
  • Configure NI-DNET settings that apply to the entire remote device.

Parameter Descriptions

IntfName

Description Name of the DeviceNet interface as an ASCII string with format "DNETx", where x is a decimal number starting at zero that indicates which DeviceNet interface is being used. You associate DeviceNet interface names with physical ports using Measurement & Automation Explorer (MAX).
Values "DNET0", "DNET1", ..."DNET31"

In LabVIEW, the interface name is selected from an enumerated list. The LabWindows/CVI function panel also provides an enumerated list.

DeviceMacId

Description MAC ID (device address) of the remote DeviceNet device.

Many devices use physical switches to set their MAC ID. For such devices, you can usually determine the device's MAC ID by examining those switches. MAC ID 63 is usually reserved for new devices (many devices use 63 as the factory default).

If you do not know the MAC ID of your DeviceNet device, NI-DNET provides a utility which can display the MAC ID for you. This utility, Configurator, is described in the NI-DNET User Manual.
Values 0 to 63

ObjHandle

Description If the ncOpenDnetExplMsg function is successful, a handle to the newly opened Explicit Messaging Object is returned in ObjHandle. This handle is used with all subsequent function calls for that Explicit Messaging Object.

The functions most commonly used with the Explicit Messaging Object are ncGetDnetAttribute and ncSetDnetAttribute.
Values The encoding of ObjHandle is internal to NI-DNET.

Examples

LabVIEW

Open an Explicit Messaging Object using interface "DNET2" and device MAC ID 15.

C

Open an Explicit Messaging Object using interface "DNET0" and device MAC ID 12.

NCTYPE_STATUS	status;
NCTYPE_OBJH	objh;
status = ncOpenDnetExplMsg("DNET0", 12, &objh);