versadac  1
versadac - Scalable Recorder Firmware
eips_userobj.h
1 /*
2  * Copyright (c) 2002-2013 by Real Time Automation, Inc.
3  *
4  * This software is copyrighted by and is the sole property of
5  * Real Time Automation, Inc. (RTA). All rights, title, ownership,
6  * or other interests in the software remain the property of RTA.
7  * This software may only be used in accordance with the corresponding
8  * license agreement. Any unauthorized use, duplication, transmission,
9  * distribution, or disclosure of this software is expressly forbidden.
10  *
11  * This Copyright notice MAY NOT be removed or modified without prior
12  * written consent of RTA.
13  *
14  * RTA reserves the right to modify this software without notice.
15  *
16  * Real Time Automation
17  * 150 S. Sunny Slope Road USA 262.439.4999
18  * Suite 130 www.rtaautomation.com
19  * Brookfield, WI 53005 software@rtaautomation.com
20  *
21  *************************************************************************
22  *
23  * Version Date: 18APR2013
24  * Version: 2.33
25  * Conformed To: EtherNet/IP Protocol Conformance Test A-9 (16-NOV-2011)
26  * Module Name: eips_userobj.h
27  * Author: Jamin D. Wendorf (jwendorf@rtaautomation.com)
28  * Language: Ansi C
29  * Compile Options: N/A
30  * Compile defines: N/A
31  * Libraries: N/A
32  * Link Options: N/A
33  *
34  * Description.
35  * =======================================================================
36  * This file contains user object model definitions.
37  *
38  */
39 
40 #ifndef __EIPS_USEROBJ_H__
41 #define __EIPS_USEROBJ_H__
42 
43 /* *************************** */
44 /* Identity Object Definitions */
45 /* *************************** */
46 #define EIPS_USER_ASM_T2OINST_TYPE 0
47 #define EIPS_USER_ASM_O2TINST_TYPE 1
48 
49 /* Vendor ID is "Real Time Automation" 0x0032 */
50 #define EIPS_USER_IDOBJ_VENDORID 0x002D
51 /* Device Types is "Generic" 0x002b */
52 #define EIPS_USER_IDOBJ_DEVTYPE 0x002B
53 /* Product Code is unique for each product */
54 
55 #ifdef ScalableR
56 /* Product Code is unique for each product */
57 #define EIPS_USER_IDOBJ_PRODCODE 0xE790
58 /* Product Name is 1-byte length followed by the name string */
59 
60  //0 1 2 3
61  //12345678901234567890123456789012
62 #define EIPS_USER_IDOBJ_NAME "versadac"
63 #else
64 /* Product Code is unique for each product */
65 #define EIPS_USER_IDOBJ_PRODCODE 0xE780
66 /* Product Name is 1-byte length followed by the name string */
67 
68  //0 1 2 3
69  //12345678901234567890123456789012
70 #define EIPS_USER_IDOBJ_NAME "nanodac"
71 #endif
72 
73 #define EIPS_USER_IDOBJ_NAME_SIZE strlen(EIPS_USER_IDOBJ_NAME)
74 
75 #if EIPS_USEROBJ_ASM_ELEMENT_SIZE == 4 /* DWORDS */
76  #define VS_MAX_DISCRETE_INPUT_UNITS 1
77  #define VS_MAX_DISCRETE_OUTPUT_UNITS 1
78 #elif EIPS_USEROBJ_ASM_ELEMENT_SIZE == 2 /* WORDS */
79  #define VS_MAX_DISCRETE_INPUT_UNITS 100
80  #define VS_MAX_DISCRETE_OUTPUT_UNITS 100
81 #else /* BYTES */
82  #define VS_MAX_DISCRETE_INPUT_UNITS 1
83  #define VS_MAX_DISCRETE_OUTPUT_UNITS 1
84 #endif
85 
86 /* *************************** */
87 /* Vendor Specific Definitions */
88 /* *************************** */
89 /* Assembly data can be in bytes (8-bit), words (16-bit) or longs (32-bit). */
90 /* ALL ASSEMBLIES MUST USE THE SAME TYPE!!!! */
91 /*#define EIPS_USEROBJ_ASM_ELEMENT_SIZE 1 */ /* bytes */
92 #define EIPS_USEROBJ_ASM_ELEMENT_SIZE 2 /* words */
93 /*#define EIPS_USEROBJ_ASM_ELEMENT_SIZE 4 */ /* double words */
94 
95 /* ******************************************************** */
96 /* START ASSEMBLY DEFINES */
97 /* ******************************************************** */
98 /*
99  Define to allow any I/O size configuration, up to the max, for all I/O connections
100 
101  As an example, the user defines a max input size of 400 bytes and max output size of 400 bytes.
102  This would allow the Scanner to open an I/O connection with an input size of 1-400 and an output
103  size of 1-400. Once the I/O connection is opened, the size must match to be properly processed.
104 */
105 /* #define EIPS_USEROBJ_ASM_VAR_SIZE_ENABLE 1 */
106 
107 /* define to include Listen Only and Input Only I/O Connections */
108 #define EIPS_USEROBJ_ASM_OUTPUTONLY_HB_O2TINST 0xFD /* (253 dec) define to include Output Only I/O Connections */
109 #define EIPS_USEROBJ_ASM_INPUTONLY_HB_O2TINST 0xFE /* (254 dec) define to include Input Only I/O Connections */
110 #define EIPS_USEROBJ_ASM_LISTENONLY_HB_O2TINST 0xFF /* (255 dec) define to include Listen Only I/O Connections */
111 
112 /* define the max assembly instance used */
113 #define EIPS_USEROBJ_ASM_MAXINST 0xFF /* (255 dec) */
114 
115 /* O2T Assemblies transfer data from the network client to us */
116 #define EIPS_USEROBJ_ASM_MAXNUM_O2TINST 1 /* can be set to 0 */
117 
118 /* T2O Assemblies transfer data from us to the network client. */
119 #define EIPS_USEROBJ_ASM_MAXNUM_T2OINST 1 /* can be set to 0 */
120 
121 /* we always us the Run Time Header for the O2T direction of non-zero length data */
122 /* optionally we can pad the T2O direction with 4 bytes of data for the Run Time Header */
123 /* #define EIPS_USEROBJ_T2O_RUNTIME_HEADER_USED 1 */
124 
125 /* define to have the RTA stack increment the Class 1 PDU sequence number automatically */
126 /* #define EIPS_USEROBJ_AUTOINC_CLASS1_PDUSEQNUM 1 */
127 
128 /* ******************************************************** */
129 /* END ASSEMBLY DEFINES */
130 /* ******************************************************** */
131 
132 /* ********************** */
133 /* TCP Object Definitions */
134 /* ********************** */
135 /* define to include optional TCP Attributes */
136 /* #define EIPS_USEROBJ_TCP_OBJ_EXTENDED 1 */
137 
138 /* ******************************** */
139 /* Ethernet Link Object Definitions */
140 /* ******************************** */
141 /* define to include optional Ethernet Link Attributes */
142 /* #define EIPS_USEROBJ_ELINK_OBJ_EXTENDED 1 */
143 
144 /* ====================================================================
145 0x70 DISCRETE INPUT DATA OBJECT ATTRIBUTES (VENDOR SPECIFIC)
146 ======================================================================= */
147 #define VS_OBJ_DISCRETE_INPUT_DATA 0x70
148 typedef struct
149 {
150  struct
151  {
152 /* ATTR 01 */ uint16 ClassRev; // Class Revision
153  }Class;
154 
155  struct
156  {
157 /* ATTR 01 */ uint16 DataSize; // Number of Input Data Units (0-n)
158 /* ATTR 02 */ // unused
159 
160 #if EIPS_USEROBJ_ASM_ELEMENT_SIZE == 4 /* DWORDS */
161  /* ATTR 03 */ uint32 DataPtr[VS_MAX_DISCRETE_INPUT_UNITS]; // Input Data (uint32)
162 #elif EIPS_USEROBJ_ASM_ELEMENT_SIZE == 2 /* WORDS */
163  /* ATTR 03 */ uint16 DataPtr[VS_MAX_DISCRETE_INPUT_UNITS]; // Input Data (uint16)
164 #else /* BYTES */
165  /* ATTR 03 */ uint8 DataPtr[VS_MAX_DISCRETE_INPUT_UNITS]; // Input Data (uint8)
166 #endif
167  }Inst;
169 
170 /* = ===================================================================
171 0x71 DISCRETE OUTPUT DATA ATTRIBUTES (VENDOR SPECIFIC)
172 ======================================================================= */
173 #define VS_OBJ_DISCRETE_OUTPUT_DATA 0x71
174 typedef struct
175 {
176  struct
177  {
178 /* ATTR 01 */ uint16 ClassRev; // Class Revision
179  }Class;
180 
181  struct
182  {
183 /* ATTR 01 */ uint16 DataSize; // Number of Output Data Units (0-n)
184 /* ATTR 02 */ // unused
185 
186 #if EIPS_USEROBJ_ASM_ELEMENT_SIZE == 4 /* DWORDS */
187  /* ATTR 03 */ uint32 DataPtr[VS_MAX_DISCRETE_OUTPUT_UNITS]; // Output Data (uint32)
188 #elif EIPS_USEROBJ_ASM_ELEMENT_SIZE == 2 /* WORDS */
189  /* ATTR 03 */ uint16 DataPtr[VS_MAX_DISCRETE_OUTPUT_UNITS]; // Output Data (uint16)
190 #else /* BYTES */
191  /* ATTR 03 */ uint8 DataPtr[VS_MAX_DISCRETE_OUTPUT_UNITS]; // Output Data (uint8)
192 #endif
193  }Inst;
195 
196 /* = ===================================================================
197 0xA2 EXPLICIT DATA ATTRIBUTES (VENDOR SPECIFIC) (MODBUS MEMORY MAP)
198 ======================================================================= */
199 #define VS_OBJ_EXPLICIT_DATA 0xA2
200 typedef struct
201 {
202  struct
203  {
204 /* ATTR 01 */ uint16 ClassRev; /* Class Revision */
205  }Class;
206 
207  struct
208  {
209 /* ATTR 01 */ uint16 DataSize; /* For us this is a modbus address between 0-65535 */
210 /* ATTR 02 */ /* unused */
211  }Inst;
213 
214 #endif /* __EIPS_USEROBJ_H__ */
Definition: eips_userobj.h:200
Definition: eips_userobj.h:174
Definition: eips_userobj.h:148