Comments (2)
The only examples available are the implementations of the standard CIP objects needed for a generic communications adapter. An object where many of the neede functionality can be found is the TCPIP Interface object.
The general sequence for setting up such an object is:
-
Create a CIPObject:
p_stTCPIPClass = createCIPClass(YOUR_OBJECT_CLASS_CODE, /Check CIP speck for valid ranges */
0, / # class attributes_/
0xffffffff, /_ class getAttributeAll mask keep it to all 1 so that the default get attribute all will work_/
0, /_ # class services_/
1, /_ # instance attributes_/
0xffffffff, /_ instance getAttributeAll mask_/
1, /_ # of additional instance services (getAttributeSingle and getAttributeAll are added per default_/
1, /_ # instances which should already be create now_/
"our obect name",
1 /_revision of your object, 1 is here a good thing to start with */
); -
configure your instances:
attributes should typically be put into the instances of your objectpstInstance = getCIPInstance(p_stTCPIPClass, 1); /* bind attributes to the instance #1 that was
created above*/insertAttribute(pstInstance,
1, /* Atrtibute number /
CIP_UINT, / data type of attribute _/
(void ) &attributeMemory); /_a memory place for your attribute/ -
configure the instance services
insertService(p_stTCPIPClass, CIP_SET_ATTRIBUTE_SINGLE,
&setAttributeSingleMyObject, "SetAttributeSingle"); -
Implement the service:
EIP_STATUS
setAttributeSingleTCP(S_CIP_Instance pa_pstObjectInstance,
S_CIP_MR_Request *pa_pstMRRequest, S_CIP_MR_Response *pa_pstMRResponse)
{
if (1 == pa_pstMRRequest->RequestPath.AttributNr)
{
/ This is a request for our attribute one_/
decodeData(CIP_UINT, &attributeMemory, &pa_pstMRRequest->Data);
/_TODO if you have more instances: determine which instance the request was target to /
pa_pstMRResponse->GeneralStatus = CIP_ERROR_SUCCESS;
}
else
{
/ we don't have this attribute */
pa_pstMRResponse->GeneralStatus = CIP_ERROR_ATTRIBUTE_NOT_SUPPORTED;
}pa_pstMRResponse->SizeofAdditionalStatus = 0;
pa_pstMRResponse->DataLength = 0;
pa_pstMRResponse->ReplyService = (0x80 | pa_pstMRRequest->Service);
return EIP_OK_SEND;
}
I hope this helps.
from opener.
As no further questions were posted to this topic I will close this issue.
from opener.
Related Issues (20)
- Add Cipher Suites to EthernetIP Security object attributes 3 and 4
- Help with sample application. HOT 1
- Need help using shared libraries. HOT 2
- Need help connection points HOT 1
- InputOnlyConnectionPoint HOT 2
- Transport Class question HOT 1
- cipconnectionmanager.c does not compile with logs HOT 1
- Not configured for off-subnet multicast - Endianness mismatch? HOT 1
- How to use IP startup instead of network card name?
- OpENer/source/src/enet_encap /cpf.c line:247 HOT 3
- OpENer/source/src/cip /cipcommon.c link:1407 HOT 1
- New stable tag HOT 1
- Update Identity Object to Revision 2
- Failing Conformance Testing 20
- Upgrade of OpENer HOT 1
- Example Code HOT 1
- Multiple warnings on MVSC 2022
- QoS Object Behavior Test Error HOT 1
- Directions for generating documentation are wrong
- Question - implicit messaging
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from opener.