versadac  1
versadac - Scalable Recorder Firmware
eips_cnxn.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_cnxn.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 EtherNet/IP Server connection specific definitions.
37  *
38  */
39 
40 #ifndef __EIPS_CNXN_H__
41 #define __EIPS_CNXN_H__
42 
43 #define EIPS_CNXN_MAXTOTALCNXNS ((EIPS_USER_MAX_NUM_EIP_SESSIONS * EIPS_USER_MAX_NUM_EM_CNXNS_PER_SESSION)+EIPS_USER_MAX_NUM_IO_CNXNS)
44 
45 /* define led states for the user */
46 // Re-mapped to match the function block enumerations EIP_STATUS_E_ER
47 #define EIPS_LEDSTATE_OFF 0
48 #define EIPS_LEDSTATE_FLASH_GREEN 1
49 #define EIPS_LEDSTATE_STEADY_GREEN 2
50 #define EIPS_LEDSTATE_FLASH_RED 3
51 #define EIPS_LEDSTATE_STEADY_RED 4
52 #define EIPS_LEDSTATE_ALT_REDGREEN 5
53 
54 #define EIPS_CNXN_STATE_FREE 0
55 #define EIPS_CNXN_STATE_USED 1
56 
57 /* the following is a valid EM transport class mask */
58 #define EIPS_XPORTCLASS_EM_ANDVAL 0x8F
59 #define EIPS_XPORTCLASS_EM_VALID 0x83
60 
61 /* the following are valid I/O transport classes */
62 #define EIPS_XPORTCLASS_CYC_NOSEQ 0x00
63 #define EIPS_XPORTCLASS_CYC_SEQ 0x01
64 #define EIPS_XPORTCLASS_COS_NOSEQ 0x10
65 #define EIPS_XPORTCLASS_COS_SEQ 0x11
66 #define EIPS_XPORTCLASS_APP_NOSEQ 0x20
67 #define EIPS_XPORTCLASS_APP_SEQ 0x21
68 
69 /* ***************************** */
70 /* Network Connection Parameters */
71 /* ***************************** */
72 
73 /* Bit 15 -> Redundant Owner */
74 #define NTWKCNXNPRM_OWNER_ONE 0x0000
75 #define NTWKCNXNPRM_OWNER_MANY 0x8000
76 #define NTWKCNXNPRM_OWNER_ANDVAL 0x8000
77 
78 /* Bits 13,14 -> Connection Type */
79 #define NTWKCNXNPRM_CNXNTYP_NULL 0x0000
80 #define NTWKCNXNPRM_CNXNTYP_MULTI 0x2000
81 #define NTWKCNXNPRM_CNXNTYP_P2P 0x4000
82 #define NTWKCNXNPRM_CNXNTYP_RSVD 0x6000
83 #define NTWKCNXNPRM_CNXNTYP_ANDVAL 0x6000
84 
85 /* Bit 12 -> Reserved */
86 
87 /* Bits 10,11 -> Priority */
88 #define NTWKCNXNPRM_PRIORITY_LOW 0x0000
89 #define NTWKCNXNPRM_PRIORITY_HIGH 0x0400
90 #define NTWKCNXNPRM_PRIORITY_SCHEDULE 0x0800
91 #define NTWKCNXNPRM_PRIORITY_URGENT 0x0C00
92 #define NTWKCNXNPRM_PRIORITY_ANDVAL 0x0C00
93 
94 /* Bit 9 -> Variable Size */
95 #define NTWKCNXNPRM_FIXED_SIZ 0x0000
96 #define NTWKCNXNPRM_VAR_SIZ 0x0200
97 #define NTWKCNXNPRM_FIXED_ANDVAL 0x0200
98 
99 /* Bits 0-8 -> Connection Size (in bytes) */
100 #define NTWKCNXNPRM_CNXN_SIZ_ANDVAL 0x01FF
101 
102 /* ****************************************** */
103 /* Connection Manager Extended Response Codes */
104 /* ****************************************** */
105 #define CMERR_ALREADY_USED 0x100 /* Connection already in use */
106 #define CMERR_BAD_TRANSPORT 0x103 /* Transport type not supported */
107 #define CMERR_OWNER_CONFLICT 0x106 /* More than one guy configuring */
108 #define CMERR_BAD_CONNECTION 0x107 /* Trying to close inactive conn */
109 #define CMERR_BAD_CONN_TYPE 0x108 /* Unsupported connection type */
110 #if 0
111 DEPRECATED-> #define CMERR_BAD_CONN_SIZE 0x109 /* Connection size mismatch */
112 #endif
113 #define CMERR_CONN_UNCONFIGURED 0x110 /* Connection unconfigured */
114 #define CMERR_BAD_RPI 0x111 /* Unsupportable RPI */
115 #define CMERR_RPI_VAL_NOT_ACCEPT 0x112 /* RPI Value(s) not acceptable */
116 #define CMERR_NO_CM_RESOURCES 0x113 /* Conn Mgr out of connections */
117 #define CMERR_BAD_VENDOR_PRODUCT 0x114 /* Mismatch in electronic key (vendor id / product code) */
118 #define CMERR_BAD_DEVICE_TYPE 0x115 /* Mismatch in electronic key (product type) */
119 #define CMERR_BAD_REVISION 0x116 /* Mismatch in electronic key (revision mismatch) */
120 #if 0
121 DEPRECATED-> #define CMERR_BAD_CONN_POINT 0x117 /* Nonexistant instance number */
122 DEPRECATED-> #define CMERR_BAD_CONFIGURATION 0x118 /* Bad config instance number */
123 #endif
124 #define CMERR_CONN_REQ_FAILS 0x119 /* No controlling connection open */
125 #define CMERR_NO_APP_RESOURCES 0x11A /* App out of connections */
126 #define CMERR_RPI_LESS_PRODINHIB 0x11B /* RPI is smaller than ProdInhibTimer */
127 #define CMERR_XPORT_CLASS_NOT_SUPRTED 0x11C /* Transport Class Not Supported */
128 #define CMERR_PROD_TRIG_NOT_SUPPORTED 0x11D /* Production Trigger Not Supported */
129 #define CMERR_DIRECTION_NOT_SUPPORTED 0x11E /* Direction Not Supported */
130 #define CMERR_O2T_FIXVAR_NOT_SUPPORTED 0x11F /* O2T Fixed/Variable Flag Not Supported */
131 #define CMERR_T2O_FIXVAR_NOT_SUPPORTED 0x120 /* T2O Fixed/Variable Flag Not Supported */
132 #define CMERR_O2T_PRI_NOT_SUPPORTED 0x121 /* O2T Priority Not Supported */
133 #define CMERR_T2O_PRI_NOT_SUPPORTED 0x122 /* T2O Priority Not Supported */
134 #define CMERR_O2T_CNXNTYP_NOT_SUPPORTED 0x123 /* O2T Connection Type Not Supported */
135 #define CMERR_T2O_CNXNTYP_NOT_SUPPORTED 0x124 /* T2O Connection Type Not Supported */
136 #define CMERR_REDUND_OWN_NOT_SUPPORTED 0x125 /* Redundant Owner Flag Not Supported */
137 
138 #define CMERR_INV_CNXN_SIZE 0x126 /* Invalid Configuration Size (ext stat with valid value) */
139 #define CMERR_INV_O2T_SIZE 0x127 /* Invalid O2T Size (ext stat with valid value) */
140 #define CMERR_INV_T2O_SIZE 0x128 /* Invalid T2O Size (ext stat with valid value) */
141 
142 #define CMERR_INV_CNXN_PATH 0x129 /* Invalid Configuration Path */
143 #define CMERR_INV_O2T_PATH 0x12A /* Invalid O2T / Consume Path */
144 #define CMERR_INV_T2O_PATH 0x12B /* Invalid T2O / Produce Path */
145 
146 #define CMERR_CONN_TIMED_OUT 0x203 /* Using a timed out connection */
147 #define CMERR_UCSEND_TIMED_OUT 0x204 /* Unconnected Send timed out */
148 #define CMERR_UCSEND_PARAM_ERR 0x205 /* Unconnected Send parameter error */
149 #define CMERR_MSGTOOLARGE4UCMM 0x206 /* Message too large for UCMM */
150 #define CMERR_UCMMACKNOREPLY 0x207 /* UCMM Ack without reply */
151 #define CMERR_NO_BUFFER 0x301 /* No buffer memory available */
152 #define CMERR_NO_BANDWIDTH 0x302 /* Insufficient bandwidth left */
153 #define CMERR_NO_SCREENER 0x303 /* Out of gen screeners */
154 #define CMERR_NOT_CONF_FOR_RT 0x304 /* Not configured to send RT data*/
155 #define CMERR_SIGNATURE_MISMATCH 0x305 /* sig does not match sig store in CCM */
156 #define CMERR_CCM_NOT_AVAIL 0x306 /* ccm is not responding to requests */
157 #define CMERR_BAD_PORT 0x311 /* Nonexistant port */
158 #define CMERR_BAD_LINK_ADDRESS 0x312 /* Invalid link address in path */
159 #define CMERR_BAD_SEGMENT 0x315 /* Invalid segment in path */
160 #define CMERR_BAD_CLOSE 0x316 /* Path & conn not equal in close */
161 #define CMERR_BAD_NET_SEGMENT 0x317 /* Net seg not present or bad */
162 #define CMERR_BAD_LINK_AD_TO_SELF 0x318 /* Link address to self invalid */
163 #define CMERR_NO_SEC_RESOURCE 0x319 /* Resources in secondary unavail */
164 #define CMERR_RACKCNXN_ALREADY_ESTAB 0x31A /* Rack connection already established */
165 #define CMERR_MODULECNXN_ALREADY_ESTAB 0x31B /* Module connection already established */
166 #define CMERR_MISC_CATCHALL 0x31C /* miscellaneous (catch all) */
167 #define CMERR_REDUND_CONN_MISMATCH 0x31D /* Redundant connection mismatch */
168 
169 #endif /* __EIPS_CNXN_H__ */