The Generic Device profile according to Volume 1 Chapter 6 of the CIP NETWORKS LIBRARY does not specify any specific instances of the Assembly Object or the type of application objects necessary for device operation. This portion of the device profile must be supplied by the product developer and in this example focuses on digital I/O functionality via an LED array available on the evaluation board. The Generic Device example does not discuss CIP Sync functionality.
As such the Generic Device is commonly used for vendor-specific device implementation that do not match any of the standard profiles specify by ODVA.
The profile specific elements of this example are implemented in deviceProfiles\genericDevice\app_generic_device.c
with board specific functionality located in appNV.c
and below board\am64x-evm\freertos
.
In EI_APP_GENERIC_DEVICE_cipGenerateContent() the Generic Device example creates a vendor-specific object with Class ID 0x70 and Instance ID 0x01. Within instance 0x01 the creation of the following attributes with different data types is demonstrated. As Attribute IDs values from the Vendor Specific range between 0x300 - 0x4FF are used, see also Table 4-10.6 Instance Attribute ID Range in Volume 1.
Attribute ID | Name | Data Type | Value |
---|---|---|---|
0x300 | Input1 | USINT | Default: 0x00 Note that as the attribute value from the output parameter 0x308 is mirrored onto the input parameter 0x300 in EI_APP_GENERIC_DEVICE_run, the value that is read is actually 0x08. |
0x301 | Input2 | USINT | Default: 0x01 Note that as the attribute value from the output parameter 0x309 is mirrored onto the input parameter 0x301 in EI_APP_GENERIC_DEVICE_run, the value that is read is actually 0x09. |
0x302 | Input3 | USINT | Default: 0x02 Note that as the attribute value from the output parameter 0x30A is mirrored onto the input parameter 0x302 in EI_APP_GENERIC_DEVICE_run, the value that is read is actually 0x0A. |
0x303 | Input4 | USINT | Default: 0x03 Note that as the attribute value from the output parameter 0x30B is mirrored onto the input parameter 0x303 in EI_APP_GENERIC_DEVICE_run, the value that is read is actually 0x0B. |
0x304 | Input5 | USINT | Default: 0x04 Note that as the attribute value from the output parameter 0x30C is mirrored onto the input parameter 0x304 in EI_APP_GENERIC_DEVICE_run, the value that is read is actually 0x0C. |
0x305 | USINT | Default: 0x05 | |
… | |||
0x308 | Output1 | USINT | Default: 0x08 |
… | |||
0x30C | Output5 | USINT | Default: 0x0C |
… | |||
0x33F | USINT | Default: 0x3F | |
0x340 | UINT | Default: 0x0000 | |
… | |||
0x35F | UINT | Default: 0x001F | |
0x360 | UDINT | Default: 0x00000000 | |
… | |||
0x36F | UDINT | Default: 0x0000000F | |
0x370 | ULINT | Default: 0x0000000000000000 | |
… | |||
0x377 | ULINT | Default: 0x0000000000000007 |
Attributes are created with both Set and Get acces permission.
Finally assemblies are created and Attributes 0x300 - 0x304 and 0x308 - 0x30C are added to the Producing, respectively Consuming Assembly.
For all instances of the Assembly Object (0x64, 0x65, 0xFE, 0xFF) the following Instance Attribute is implemented:
Attribute ID | Name | Data Type | Value |
---|---|---|---|
3 | Data | ARRAY of octet |
In the EDS files shipped with the example this is reflected in the fragments below:
In the cyclically called EI_APP_GENERIC_DEVICE_run function, the attribute values for the first five attributes used for process data out (0x308 - 0x30C) are mirrored onto the attributes used for process data in. Also, the first process data out attribute is connected to the industrial LED array implemented on the Texas Instruments evaluation boards.