Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SDO
#1
How can i access SDO (service data objects) in PowerPMAC?

I am trying to interface multi-turn absolute EtherCAT encoder of Baumer make to PowerPMAC CPU 465 (firmware version 2.1.0.39).

PDO dictionary objects can only read PDO's like Actual Position and Warnings etc. But to get multi-turn output from the encoder i need to set some SDO's like 0x6002 which is "Total measuring range".
But i am unable to find the SDO access on EtherCAT tab on PMAC IDE as it is present in say TwinCAT.

The Baumer make encoder has a protocol CoE with implementation of CANopen DS406 encoder device profile.

Please help.
Reply
#2
You can access "ecatsdo" function.

ecatsdo
Function: Access an EtherCAT Service Dictionary Object (SDO)

Syntax: ecatsdo ({expression},{expression},{expression},
{expression},{expression},{expression})

The ecatsdo function permits the user to access (write to or read from) the specified EtherCAT Service Dictionary Object (SDO) from within a program.

This function can only be used if Sys.EcatType is set to 0 (Etherlab stack). If Sys.EcatType is 1 (Acontis stack), use the similar ecattypedsdo function.

This function takes 6 arguments.

The first argument is the “direction” of the access. It should be 0 to write to the SDO, or 1 to read from the SDO.
The second argument is the slave index value “j” of the device, corresponding to the structure ECAT[i].Slave[j] assigned to the device.
The third argument is the index number of the SDO.
The fourth argument is the subindex number of the SDO.
The fifth argument is the data value for the SDO. If the function is used to write to the SDO (first argument = 0), this is the value that will be written, If the function is used to read from the SDO (first argument = 1), this value is not used (but a value must be present here, even if it is unused, in order for the function to execute).
The sixth argument is the master index value “i” (i.e. the EtherCAT network index) of the device, corresponding to the structure ECAT[i].Slave[j] assigned to the device.
The return value of the function in the case of a valid “read” access is the data value of the specified SDO. The return value in the case of an invalid “read” access is “not-a-number” (nan).

The return value of the function in the case of a valid “write” access is 0. The return value in the case of an invalid “write” access is “not-a number” (nan). Even if the returned value is not really used in the application, it still must be stored somewhere; for example, by assigning it to a “dummy” variable as shown in the example code below.

Example

global sdoresult;

sdoresult = ecatsdo(0,0,$6060,0,10,0); // Write to CAN object

sdoresult = ecatsdo(1,0,$6061,0,0,0); // Read from CAN object



Jaehyuk
Reply
#3
(07-19-2017, 12:09 AM)koustubh_h Wrote: How can i access SDO (service data objects) in PowerPMAC?
... i need to set some SDO's like 0x6002...

Please see the attached .pdf for a couple of SDO read/write examples. You may also want to try typing any PMAC command into the terminal window and press the, "F1" key for help. Then set the filter, pull down menu to PMAC. This was not implemented in older versions of the IDE but now is available and very useful.

NOTE: Etherlab Master Stack can use either ecatsdo(), or ecattypedsdo() commands. Acontis Stack only uses the ecattypedsdo() command.

The 465 with EtherCAT comes equipped with the Etherlab Master Stack. You can test this by issuing the sys.ecattype command.
sys.ecattype = 0 (Etherlab)
sys.ecattype = 1 (Acontis)


Attached Files
.pdf   ecatsdoCommand_R1_2.pdf (Size: 469.69 KB / Downloads: 81)
Reply
#4
This thread is very helpful but I encounter a problem trying these examples
I tried the following lines:
L0=ecattypedsdo(0,3,1,$1016,0,0,4) L0
L0=ecattypedsdo(0,3,1,$6060,0,0,1) L0
L0=ecattypedsdo(0,4,1,$6007,0,0,2) L0
but all i get is "-nan"

Slave num 3 and 4 are MackTron motors by Axor and working well with CSP mode.

It's PowerPmac IPC MotionCore with Sys.EcatType=1 (Actonics)

I tried when ECAT[0].enable=1 (enable) and also when ECAT[0].enable=0 (disable)

any tips how to get it working?

(07-20-2017, 08:25 AM)masher Wrote:
koustubh_h datneline='1500448157' Wrote: How can i access SDO (service data objects) in PowerPMAC?
... i need to set some SDO's like 0x6002...

Please see the attached .pdf for a couple of SDO read/write examples. You may also want to try typing any PMAC command into the terminal window and press the, "F1" key for help. Then set the filter, pull down menu to PMAC. This was not implemented in older versions of the IDE but now is available and very useful.

NOTE: Etherlab Master Stack can use either ecatsdo(), or ecattypedsdo() commands. Acontis Stack only uses the ecattypedsdo() command.

The 465 with EtherCAT comes equipped with the Etherlab Master Stack. You can test this by issuing the sys.ecattype command.
sys.ecattype = 0 (Etherlab)
sys.ecattype = 1 (Acontis)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)