Hi,

Did you try using ecrt_master_sync_slave_clocks(master) function after ecrt_master_sync_reference_clock(master)?

Best regards,
Oguz.

23.07.2012 17:13 tarihinde, Guido yazdı:
Hello everybody,
my name is Guido and I am evaluating the EtherLab EtherCAT-Master.
I've just done some simple tests and everything is working properly. I have instead some problems regarding Beckhoff EL4732 and EL3702 modules. Looking the mailing lists I was able to send an output voltage value and to read it with the input module. However I have a problem: when I set the output like a square wave I have periodically (after about 10 seconds) a lost of synchronism, visible on the oscilloscope like a flicker of the square wave . The task that I have written is a simple real-time tasks (under rtai) with a periodicity of 1 ms (which I have checked). I made the setting of the Distributed clock (without oversampling) ​​ with the instructions:

ecrt_slave_config_dc(sc_ana_out, 0x0730, 1000000, 0, 0, 0); //1ms (EL4732)
ecrt_slave_config_dc(sc_ana_in, 0x0730, 1000000, 0, 0, 0); //1ms (EL3702)

while in the cycle run:

while(1) {
ecrt_master_receive(master);
ecrt_domain_process(domain1);

blink=!blink;

if(blink) ch1_volt=0x3FFF;
else ch1_volt=0;

EC_WRITE_S16(domain1_pd+off_el4732_ch1, ch1_volt);
EC_WRITE_S16(domain1_pd+off_el4732_cc1, 0)

tv.tv_usec +=1000;
if (tv.tv_usec>=1000000) {
tv.tv_usec -=1000000;
tv.tv_sec++;
}
ecrt_master_application_time(master, EC_TIMEVAL2NANO(tv));
ecrt_master_sync_reference_clock(master)

ecrt_domain_queue(domain1);
ecrt_master_send(master);

rt_task_wait_period();
}

Does anyone tell me where is the problem?
I also tried to follow the same steps with the SOEM master, setting the Distribuited Clock with the ec_dcsync01 and the ec_configdc() func. but in this case I can not see the output voltage on the module.

Can anyone help me to solve these problems?
Thank you so much.
Guido
_______________________________________________
etherlab-users mailing list
[email protected]
http://lists.etherlab.org/mailman/listinfo/etherlab-users

--
Oguz Dilmac
ARGE Bolumu

Bilko AS, R&D Department
====================================
Perpa Ticaret Merkezi B Blok Kat 13 Nr. 2568
TR-34384 Okmeydani Istanbul Turkey
Tel : +90 212 220 07 40  Fax :   +90 212 210 47 01
e-mail : [email protected]
web site : http://www.bilko-automation.com

_______________________________________________
etherlab-users mailing list
[email protected]
http://lists.etherlab.org/mailman/listinfo/etherlab-users

Reply via email to