Справочник Пользователя для National Instruments NI-DNET

Скачать
Страница из 86
Chapter 4
NI-DNET Programming Techniques
© National Instruments Corporation
4-9
Some device vendors provide comments about I/O assemblies 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 
AC Drive device profile. For this device profile, the DeviceNet 
Specification defines an output assembly called Basic Speed Control 
Output (Assembly Object instance 20). 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 Figure 4-6, and the attribute 
mapping is shown in Table 4-1.
Figure 4-6.  AC Drive Output Assembly, Instance 20
Byte
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
0
0
0
0
0
0
Fault Reset
0
Run Fwd
1
0
0
0
0
0
0
0
0
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
0
0
0
0
0
0
Fault Reset
0
Run Fwd
1
0
0
0
0
0
0
0
0
2
Speed Reference (Low Byte)
3
Speed Reference (High Byte)