PDO vs. SDO
In EtherCAT, values are sent and received from most drives using CANopen PDO’s and SDO’s. In most applications, RapidCode API users need not be aware of these low-level features.
PDO (Process Data Object) → Real-time data sent to/from the MotionController to each drive/node for every sample period.
SDO (Service Data Object) → Service Channel messages which are not exchanged every cycle.
What are PDOs?
PDOs or Process Data Objects are the values exchanged cyclically with every real-time sample of the MotionController (1kHz by default). For servo drives, these are values such as control/status information and position demand/feedback.
Multi-Threading Note
Writing to the same PDO values is not Multi-Threading safe.
Writing to different PDO values is Multi-Threading safe.
PDO - Reading & Writing
Using RapidSetup
Open the RapidSetup tool then go to Tools > Network Data
Here you can see which PDO’s are being exchanged between our controller and your device/node(s).
Using RapidCode API
Reading Inputs
Reading and Writing to Outputs
Be sure you know what you are doing if you choose to Override an Output. Any automated process which was writing to it, will no longer have control and will not be aware that someone else is in charge.
PDO - Injection
You can inject exchanged information by editing the EtherCATNodeInfo.xml file.
Let's say we want to read/write from the latch status, control, and positions SDO’s because communicating directly with the SDO takes too much time.
Follow the Example below for a solution.
PDO Injection Using EtherCATNodeInfo.xml File
In the EtherCATNodeInfo.xml file I can see that Yaskawa (for example) by default has the following PDO’s configuration:
Take a look at the Yaskawa-SGD7S.xml ESI file, located in the ESI folder inside your RMP folder:
You can add Entries by editing the EtherCATNodeInfo.xml file by making the following changes:
This works well for Inputs <Access>ro</Access> like Touch probe values and status. But it does not work currently for Outputs <Access>rw</Access> such as the Touch probe function (0x60B8). Right now if you add an output in, we will write 0 into it every cycle. Unless you Override the sent value (see next section).
PDO - Output Value Override
Using RapidSetup
All you need to do is set the value under the OVERRIDE VALUE column and then check the checkbox under the OVERRIDE column. (See image below)
Using RapidCode API
Enabling Override Feature
Where:
index → the PDO Network Output index to read from. outputOverride → boolean that will enable or disable the override feature for specific PDO index.
Setting Override Value
Where:
index → the index of the PDO Network Output to Override. outputOverride → Your desired value (must be an unsigned 64-bit value, you may need to use a union)
What are SDOs?
SDOs or Service Data Object are messages in a confirmed service with a kind of handshake. They are used for the access to entries of the object dictionary. Especially the configuration for the requested behavior of the drive adapted to the various possible applications is done by these objects.
SDO’s are not exchanged during every cycle, they are done periodically.
(Not as fast as PDO’s since they must wait for network response)
SDO - Reading & Writing
Using RapidSetup
The easiest way to read a SDO or write to an SDO is by using our RapidSetup utility then click on your drive node. (see images below)
Using RapidCode API
SDO Writing
Where:
index → the memory address to write to. subIndex → the sub index to write to. byteCount → the number of bytes to write. value → the numeric value to write.
SDO Reading
Where:
index → the memory address to read from. subIndex → the sub index to read from. byteCount → the number of bytes to read.
Last updated