Comments (2)
I guess you try to use the TPDO COBID macro for getting the standard connection set CO_COBID_TPDO_DEFAULT(0 .. 3)
?
This is no limitation of the CANopen stack, this is just a common recommended set of COBIDs from the CiA standard.
Background: the CANopen standard defines a so-called "standard connection set", which includes 4 TPDOs. This is ok when we assume a network with 128 nodes. This leads us to the needed range of COBIDs: 4 TPDOs x 128 Nodes = 512 COBIDs used for TPDOs. For smaller networks (for example only 16 nodes with NodeId 1..16), we can place more TPDOs within each node: 512 COBIDs / 16 Nodes = 32 TPDOs per node. The reason is the limited number of COBIDs in a CANopen network.
Proposal:
You can create an application-specific (or better: network-specific) connection set. With the _BASE and _INC values you can tweak the COBIDs for your specific use-case:
#define MY_COBID_TPDO_BASE (uint32_t)0x180
#define MY_COBID_TPDO_INC (uint32_t)0x8 /* 8 Nodes with NodeId 1..8 */
#define MY_COBID_TPDO_SET(num) \
CO_COBID_TPDO_STD(1u, MY_COBID_TPDO_BASE + (num * MY_COBID_TPDO_INC))
Alternatively, you can simply set an individual set of COBIDs directly:
#define MY_TPDO1_COBID() CO_COBID_TPDO_STD(1u, 0x200) /* 7 Nodes with NodeId 10h, 20h, 30h, .., 70h */
#define MY_TPDO2_COBID() CO_COBID_TPDO_STD(1u, 0x201)
#define MY_TPDO3_COBID() CO_COBID_TPDO_STD(1u, 0x202)
:
#define MY_TPDO16_COBID() CO_COBID_TPDO_STD(1u, 0x20F)
Any scheme is possible.
Whichever method you use, to get the CANopen network working, you must ensure that no COBID is used multiple times. So it depends on the number of nodes, possible node-IDs, number of TPDOs, and the COBIDs of all other services.
from canopen-stack.
Thanks; that makes a great deal of sense. My network is quite small, so I can easily adjust the TPDO COBIDs to accomplish this.
from canopen-stack.
Related Issues (20)
- generate source package with release v4.4.0
- quickstart is moved to own repository
- Not able to find object dictionary file in the stack and no idea which tool need to use to generate the EDS file HOT 4
- Implementation on TI C2000 MCU with 16-bit bytes HOT 6
- Variable Block Download block sizes HOT 3
- Failed to link files HOT 2
- DSP: Integer16 is not read as expected HOT 7
- reentering an abandoned segmented SDO session
- protocol boot-up spec possibly followed incorrectly HOT 1
- EMCY Service Err Index Size
- Bugfix for COSDO Segmented Download
- Size of buffer during NVM read
- Problems with RPDO dummy mapping - potential array out of bounds write HOT 2
- Linux port of the stack HOT 1
- COTPdoMapWrite: Add error checking to prevent uninitialized variable access.
- SDO timeout message after SDO request was successful
- How to tailor the lib to run on small-size MCU
- COTmrService stops all timers on failed CO_IF_CAN_DRV.Send?
- CAN communication stopped after creating CANOpen node.
- How to: master and more than default number of PDOs HOT 2
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 canopen-stack.