<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6000.16850" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>
<DIV><FONT face=Arial size=2>Dear all, I'm trying to use Danhaer S400 drive with
EC master.</FONT></DIV>
<DIV><FONT face=Arial size=2>I'm relatively new user of master in rtai so
probably I'm making some mistake.</FONT></DIV>
<DIV><FONT face=Arial size=2>Before I've used beckhoff terminal EL1002 EL2002
with no problem also with PDO.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I've tried this piece of code :</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><SPAN lang=IT>
<P>const static ec_pdo_entry_reg_t domain_out_regs[] = {</P>
<P>{DigOutSlavePos, Beckhoff_EL2002, 0x7000, 1, &off_dig_out},</P>
<P>{Drive1, Drive400, 0x6062, 0,&DriveTargetPos1},</P>
<P>{Drive1, Drive400, 0x606b, 0,&DriveTargetVel1},</P>
<P>{Drive1,Drive400,0x6040,0,&DriveControlWord1},</P>
<P>{Drive1,Drive400,0x2802,0,&DriveLatchControlWord1},</P>
<P>{}</P>
<P>};</P>
<P></P>
<P>const static ec_pdo_entry_reg_t domain_in_regs[] = {</P>
<P>{Drive1, Drive400, 0x6064, 0,&DriveCurrentPosition1},</P>
<P>{Drive1, Drive400, 0x6041, 0,&DriveStatusWord1},</P>
<P>{Drive1, Drive400, 0x2901, 0,&DriveLatchStatusWord1},</P>
<P>{Drive1, Drive400, 0x2902, 0,&DriveLatchPosition1},</P>
<P>{}</P>
<P>};</P>
<P>static ec_pdo_entry_info_t drive_input_pdo_entries[]=</P>
<P>{</P>
<P>{ 0x6064,0,32 }, // Position actual value</P>
<P>{ 0x6041,0,16 }, // Status word</P>
<P>{ 0x2901,0,16 }, // Latch status word</P>
<P>{ 0x2902,0,32 }, // Latch register</P>
<P>};</P>
<P>static ec_pdo_entry_info_t drive_output_pdo_entries[]=</P>
<P>{</P>
<P>{ 0x6062,0,32 }, // Position demand value</P>
<P>{ 0x606b,0,32 }, // Velocity demand value</P>
<P>{ 0x6040,0,16 }, // Control word</P>
<P>{ 0x2802,0,16 }, // Latch control word</P>
<P>};</P>
<P>static ec_pdo_info_t drive_output_pdo[]=</P>
<P>{</P>
<P>{ 0x1706, 4,drive_output_pdo_entries},</P>
<P>};</P>
<P>static ec_pdo_info_t drive_input_pdo[]=</P>
<P>{</P>
<P>{ 0x1b06 , 4,drive_input_pdo_entries},</P>
<P>};</P>
<P>static ec_sync_info_t drive_syncs[]=</P>
<P>{</P>
<P>{ 2 , EC_DIR_OUTPUT, 1,drive_output_pdo },</P>
<P>{ 3 ,EC_DIR_INPUT, 1,drive_input_pdo },</P>
<P>{ 0xff },</P>
<P>};</P>
<P><FONT face=Arial size=2></FONT> </P>
<P><FONT face=Arial size=2>Externally before making insmod of the .ko I use
ethercat tool for setting objects (pdo used) in the same order than Beckhoff
Twincat.</FONT></P><FONT face=Arial size=2><SPAN lang=IT>
<P>/ethercat-1.4.0/tool/ethercat download -p 3 0x1C12 0 -t int8 0x0</P>
<P>/ethercat-1.4.0/tool/ethercat download -p 3 0x1C13 0 -t int8 0x0</P>
<P>/ethercat-1.4.0/tool/ethercat download -p 3 0x1C12 1 -t uint16 0x1706</P>
<P>/ethercat-1.4.0/tool/ethercat download -p 3 0x1C12 0 -t int8 0x01</P>
<P>/ethercat-1.4.0/tool/ethercat download -p 3 0x1C13 1 -t uint16 0x1b06</P>
<P>/ethercat-1.4.0/tool/ethercat download -p 3 0x1C13 0 -t int8 0x01</P>
<P>/ethercat-1.4.0/tool/ethercat download -p 3 0x6060 0 -t uint16 0xfa</P>
<P>/ethercat-1.4.0/tool/ethercat download -p 3 0x60C2 1 -t int8 0x01</P>
<P>/ethercat-1.4.0/tool/ethercat download -p 3 0x60C2 2 -t uint8
0xfd</P></SPAN></FONT>
<P><FONT face=Arial size=2></FONT> </P>
<P><FONT face=Arial size=2>This the output of dmesg : </FONT></P><SPAN
lang=IT>
<P>EtherCAT: Starting EtherCAT-IDLE thread.</P>
<P>EtherCAT: Released master 0.</P>
<P>ec_rtai_sample: Unloading.</P>
<P>EtherCAT: Slave states: PREOP.</P>
<P>ec_rtai_sample: Starting...</P>
<P>EtherCAT: Requesting master 0...</P>
<P>EtherCAT: Successfully requested master 0.</P>
<P>ec_rtai_sample: Registering domain...</P>
<P>ec_rtai_sample: Domain registered</P>
<P>ec_rtai_sample: Registering PDO entries...</P>
<P>ec_rtai_sample: Activating master...</P>
<P>EtherCAT: Domain0: Logical address 0x00000000, 25 byte, expected working
counter 5.</P>
<P>EtherCAT: Datagram domain0-0: Logical offset 0x00000000, 25 byte, type
LRW.</P>
<P>EtherCAT: Master thread exited.</P>
<P>EtherCAT: Starting EtherCAT-OP thread.</P>
<P>ec_rtai_sample: Master activated</P>
<P>ec_rtai_sample: Starting cyclic sample thread...</P>
<P>ec_rtai_sample: RT timer started with 1193/1193 ticks.</P>
<P>ec_rtai_sample: Initialized.</P>
<P>ec_rtai_sample: 4 slave(s).</P>
<P>ec_rtai_sample: AL states: 0x02.</P>
<P>ec_rtai_sample: Link is up.</P>
<P>EtherCAT WARNING: 1 datagram UNMATCHED!</P>
<P>EtherCAT WARNING: PDOs configured for SM2, but slave 3 does not provide the
sync manager information!</P>
<P>EtherCAT WARNING: PDOs configured for SM3, but slave 3 does not provide the
sync manager information!</P>
<P>EtherCAT ERROR: Failed to determine PDO sync manager for FMMU on slave 3!</P>
<P>EtherCAT: Domain 0: Working counter changed to 2/5.</P>
<P>EtherCAT: Slave states: PREOP, OP.</P>
<P>ec_rtai_sample: AL states: 0x0A.</P>
<P>If I comment the entries in the vectors domain_in_regs domain_out_regs
regardig drives I get this message : </P><SPAN lang=IT>
<P>ec_rtai_sample: Registering domain...</P>
<P>ec_rtai_sample: Domain registered</P>
<P>ec_rtai_sample: Registering PDO entries...</P>
<P>ec_rtai_sample: Activating master...</P>
<P>EtherCAT: Domain0: Logical address 0x00000000, 1 byte, expected working
counter 1.</P>
<P>EtherCAT: Datagram domain0-0: Logical offset 0x00000000, 1 byte, type
LWR.</P>
<P>EtherCAT: Master thread exited.</P>
<P>EtherCAT: Starting EtherCAT-OP thread.</P>
<P>ec_rtai_sample: Master activated</P>
<P>ec_rtai_sample: Starting cyclic sample thread...</P>
<P>ec_rtai_sample: RT timer started with 1193/1193 ticks.</P>
<P>ec_rtai_sample: Initialized.</P>
<P>ec_rtai_sample: 4 slave(s).</P>
<P>ec_rtai_sample: AL states: 0x02.</P>
<P>ec_rtai_sample: Link is up.</P>
<P>EtherCAT WARNING: 1 datagram UNMATCHED!</P>
<P>EtherCAT WARNING: PDOs configured for SM2, but slave 3 does not provide the
sync manager information!</P>
<P>EtherCAT WARNING: PDOs configured for SM3, but slave 3 does not provide the
sync manager information!</P>
<P>EtherCAT ERROR: Failed to set SAFEOP state, slave 3 refused state change
(PREOP + ERROR).</P>
<P>EtherCAT ERROR: AL status message 0x0017: "Invalid sync manager
configuration".</P>
<P>EtherCAT: Acknowledged state PREOP on slave 3.</P>
<P>EtherCAT: Domain 0: Working counter changed to 1/1.</P>
<P>EtherCAT: Slave states: PREOP, OP.</P>
<P>ec_rtai_sample: AL states: 0x0A.</P></SPAN><FONT face=Arial><FONT
size=2></SPAN></SPAN></DIV></FONT></FONT>
<DIV><FONT face=Arial size=2>the drive give the error 0x17, incorrect PDO'S
configuration.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Obviosly using twincat software everithing works
fine.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Thank you for any kind of help.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Gianluca Medini</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV></FONT></DIV>
<DIV> </DIV></BODY></HTML>