Chapter 4 NI-DNET Programming Techniques
© National Instruments Corporation 4-9 NI-DNET User Manual
Some device vendors provide comments about I/Oassemblies in an
Electronic Data Sheet (EDS). The EDS file is a text file whose format
is defined by the DeviceNet Specification.
Ask the device’s vendor if they have filled out a DeviceNet
compliance statement. This form is located at the front of the
DeviceNet Specification, and it provides information about the device,
including its I/O assemblies.
After you open an NI-DNET I/O Object and start communication, you use
the ncWriteDnetIO function to write an output assembly for a device and
the ncReadDnetIO function to read an input assembly received from a
remote device. Both of these functions access the entire assembly as an
array of bytes.
In most cases, the array of bytes for an input or output assembly contains
more than one value. In DeviceNet terminology, an individual data value
within an I/O assembly is referred to as a member.
Documentation for the members of an input or output assembly includes
the position of each member in the assembly (often shown as a table with
byte/bit offsets) and a listing of the attribute in the device that each member
represents (often shown as class, instance, and attribute identifiers). For
standard device profiles, the I/O assemblies are documented in the device
profile’s specification, and the actual attributes are documented in the
individual object specifications. Attribute documentation includes the
attribute’s DeviceNet data type and a complete explanation of its meaning.
As an example of I/O assembly documentation, consider the standard
ACDrive device profile. For this device profile, the DeviceNet
Specification defines an output assembly called Basic Speed Control
Output (Assembly Object instance20). This output assembly is used to
start/stop forward motion at a given speed and to reset faults in the device.
The bytes of this output assembly are shown in Figure4-6, and t he attribute
mapping is shown in Table4-1.
Figure 4-6. AC Drive Output Assembly, Instance20
Byte Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
000000Fault Reset 0 Run Fwd
100000000
2 Speed Reference (Low Byte)
3 Speed Reference (High Byte)
Byte Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
000000Fault Reset 0 Run Fwd
100000000
2 Speed Reference (Low Byte)
3 Speed Reference (High Byte)