I'm attempting to create a CANopen device configuration for a PLC, so that it can be used as a CANopen slave device for other control systems.
The PLC I am configuring is very capable in terms of I/O, so there is a lot of process data that will need to be made available. The standard 4 TPDOs will not be a large enough data area for process data, so I'm looking to use Multiplexed PDOs (MPDOs).
MPDOs use standard PDOs, but multilplex the data contained within it, so that vast amounts of data can be transmitted using one message ID. When using this method it is necessary for the CANopen slave device (the PLC in my case) to implement one or more object scanner lists starting at object index 0x1FA0 which contain a pre-defined list of objects that can be sent using the MPDO.
an MPDO conatins:
- Producer Node ID
- Object Index
- Object Sub-Index
- Process Data (4 bytes)
I have configured the necessary process data in the object dictionary, and have made an object scanner list containing the objects I want to be sent using an MPDO. My issue is that I can only map one index of the scanner list to the MPDO, but I believe I need to be able to change this assignment by cycling through the scanner list.
Can anyone help me with this? An example project would be fantastic if possible!
You would better use the PDO offset tecnique: add a fixed offset to the node-ID such as 32 and so PDO will become 180+NID, 280+NID, 380+NID, 480+NID, 1A0+NID, 2A0+NID, 3A0+NID, 4A0+NID, 1C0+NID, 2C0+NID, 3C0+NID, 4C0+NID, 1E0+NID, 2E0+NID, 3E0+NID, 4E0+NID, for a total of 16 TPDOs (RPDOs follows the same scheme: x00, x20, x40, x60).
Beckhoff uses this other mapping: https://infosys.beckhoff.com/english.php?content=../content/1033/el6751/2519238027.html&id=
And compared to MPDOs saves a lot of bandwidth.
A Codesys slave produces a non-configurable EDS, so mappings cannot be changed. If they were, these addresses could be configured by the master at initialization, and just left disabled in the initial configuration.
The Epec GL84, for example, supports 7 RPDOs and 30 TPDOs, but the ones over 4 are disabled by default.
Thanks for your reply! That's very useful information and I will definitely consider this as my solution. I had looked into something similar, however, the method has it's limitations i.e. the maximum node ID in the network is 64 after using so many PDOs. There are also 4 variants of the controller I am developing this solution for, where the highest I/O density is 128 with almost every pin configurable as analogue or digital inputs/outputs - so 30 PDOs may only be suitable for less I/O dense controllers.
I would also say that using so many extra messages would impact the bus load quite a lot, perhaps more so than multiplexing data through just one message. This being said, I suppose it depends how much data is multiplexed and how frequently the PDO is updated and sent to the CAN TX buffer.
The detail regarding non-configurable EDS files is very useful to me - now I don't need to spend time trying to figure out how to change the mapping!
Ideally I would really like the solution to be as user friendly as possible, but as this particular project will only be used in a handful of applications I may have to devise my own method for sending this data. I could write some multiplexing code in the slave and an FB for the master PLC to unpack the data, but then the solution starts to get a bit messy in my opinion. Perhaps I should offer both options - lots of PDOs or multiplexed PDOs with FBs to read the data.
I would still like to learn more about MPDOs with Codesys as a point of interest, so If you or anyone else have other ideas/examples on how I could approach this I would be very grateful to see them!
Log in to post a comment.