[etherlab-users] Beckhoff EL9800

Peter van Knippenbergh peter.van.knippenbergh at sioux.eu
Mon Feb 8 17:51:23 CET 2010


Hi 

 

I try to activate the Sync0 in the beckhoff EL9800 evaluation hardware. With
twincat and the SOEM driver from Arthur Ketels (all on Windows) it is
successful.

 

But with the IGH driver on Linux, it fails.

 

Here is part of the xml-file

 

                     <Dc>

                           <OpMode>

                                <Name>Synchron</Name>

                                <Desc>SM-Synchron</Desc>

                                <AssignActivate>#x0</AssignActivate>

                                <CycleTimeSync0
Factor="1">0</CycleTimeSync0>

                                <ShiftTimeSync0>0</ShiftTimeSync0>

                                <CycleTimeSync1
Factor="1">0</CycleTimeSync1>

                                <ShiftTimeSync1>0</ShiftTimeSync1>

                           </OpMode>

                           <OpMode>

                                <Name>DC</Name>

                                <Desc>DC-Synchron</Desc>

                                <AssignActivate>#x300</AssignActivate>

                                <CycleTimeSync0
Factor="1">0</CycleTimeSync0>

                                <ShiftTimeSync0>0</ShiftTimeSync0>

                                <CycleTimeSync1
Factor="1">0</CycleTimeSync1>

                                <ShiftTimeSync1>0</ShiftTimeSync1>

                           </OpMode>

                     </Dc>

 

Here is part of the code to configure the EL9800

 

int configSyncDataEL9800(uint16_t slavePos, ec_master_t *master)

{

     ec_slave_config_t *sc;

     

     ec_pdo_entry_info_t el9800_leds[] = {

         {0x7010, 1, 1}, // Led 1

         {0x7010, 2, 1}, // Led 2

         {0x7010, 3, 1}, // Led 3

         {0x7010, 4, 1}, // Led 4

         {0x7010, 5, 1}, // Led 5

         {0x7010, 6, 1}, // Led 6

         {0x7010, 7, 1}, // Led 7

         {0x7010, 8, 1},  // Led 8

         {0x0000, 0,  8}  // extra dummy bits for word alignment

     };

     

     ec_pdo_info_t el9800_out_pdos[] = {

         {0x1601, 9, el9800_leds},

     };

     

     ec_pdo_entry_info_t el9800_switches[] = {

         {0x6000, 1, 1},  // switch 1

         {0x6000, 2, 1},  // switch 2

         {0x6000, 3, 1},  // switch 3

         {0x6000, 4, 1},  // switch 4

         {0x6000, 5, 1},  // switch 5

         {0x6000, 6, 1},  // switch 6

         {0x6000, 7, 1},  // switch 7

         {0x6000, 8, 1},  // switch 8

         {0x0000, 0, 8}  // extra dummy bits for word alignment

     };

 

     ec_pdo_entry_info_t el9800_analog[] = {

         {0x6020, 1, 1},  // Underrange

         {0x6020, 2, 1},  // Overrange

         {0x6020, 3, 2},  // Limit 1

         {0x6020, 5, 2},  // Limit 2

         {0x0000, 0, 8},  // extra dummy bits

         {0x1802, 7, 1},  // No name

         {0x1802, 9, 1},  // No name

         {0x6020, 17, 16} // Analog input

     };

     

     ec_pdo_info_t el9800_in_pdos[] = {

         {0x1a00, 9, el9800_switches},

         {0x1a02, 8, el9800_analog},

     };

           

     ec_sync_info_t el9800_syncs[] = {

         {2, EC_DIR_OUTPUT, 1, el9800_out_pdos, EC_WD_DEFAULT},

         {3, EC_DIR_INPUT, 2, el9800_in_pdos, EC_WD_DEFAULT},

         {0xff,EC_DIR_INVALID,0,0, EC_WD_DEFAULT}

     };

 

 

 

     if (!(sc = ecrt_master_slave_config(

           master, 0, slavePos, Beckhoff_EL9800))) {

           fprintf(stderr, "Failed to get slave configuration EL9800 at
slavepos %d.\n", slavePos);

           return -1;

     }

     

     if (ecrt_slave_config_pdos(sc, EC_END, el9800_syncs)) {

           fprintf(stderr, "Failed to configure EL9800 PDOs at slavepos
%d.\n", slavePos);

           return -1;

     }

    ecrt_slave_config_dc(sc, 0x0300, (uint32_t)cycletime, 0, 0, 0);

     //ecrt_slave_config_sdo16(sc, 0x1c32, 1, 2);

 

     return 0;

}    

 

If I commented the ecrt_slave_config_dc(sc, 0x0300,.. Line, then the slave
has no problems (but no distributed clock and  Sync0 events). Cycletime is
200000 (5KHz), and for other slaves like the EL5101, it works.

 

The dmesg

 

[26111.847039] EtherCAT DEBUG: Changing state of slave 0 from PREOP to OP.

[26111.847042] EtherCAT DEBUG: Configuring slave 0...

[26111.847777] EtherCAT DEBUG: Slave 0 is now in INIT.

[26111.847779] EtherCAT DEBUG: Clearing FMMU configurations of slave 0...

[26111.848192] EtherCAT DEBUG: Clearing sync manager configurations of slave
0...

[26111.848585] EtherCAT DEBUG: Clearing DC assignment of slave 0...

[26111.849377] EtherCAT DEBUG: Slave 0: DC system_time=126616541136
old_offset=18446721931603702510, app_time=26111849361921,
new_offset=3843126971679

[26111.849780] EtherCAT DEBUG: Configuring mailbox sync managers of slave 0.

[26111.849785] EtherCAT DEBUG: SM0: Addr 0x1000, Size 128, Ctrl 0x26, En 1

[26111.849788] EtherCAT DEBUG: SM1: Addr 0x1400, Size 128, Ctrl 0x22, En 1

[26111.851391] EtherCAT DEBUG: Slave 0 is now in PREOP.

[26111.851396] EtherCAT DEBUG: PDO assignment for SM0 is already configured
correctly.

[26111.851398] EtherCAT DEBUG: PDO assignment for SM1 is already configured
correctly.

[26111.851413] EtherCAT DEBUG: Mapping of PDO 0x1601 is already configured
correctly.

[26111.851416] EtherCAT DEBUG: PDO assignment for SM2 is already configured
correctly.

[26111.851429] EtherCAT DEBUG: Mapping of PDO 0x1A00 is already configured
correctly.

[26111.851436] EtherCAT DEBUG: Mapping of PDO 0x1A02 is already configured
correctly.

[26111.851439] EtherCAT DEBUG: PDO assignment for SM3 is already configured
correctly.

[26111.851446] EtherCAT DEBUG: SM2: Addr 0x1800, Size   2, Ctrl 0x24, En 1

[26111.851450] EtherCAT DEBUG: SM3: Addr 0x1C00, Size   6, Ctrl 0x20, En 1

[26111.851795] EtherCAT DEBUG: FMMU: LogAddr 0x00000000, Size   2, PhysAddr
0x1800, SM2, Dir out

[26111.851799] EtherCAT DEBUG: FMMU: LogAddr 0x00000002, Size   6, PhysAddr
0x1C00, SM3, Dir in

[26111.852180] EtherCAT DEBUG: Slave 0: Setting DC cycle times to 200000 /
0.

[26111.852577] EtherCAT DEBUG: app_start_time=26111846240923

[26111.852579] EtherCAT DEBUG:     start_time=26111952564562

[26111.852581] EtherCAT DEBUG:     cycle_time=200000

[26111.852583] EtherCAT DEBUG:     shift_time=0

[26111.852585] EtherCAT DEBUG:      remainder=123639

[26111.852587] EtherCAT DEBUG:          start=26111952640923

[26111.852590] EtherCAT DEBUG: Slave 0: Setting DC cyclic operation start
time to 26111952640923.

[26111.852972] EtherCAT DEBUG: Slave 0: Setting DC AssignActivate to 0x0300.

[26111.854579] EtherCAT ERROR: Failed to set SAFEOP state, slave 0 refused
state change (PREOP + ERROR).

[26111.854973] EtherCAT ERROR: Unknown AL status code 0x0036.

[26111.855777] EtherCAT: Acknowledged state PREOP on slave 0.

 

 

Why is my EL9800 slave not going to OP and how can I get the EL9800 in DC
mode with SYNC0 with 5KHz ??

 

Kind regards

 

Peter van Knippenbergh

Test and Software designer

------------------------------------------__________________________________
___________________________

Sioux. Source of your development.

 

Sioux Embedded Systems B.V.

Esp 405 | 5633 AJ Eindhoven | The Netherlands

KvK Eindhoven 17093039

 

T +31 (0)40 2677100

T +31 (0)40 2677108 (direct)

F +31 (0)40 2677101

E  <mailto:peter.van.knippenbergh at sioux.eu> peter.van.knippenbergh at sioux.eu

 

Visit us at: www.sioux.eu

e-mail  <mailto:peter.van.knippenbergh at sioux.eu>
peter.van.knippenbergh at sioux.eu



"Sioux, the embedded systems specialists adding (more) value"

 

DISCLAIMER:

 

De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is
uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht
ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct
te informeren door het bericht te retourneren.

 

The information contained in this message may be confidential and is
intended to be exclusively for the addressee. Should you receive this
message unintentionally, please do not use the contents herein and notify
the sender immediately by return e-mail.

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20100208/e98e00b0/attachment-0003.htm>


More information about the Etherlab-users mailing list