[etherlab-users] A question about ecrt_master_reference_clock_time

2018-12-28 Thread Mohsen Alizadeh Noghani
Hello everyone.

When "ecrt_master_reference_clock_time" is called, does EtherCAT
Master read the reference clock at that instant (i.e. it communicates
with the reference slave specifically for reading its clock), or does
the clock value already exist in the datagram received by
"ecrt_master_receive", and thus function just parses the datagram?

Best,
Mohsen
___
etherlab-users mailing list
etherlab-users@etherlab.org
http://lists.etherlab.org/mailman/listinfo/etherlab-users


Re: [etherlab-users] Syncing master to the reference slave: should I care?

2018-11-21 Thread Mohsen Alizadeh Noghani
Thanks for the detailed response and sharing your insights.
After fixing a few issues in my code, syncing the master's clock to
the reference works reliably.
Best,
Mohsen
On Mon, Nov 19, 2018 at 2:47 AM Graeme Foot  wrote:
>
> FYI option 2 is the default method for TwinCAT.
>
>
>
> Either method is fine, as long as you take care to reduce timing errors.  You 
> should call ecrt_master_application_time() just before the ecrt_master_send() 
> to reduce the amount of time variation between telling the master the PC's 
> time and that time going on the wire.
>
>
>
> If you are using distributed clocks you care about drift.  If you are doing 
> coordinated motion on your robot you should probably be using distributed 
> clocks.  If "all the clocks are drifting, as long as they are synchronized 
> with respect to each other" then that is actually what you are trying to 
> achieve anyway.  You choose one clock as the master for the system and sync 
> the rest to it.  The main thing you need to achieve is make sure the master 
> always sends out its frame so that it reaches all of the slaves before the 
> slaves distributed clock SYNC0 events fire.
>
>
>
>
>
> I use option 2 for a few reasons:
>
>
>
> - Linux calculates a Timebase Frequency on startup.  It is only a quick 
> calculation so that it does not hold up booting Linux for too long, but that 
> also means it is not particularly accurate, and can be different each time 
> you reboot Linux.  This affects the speed of your PC's clock so, if you use 
> option 1, each time you reboot Linux your system may run at a different 
> speed.  (Note, I use RTAI and the time base can be calibrated and set so that 
> it is the same each time, however I auto calibrate my PC to my reference 
> slave clock.)
>
>
>
> - I use Yaskawa axes that do not like too great a drift compensation.  If the 
> timebase calculation above is too far out my axes can have issues and lose 
> their sync.
>
>
>
> - I figure a slaves clock is most likely to more similar to the rest of the 
> slaves clocks, so there will be minimal drift compensation (opinion, not 
> confirmed).
>
>
>
> - If you use option 1 you rely on the time between calling 
> ecrt_master_application_time() and the frame going on the wire and the 
> position of the message in that frame being as constant as possible otherwise 
> the slaves will get a lot of jitter in their drift compensations.  The 
> Etherlab master has multiple code paths which take various amounts of time 
> each cycle so you cannot control this jitter.  Using option 2 often means 
> that the slaves have a much more stable drift compensation and all you need 
> to really care about in your application code is that you keep waking up in 
> time to process the datagrams, do your calculation and send out the new data 
> before the slaves need it.  You don't really care too much about jitter here.
>
>
>
>
>
> Lastly, if you are getting timing error's using option 2 then your master 
> time compensation method is probably wrong.  I don't use the timing method 
> from the rtai_rtdm_dc example so I don't know what might be wrong there.
>
>
>
> Regards,
>
> Graeme
>
>
>
>
>
> -Original Message-
> From: etherlab-users  On Behalf Of 
> Mohsen Alizadeh Noghani
> Sent: Saturday, 17 November 2018 9:46 PM
> To: etherlab-users@etherlab.org
> Subject: [etherlab-users] Syncing master to the reference slave: should I 
> care?
>
>
>
> Hello everyone.
>
> In terms of choosing the reference clock in the network, there are two 
> options. In the first method, PC clock is chosen as the reference and in the 
> second one, slave 0's clock is the reference.
>
> 1- Syncing slave 0's clock to the master (application) time: this is the 
> method used by default by the EtherLab master.
>
> 2- Syncing master (application) time to slave 0: requires implementing the 
> synchronization algorithm by the user, as seen in "rtai_rtdm_dc"
>
> example. This method boasts lower drift, as the slave's clock is more stable.
>
>
>
> However, in my experience, the latter method is more prone to master's 
> jitter, and thus less reliable during a long-term run (e.g. a 24h test under 
> stress).
>
> My area of application is robot motion control.
>
> The question is, using the first method, should I care about clock drift? I 
> feel that, even if all the clocks are drifting, as long as they are 
> synchronized with respect to each other, there shouldn't be any issues.
>
> Best,
>
> Mohsen
>
> ___
>
> etherlab-users mailing list
>
> etherlab-users@etherlab.org
>
> http://lists.etherlab.org/mailman/listinfo/etherlab-users
___
etherlab-users mailing list
etherlab-users@etherlab.org
http://lists.etherlab.org/mailman/listinfo/etherlab-users


[etherlab-users] Syncing master to the reference slave: should I care?

2018-11-17 Thread Mohsen Alizadeh Noghani
Hello everyone.
In terms of choosing the reference clock in the network, there are two
options. In the first method, PC clock is chosen as the reference and
in the second one, slave 0's clock is the reference.
1- Syncing slave 0's clock to the master (application) time: this is
the method used by default by the EtherLab master.
2- Syncing master (application) time to slave 0: requires implementing
the synchronization algorithm by the user, as seen in "rtai_rtdm_dc"
example. This method boasts lower drift, as the slave's clock is more
stable.

However, in my experience, the latter method is more prone to master's
jitter, and thus less reliable during a long-term run (e.g. a 24h test
under stress).
My area of application is robot motion control.
The question is, using the first method, should I care about clock
drift? I feel that, even if all the clocks are drifting, as long as
they are synchronized with respect to each other, there shouldn't be
any issues.
Best,
Mohsen
___
etherlab-users mailing list
etherlab-users@etherlab.org
http://lists.etherlab.org/mailman/listinfo/etherlab-users


[etherlab-users] Difference between "default" and "stable-1.5" branches

2018-11-15 Thread Mohsen Alizadeh Noghani
Hello everyone.
What is the difference between "default" and "stable-1.5" branches of the
SourceForge repository?
I know the"default" version is the one for applying Gavin's patchest to.
Is "stable-1.5" basically "default" + the patches in "stable" folder of the
patchset?
Best,
Mohsen
___
etherlab-users mailing list
etherlab-users@etherlab.org
http://lists.etherlab.org/mailman/listinfo/etherlab-users


Re: [etherlab-users] Measuring the frequency of master sending the frames to network

2018-10-28 Thread Mohsen Alizadeh Noghani
Since I only needed to subtract the reference slave's time in each cycle
from the previous fine, method 2a worked very well. So in the cycle, I have,

#ifdef MEASURE_TIMING
ecrt_master_reference_clock_time(master, _cur);
printf("%" PRIu32 "\n", t_cur - t_prev);
t_prev = t_cur;
#endif


1- How is the time given by *ecrt_master_reference_clock_time() *affected
by the synchronization process? Since I'm syncing the slave's clock in each
cycle, I'm afraid that this would render this method biased in a way.
2- This
<https://drive.google.com/file/d/1rxn1oh0qfaJJi0S_hXkK6wkpe_kO1LMU/view?usp=sharing>
is the result of analyzing the value of *t_cur - t_prev, *which shows a
jitter of about 20 microseconds. Does this value match your experience?
It's certainly much lower than I expected. (I'm using a kernel without
PREEMPT_RT and the process has the maximum priority with FIFO scheduler)
Best,
Mohsen


On Sun, Oct 7, 2018 at 10:29 PM Mohsen Alizadeh Noghani <
m.aliza...@gmail.com> wrote:

> Dear Graeme,
> Thanks for the excellent and detailed explanation. Since I'm already using
> distributed clocks in my program, I think I just have to do capture the
> packets by Wireshark and analyze the timestamps. I will look into
> gavinl's patch for long-term analysis.
> Best,
> Mohsen
>
> On Wed, Oct 3, 2018 at 2:49 AM Graeme Foot 
> wrote:
>
>> Two options:
>>
>>
>>
>> 1) You can use wireshark on another computer.
>>
>>
>>
>> - Plug in a switch inline somewhere on your EtherCAT network, make sure
>> it forwards without delay
>>
>> - Also plug your second computer into the switch, make sure you disable
>> all protocols on the network card (but not the card itself)
>>
>>
>>
>> 1a)
>>
>> - In your application cycle call ecrt_master_sync_slave_clocks()
>>
>> - Run your application and use wireshart to log your data
>>
>> - Run the command:
>>
>> "C:\Program Files\Wireshark\tshark.exe" -r data.pcap -T fields -e
>> ecat.reg.dc.systimeL > data.txt
>>
>> (replacing data.pcap and data.txt with your input and output filenames)
>>
>>
>>
>> 1b) If you have gavinl's patchset
>>
>> - In your application cycle call
>> ecrt_master_64bit_reference_clock_time_queue()
>>
>> - Run your application and use wireshart to log your data
>>
>> - Run the command:
>>
>> "C:\Program Files\Wireshark\tshark.exe" -r data.pcap -T fields -e
>> ecat.reg.dc.systime > data.txt
>>
>> (replacing data.pcap and data.txt with your input and output filenames)
>>
>>
>>
>> - Filter out the appropriate information from data.txt and analyse.
>> Note: wireshark will see each packet twice, once going out and once coming
>> back in.  If the switch is before your reference slave then the timestamp
>> will only be in the returning packet, if it's after then it will be in both.
>>
>>
>>
>>
>>
>> 2) analyse the info within your app
>>
>>
>>
>> 2a)
>>
>> - In your application cycle call ecrt_master_sync_slave_clocks()
>>
>> - get the 32bit clock value using ecrt_master_reference_clock_time()
>>
>>
>>
>> 2b) If you have gavinl's patch set
>>
>> - In your application cycle call
>> ecrt_master_64bit_reference_clock_time_queue()
>>
>> - get the 64bit clock value using ecrt_master_64bit_reference_clock_time()
>>
>>
>>
>> - Analyse the results yourself in the app, or log to file
>>
>>
>>
>>
>>
>> Notes:
>>
>> - The wireshark message timestamp is not accurate enough by itself, hence
>> using the distributed clock reference slave timestamp
>>
>> - EtherCAT frames are broadcast messages so you don't need to do anything
>> special on the switch for your wireshark PC to be able to see them
>>
>> - See: https://www.wireshark.org/docs/dfref/e/ecat.html for a list of
>> possible tshark ethercat fields
>>
>> - The EtherCAT master syncs reference slave using the lower 32bits of the
>> dc clock.  If your application is running at 1khz then this value rolls
>> over every 4.2 odd seconds, so gets more complicated to track long running
>> time.  Gavinl's patchset adds the ability to read the whole 64bit timestamp
>> using ecrt_master_sync_slave_clocks().
>>
>>
>>
>> Regards,
>>
>> Graeme Foot.
>>
>>
>>
>>
>>
>>
>>
>> *From:* etherlab-users  *On Behalf
>> Of *Mohsen Alizadeh Noghani
>> *Sent:* Tuesday, 2 October 2018 10:50 PM
&

[etherlab-users] A question about the master's clock synchronization algorithm used in rtai_rtdm_dc

2018-10-28 Thread Mohsen Alizadeh Noghani
Hello everyone.
In the rtai_rtdm_dc example, there is a choice of syncing the master's
clock to the reference slave, instead of the other way around.
The algorithm is basically implemented in three functions, *system_time_ns*,
*sync_distributed_clocks, *and *update_master_clock.*
There are many variables (both global and local) used in those functions.
Which one shows the difference between the slave's and the master's clock?
I'm looking for something similar to resgister 0x92c, which could be read
in case of syncing the slave 0's clock to the master's.
Best,
Mohsen
___
etherlab-users mailing list
etherlab-users@etherlab.org
http://lists.etherlab.org/mailman/listinfo/etherlab-users


Re: [etherlab-users] Problem with reading reference clock time: Slave synchronization datagram was not received.

2018-10-26 Thread Mohsen Alizadeh Noghani
Calling the function after *ert_master_receive* and before *ecrt_domain_queue()
*fixed the issue. (At the moment, I have only tested it on stable-1.5).
Best,
Mohsen

On Fri, Oct 26, 2018 at 11:29 AM Mohsen Alizadeh Noghani <
m.aliza...@gmail.com> wrote:

> Hello everyone.
> Following my previous email, I have tried reading the 32-bit time of the
> reference clock by *ecrt_master_reference_clock_time* in various versions
> of the library. Here are the results of calling this function in userspace
> code:
>
>- 1.5.2 (*Failed to get reference clock time: Input/output error*)
>- stable-1.5 branch of SourceForge (*Failed to get reference clock
>time: Input/output error*)
>- default branch of SourceForge. (Returns -5: *Slave synchronization
>datagram was not received*)
>- default branch of SourceForge + gavinl's patchset (Returns -5: *Slave
>synchronization datagram was not received*).
>
>
> - As expected, *ecrt_master_64_bit_reference_clock_time* (in the patched
> version) also returns -5 (*Slave synchronization datagram was not
> received*
> ).
> - By reading the register "0x92c" on the reference slave, I can verify
> that the DC mechanism is working as it should.
> So what is causing the error *Slave synchronization datagram was not
> received*?
> Best,
> Mohsen
>
>
>
___
etherlab-users mailing list
etherlab-users@etherlab.org
http://lists.etherlab.org/mailman/listinfo/etherlab-users


[etherlab-users] Problem with reading reference clock time: Slave synchronization datagram was not received.

2018-10-26 Thread Mohsen Alizadeh Noghani
Hello everyone.
Following my previous email, I have tried reading the 32-bit time of the
reference clock by *ecrt_master_reference_clock_time* in various versions
of the library. Here are the results of calling this function in userspace
code:

   - 1.5.2 (*Failed to get reference clock time: Input/output error*)
   - stable-1.5 branch of SourceForge (*Failed to get reference clock time:
   Input/output error*)
   - default branch of SourceForge. (Returns -5: *Slave synchronization
   datagram was not received*)
   - default branch of SourceForge + gavinl's patchset (Returns -5: *Slave
   synchronization datagram was not received*).


- As expected, *ecrt_master_64_bit_reference_clock_time* (in the patched
version) also returns -5 (*Slave synchronization datagram was not received*
).
- By reading the register "0x92c" on the reference slave, I can verify that
the DC mechanism is working as it should.
So what is causing the error *Slave synchronization datagram was not
received*?
Best,
Mohsen
___
etherlab-users mailing list
etherlab-users@etherlab.org
http://lists.etherlab.org/mailman/listinfo/etherlab-users


[etherlab-users] Failed to get reference clock time: Input/output error

2018-10-26 Thread Mohsen Alizadeh Noghani
Hello everyone.
When I call *ecrt_master_reference_clock_time -*right after
*ecrt_master_sync_slave_clocks()- *in my userspace code, I get the
following error every cycle.
*Failed to get reference clock time: Input/output error.*
I'm using stable-1.5 branch.
Has anyone been able to resolve this issue?
Best,
Mohsen
___
etherlab-users mailing list
etherlab-users@etherlab.org
http://lists.etherlab.org/mailman/listinfo/etherlab-users


[etherlab-users] RTAI + DC: Extremely poor and inconsistent performance.

2018-10-25 Thread Mohsen Alizadeh Noghani
Hello everyone.
I can't consistently run a very simple EtherLab RTAI code

with distributed clocks at more than about 100 Hz! If I increase the
frequency, I usually get the EtherCAT error:
*AL status message 0x0032: "PLL error
".*
Basically, the higher the frequency, the higher the likelihood of receiving
this error. I don't think the cause of this problem is on the RTAI side as
the RTAI latency test while the module executes shows a maximum latency of
less than 20 microseconds.
The weird thing is, I can run the same straightforward cyclic task in userspace
(with
non-rt kernel no less) at 3 KHz, with no skipped frames. I expect the RTAI
performance to be way better-not much worse-than userspace code.
Best,
Mohsen
___
etherlab-users mailing list
etherlab-users@etherlab.org
http://lists.etherlab.org/mailman/listinfo/etherlab-users


[etherlab-users] Where, in the application cycle, should I call ecrt_master_64bit_reference_clock_time/queue?

2018-10-25 Thread Mohsen Alizadeh Noghani
Hello everyone.
I would like to know where should I call
*ecrt_master_64bit_reference_clock_time_queue() *
and
*ecrt_master_64bit_reference_clock_time() *
1- with respect to each other (does it matter which one is called first?)
2- with respect the distributed clock function calls? i.e.
*ecrt_master_application_time()*
*ecrt_master_sync_reference_clock()*
*ecrt_master_sync_slave_clocks()*
3- with respect to
*ecrt_domain_queue()*
and
*ecrt_master_send()*

Best,
Mohsen
___
etherlab-users mailing list
etherlab-users@etherlab.org
http://lists.etherlab.org/mailman/listinfo/etherlab-users


[etherlab-users] Unable to write servo drive control word

2018-10-22 Thread Mohsen Alizadeh Noghani
Hi Jan.
I don't think requesting OP mode is a good idea. Drive configuration (e.g.
setting the control word) is often done in the PRE-OP state, which, if the
master module is active, is automatically requested.
Additionally, even if you do enter OP mode, you have to continually send
frames in order to "sustain" it. We only enter OP mode when we start giving
position command to drives.
Therefore, I suggest you try writing the controlword, with subindex, after
loading the master module (/etc/init.d/ethercat start). No additional
commands should be necessary.
Best,
Mohsen
___
etherlab-users mailing list
etherlab-users@etherlab.org
http://lists.etherlab.org/mailman/listinfo/etherlab-users


Re: [etherlab-users] Problem with distributed clocks in RTAI: "Slave did not sync after 5000 ms" & "No Sync Error"

2018-10-22 Thread Mohsen Alizadeh Noghani
Both problems were fixed by using the latest snapshot of stable-1.5 branch
(commit 336963) in SourceForge.

Best,
Mohsen

On Mon, Oct 22, 2018 at 11:07 AM Mohsen Alizadeh Noghani <
m.aliza...@gmail.com> wrote:

> I think I'm dealing with two separate problems here:
> 1- `abs_sync_diff` doesn't converge.
> 2- After the period specified by `EC_DC_SYNC_WAIT_MS`, something happens
> that disrupts the real-time cycle, hence EtherCAT error code 0x002D
> <https://infosys.beckhoff.com/english.php?content=../content/1033/ethercatsystem/1072494091.html=>:
> "No Sync Error".
> Best,
> Mohsen
>
> On Sat, Oct 20, 2018 at 2:08 PM Mohsen Alizadeh Noghani <
> m.aliza...@gmail.com> wrote:
>
>> Also notable is that the userspace code reaches the 10 microseconds
>> threshold after 5.2 seconds, despite having half the update rate of RTAI (1
>> kHz vs. 2 kHz).
>>
>> Best,
>> Mohsen
>>
>> On Sat, Oct 20, 2018 at 1:58 PM Mohsen Alizadeh Noghani <
>> m.aliza...@gmail.com> wrote:
>>
>>> Update: I increased EC_DC_SYNC_WAIT_MS to 5 (50 seconds). I also set
>>> debug level to 1, "ethercat debug 1" and the closest slave 0 (reference
>>> clocks) gets to syncing is after about 48 seconds! ("abs_sync_diff" =
>>> approximately 1.156 ms).
>>> At this point, the value starts to diverge and ends at 1.77 seconds at
>>> the 50 seconds mark.
>>> *kernel: [14573.717225] EtherCAT DEBUG 0-0: Sync after 47800 ms:
>>> 1156111 ns*
>>> .
>>> .
>>> .
>>>
>>> *kernel: [14575.919495] EtherCAT DEBUG 0-0: Sync after 49996 ms:
>>> 1771539607 ns*
>>>
>>> *kernel: [14575.923534] EtherCAT WARNING 0-0: Slave did not sync after
>>> 50012 ms.*
>>>
>>> *kernel: [14575.923536] EtherCAT DEBUG 0-0:
>>> app_start_time=59334441035484*
>>>
>>> *kernel: [14575.923538] EtherCAT DEBUG 0-0:
>>>  app_time=59334442027984*
>>>
>>> *kernel: [14575.923539] EtherCAT DEBUG 0-0:
>>>  start_time=59334442037984*
>>>
>>> *kernel: [14575.923540] EtherCAT DEBUG 0-0: cycle_time=50*
>>>
>>> *kernel: [14575.923542] EtherCAT DEBUG 0-0: shift_time=125000*
>>>
>>> *kernel: [14575.923543] EtherCAT DEBUG 0-0:  remainder=0*
>>>
>>> *kernel: [14575.923544] EtherCAT DEBUG 0-0:
>>> start=593344420380465000*
>>>
>>> *kernel: [14575.923545] EtherCAT DEBUG 0-0: Setting DC cyclic operation
>>> start time to 593344420380465000.*
>>>
>>> *kernel: [14575.928611] EtherCAT DEBUG 0-0: Setting DC AssignActivate to
>>> 0x0300.*
>>>
>>> *kernel: [14575.941292] EtherCAT 0: Domain 0: Working counter changed to
>>> 3/6.*
>>>
>>> *kernel: [14576.000500] EtherCAT DEBUG 0-0: Processing register
>>> request...*
>>>
>>> *kernel: [14576.004685] EtherCAT DEBUG 0-0: Register request successful.*
>>> *kernel: [14576.050335] EtherCAT DEBUG 0-0: Now in SAFEOP.*
>>>
>>> - Is there something wrong with the algorithm used for nudging
>>> "abs_sync_diff" towards 0?
>>> - If so, why does it work perfectly fine in the userspace, but not in
>>> RTAI?
>>>
>>> Best,
>>> Mohsen
>>>
>>> On Fri, Oct 19, 2018 at 1:05 PM Mohsen Alizadeh Noghani <
>>> m.aliza...@gmail.com> wrote:
>>>
>>>> Hello everyone.
>>>> I'm using kernel 3.4.6, RTAI 4.0 and IgH Master 1.5.2.
>>>> When running a simple RTAI program
>>>> <https://github.com/mohse-n/L7N_EtherLab/blob/master/rtai/rtai_sample.c>
>>>> that uses distributed clocks (basically the dc_rtai example), I encounter
>>>> the following kernel log:
>>>>
>>>> *kernel: [ 1891.643677] EtherCAT 0: Link state of ecm0 changed to UP.*
>>>> *kernel: [ 1891.647798] EtherCAT 0: 2 slave(s) responding on main
>>>> device.*
>>>> *kernel: [ 1891.647800] EtherCAT 0: Slave states on main device: PREOP.*
>>>> *kernel: [ 1891.647837] EtherCAT 0: Scanning bus.*
>>>> *kernel: [ 1892.083268] EtherCAT 0: Bus scanning completed in 436 ms.*
>>>> *kernel: [ 1892.083271] EtherCAT 0: Using slave 0 as DC reference
>>>> clock.*
>>>> *kernel: [ 1906.700138] EtherCAT: Requesting master 0...*
>>>> *kernel: [ 1906.700142] EtherCAT: Successfully requested master 0.*
>>>> *kernel: [ 1906.700160] EtherCAT 0: Domain0: Logical address
>>>> 0x, 24 byte, expe

Re: [etherlab-users] Problem with distributed clocks in RTAI: "Slave did not sync after 5000 ms" & "No Sync Error"

2018-10-22 Thread Mohsen Alizadeh Noghani
I think I'm dealing with two separate problems here:
1- `abs_sync_diff` doesn't converge.
2- After the period specified by `EC_DC_SYNC_WAIT_MS`, something happens
that disrupts the real-time cycle, hence EtherCAT error code 0x002D
<https://infosys.beckhoff.com/english.php?content=../content/1033/ethercatsystem/1072494091.html=>:
"No Sync Error".
Best,
Mohsen

On Sat, Oct 20, 2018 at 2:08 PM Mohsen Alizadeh Noghani <
m.aliza...@gmail.com> wrote:

> Also notable is that the userspace code reaches the 10 microseconds
> threshold after 5.2 seconds, despite having half the update rate of RTAI (1
> kHz vs. 2 kHz).
>
> Best,
> Mohsen
>
> On Sat, Oct 20, 2018 at 1:58 PM Mohsen Alizadeh Noghani <
> m.aliza...@gmail.com> wrote:
>
>> Update: I increased EC_DC_SYNC_WAIT_MS to 5 (50 seconds). I also set
>> debug level to 1, "ethercat debug 1" and the closest slave 0 (reference
>> clocks) gets to syncing is after about 48 seconds! ("abs_sync_diff" =
>> approximately 1.156 ms).
>> At this point, the value starts to diverge and ends at 1.77 seconds at
>> the 50 seconds mark.
>> *kernel: [14573.717225] EtherCAT DEBUG 0-0: Sync after 47800 ms:
>> 1156111 ns*
>> .
>> .
>> .
>>
>> *kernel: [14575.919495] EtherCAT DEBUG 0-0: Sync after 49996 ms:
>> 1771539607 ns*
>>
>> *kernel: [14575.923534] EtherCAT WARNING 0-0: Slave did not sync after
>> 50012 ms.*
>>
>> *kernel: [14575.923536] EtherCAT DEBUG 0-0:
>> app_start_time=59334441035484*
>>
>> *kernel: [14575.923538] EtherCAT DEBUG 0-0:
>>  app_time=59334442027984*
>>
>> *kernel: [14575.923539] EtherCAT DEBUG 0-0:
>>  start_time=59334442037984*
>>
>> *kernel: [14575.923540] EtherCAT DEBUG 0-0: cycle_time=50*
>>
>> *kernel: [14575.923542] EtherCAT DEBUG 0-0: shift_time=125000*
>>
>> *kernel: [14575.923543] EtherCAT DEBUG 0-0:  remainder=0*
>>
>> *kernel: [14575.923544] EtherCAT DEBUG 0-0:
>> start=593344420380465000*
>>
>> *kernel: [14575.923545] EtherCAT DEBUG 0-0: Setting DC cyclic operation
>> start time to 593344420380465000.*
>>
>> *kernel: [14575.928611] EtherCAT DEBUG 0-0: Setting DC AssignActivate to
>> 0x0300.*
>>
>> *kernel: [14575.941292] EtherCAT 0: Domain 0: Working counter changed to
>> 3/6.*
>>
>> *kernel: [14576.000500] EtherCAT DEBUG 0-0: Processing register
>> request...*
>>
>> *kernel: [14576.004685] EtherCAT DEBUG 0-0: Register request successful.*
>> *kernel: [14576.050335] EtherCAT DEBUG 0-0: Now in SAFEOP.*
>>
>> - Is there something wrong with the algorithm used for nudging
>> "abs_sync_diff" towards 0?
>> - If so, why does it work perfectly fine in the userspace, but not in
>> RTAI?
>>
>> Best,
>> Mohsen
>>
>> On Fri, Oct 19, 2018 at 1:05 PM Mohsen Alizadeh Noghani <
>> m.aliza...@gmail.com> wrote:
>>
>>> Hello everyone.
>>> I'm using kernel 3.4.6, RTAI 4.0 and IgH Master 1.5.2.
>>> When running a simple RTAI program
>>> <https://github.com/mohse-n/L7N_EtherLab/blob/master/rtai/rtai_sample.c>
>>> that uses distributed clocks (basically the dc_rtai example), I encounter
>>> the following kernel log:
>>>
>>> *kernel: [ 1891.643677] EtherCAT 0: Link state of ecm0 changed to UP.*
>>> *kernel: [ 1891.647798] EtherCAT 0: 2 slave(s) responding on main
>>> device.*
>>> *kernel: [ 1891.647800] EtherCAT 0: Slave states on main device: PREOP.*
>>> *kernel: [ 1891.647837] EtherCAT 0: Scanning bus.*
>>> *kernel: [ 1892.083268] EtherCAT 0: Bus scanning completed in 436 ms.*
>>> *kernel: [ 1892.083271] EtherCAT 0: Using slave 0 as DC reference clock.*
>>> *kernel: [ 1906.700138] EtherCAT: Requesting master 0...*
>>> *kernel: [ 1906.700142] EtherCAT: Successfully requested master 0.*
>>> *kernel: [ 1906.700160] EtherCAT 0: Domain0: Logical address 0x,
>>> 24 byte, expected working counter 6.*
>>> *kernel: [ 1906.700161] EtherCAT 0:   Datagram domain0-0-main: Logical
>>> offset 0x, 24 byte, type LRW.*
>>> *kernel: [ 1906.700185] EtherCAT 0: Master thread exited.*
>>> *kernel: [ 1906.700187] EtherCAT 0: Starting EtherCAT-OP thread.*
>>> *kernel: [ 1906.704215] ec_rtai_sample: RT timer started with 3116/3117
>>> ticks.*
>>> *kernel: [ 1906.704218] ec_rtai_sample: Initialized.*
>>> *kernel: [ 1911.935059] EtherCAT WARNING 0-0: Slave did not sync after
>>> 5000 ms.*
>>> *kernel: [ 1911.946039] EtherCAT 0: D

Re: [etherlab-users] Problem with distributed clocks in RTAI: "Slave did not sync after 5000 ms" & "No Sync Error"

2018-10-20 Thread Mohsen Alizadeh Noghani
Also notable is that the userspace code reaches the 10 microseconds
threshold after 5.2 seconds, despite having half the update rate of RTAI (1
kHz vs. 2 kHz).

Best,
Mohsen

On Sat, Oct 20, 2018 at 1:58 PM Mohsen Alizadeh Noghani <
m.aliza...@gmail.com> wrote:

> Update: I increased EC_DC_SYNC_WAIT_MS to 5 (50 seconds). I also set
> debug level to 1, "ethercat debug 1" and the closest slave 0 (reference
> clocks) gets to syncing is after about 48 seconds! ("abs_sync_diff" =
> approximately 1.156 ms).
> At this point, the value starts to diverge and ends at 1.77 seconds at the
> 50 seconds mark.
> *kernel: [14573.717225] EtherCAT DEBUG 0-0: Sync after 47800 ms:
> 1156111 ns*
> .
> .
> .
>
> *kernel: [14575.919495] EtherCAT DEBUG 0-0: Sync after 49996 ms:
> 1771539607 ns*
>
> *kernel: [14575.923534] EtherCAT WARNING 0-0: Slave did not sync after
> 50012 ms.*
>
> *kernel: [14575.923536] EtherCAT DEBUG 0-0:
> app_start_time=59334441035484*
>
> *kernel: [14575.923538] EtherCAT DEBUG 0-0:
>  app_time=59334442027984*
>
> *kernel: [14575.923539] EtherCAT DEBUG 0-0:
>  start_time=59334442037984*
>
> *kernel: [14575.923540] EtherCAT DEBUG 0-0: cycle_time=50*
>
> *kernel: [14575.923542] EtherCAT DEBUG 0-0: shift_time=125000*
>
> *kernel: [14575.923543] EtherCAT DEBUG 0-0:  remainder=0*
>
> *kernel: [14575.923544] EtherCAT DEBUG 0-0:
> start=593344420380465000*
>
> *kernel: [14575.923545] EtherCAT DEBUG 0-0: Setting DC cyclic operation
> start time to 593344420380465000.*
>
> *kernel: [14575.928611] EtherCAT DEBUG 0-0: Setting DC AssignActivate to
> 0x0300.*
>
> *kernel: [14575.941292] EtherCAT 0: Domain 0: Working counter changed to
> 3/6.*
>
> *kernel: [14576.000500] EtherCAT DEBUG 0-0: Processing register request...*
>
> *kernel: [14576.004685] EtherCAT DEBUG 0-0: Register request successful.*
> *kernel: [14576.050335] EtherCAT DEBUG 0-0: Now in SAFEOP.*
>
> - Is there something wrong with the algorithm used for nudging
> "abs_sync_diff" towards 0?
> - If so, why does it work perfectly fine in the userspace, but not in RTAI?
>
> Best,
> Mohsen
>
> On Fri, Oct 19, 2018 at 1:05 PM Mohsen Alizadeh Noghani <
> m.aliza...@gmail.com> wrote:
>
>> Hello everyone.
>> I'm using kernel 3.4.6, RTAI 4.0 and IgH Master 1.5.2.
>> When running a simple RTAI program
>> <https://github.com/mohse-n/L7N_EtherLab/blob/master/rtai/rtai_sample.c>
>> that uses distributed clocks (basically the dc_rtai example), I encounter
>> the following kernel log:
>>
>> *kernel: [ 1891.643677] EtherCAT 0: Link state of ecm0 changed to UP.*
>> *kernel: [ 1891.647798] EtherCAT 0: 2 slave(s) responding on main device.*
>> *kernel: [ 1891.647800] EtherCAT 0: Slave states on main device: PREOP.*
>> *kernel: [ 1891.647837] EtherCAT 0: Scanning bus.*
>> *kernel: [ 1892.083268] EtherCAT 0: Bus scanning completed in 436 ms.*
>> *kernel: [ 1892.083271] EtherCAT 0: Using slave 0 as DC reference clock.*
>> *kernel: [ 1906.700138] EtherCAT: Requesting master 0...*
>> *kernel: [ 1906.700142] EtherCAT: Successfully requested master 0.*
>> *kernel: [ 1906.700160] EtherCAT 0: Domain0: Logical address 0x,
>> 24 byte, expected working counter 6.*
>> *kernel: [ 1906.700161] EtherCAT 0:   Datagram domain0-0-main: Logical
>> offset 0x, 24 byte, type LRW.*
>> *kernel: [ 1906.700185] EtherCAT 0: Master thread exited.*
>> *kernel: [ 1906.700187] EtherCAT 0: Starting EtherCAT-OP thread.*
>> *kernel: [ 1906.704215] ec_rtai_sample: RT timer started with 3116/3117
>> ticks.*
>> *kernel: [ 1906.704218] ec_rtai_sample: Initialized.*
>> *kernel: [ 1911.935059] EtherCAT WARNING 0-0: Slave did not sync after
>> 5000 ms.*
>> *kernel: [ 1911.946039] EtherCAT 0: Domain 0: Working counter changed to
>> 3/6.*
>> *kernel: [ 1914.070216] EtherCAT ERROR 0-0: Failed to set OP state, slave
>> refused state change (SAFEOP + ERROR).*
>> *kernel: [ 1914.073870] EtherCAT ERROR 0-0: AL status message 0x002D: "No
>> Sync Error".*
>> *kernel: [ 1914.081189] EtherCAT 0-0: Acknowledged state SAFEOP.*
>> *kernel: [ 1919.308375] EtherCAT WARNING 0-1: Slave did not sync after
>> 5000 ms.*
>> *kernel: [ 1919.321187] EtherCAT 0: Domain 0: Working counter changed to
>> 6/6.*
>> *kernel: [ 1921.449013] EtherCAT ERROR 0-1: Failed to set OP state, slave
>> refused state change (SAFEOP + ERROR).*
>> *kernel: [ 1921.452670] EtherCAT ERROR 0-1: AL status message 0x002D: "No
>> Sync Error".*
>> *kernel: [ 1921.459991] EtherCAT 0-1: Acknowledged state SAFEOP.*
>> 

Re: [etherlab-users] Problem with distributed clocks in RTAI: "Slave did not sync after 5000 ms" & "No Sync Error"

2018-10-20 Thread Mohsen Alizadeh Noghani
Update: I increased EC_DC_SYNC_WAIT_MS to 5 (50 seconds). I also set
debug level to 1, "ethercat debug 1" and the closest slave 0 (reference
clocks) gets to syncing is after about 48 seconds! ("abs_sync_diff" =
approximately 1.156 ms).
At this point, the value starts to diverge and ends at 1.77 seconds at the
50 seconds mark.
*kernel: [14573.717225] EtherCAT DEBUG 0-0: Sync after 47800 ms:1156111
ns*
.
.
.

*kernel: [14575.919495] EtherCAT DEBUG 0-0: Sync after 49996 ms: 1771539607
ns*

*kernel: [14575.923534] EtherCAT WARNING 0-0: Slave did not sync after
50012 ms.*

*kernel: [14575.923536] EtherCAT DEBUG 0-0:
app_start_time=59334441035484*

*kernel: [14575.923538] EtherCAT DEBUG 0-0:
 app_time=59334442027984*

*kernel: [14575.923539] EtherCAT DEBUG 0-0:
 start_time=59334442037984*

*kernel: [14575.923540] EtherCAT DEBUG 0-0: cycle_time=50*

*kernel: [14575.923542] EtherCAT DEBUG 0-0: shift_time=125000*

*kernel: [14575.923543] EtherCAT DEBUG 0-0:  remainder=0*

*kernel: [14575.923544] EtherCAT DEBUG 0-0:
start=593344420380465000*

*kernel: [14575.923545] EtherCAT DEBUG 0-0: Setting DC cyclic operation
start time to 593344420380465000.*

*kernel: [14575.928611] EtherCAT DEBUG 0-0: Setting DC AssignActivate to
0x0300.*

*kernel: [14575.941292] EtherCAT 0: Domain 0: Working counter changed to
3/6.*

*kernel: [14576.000500] EtherCAT DEBUG 0-0: Processing register request...*

*kernel: [14576.004685] EtherCAT DEBUG 0-0: Register request successful.*
*kernel: [14576.050335] EtherCAT DEBUG 0-0: Now in SAFEOP.*

- Is there something wrong with the algorithm used for nudging
"abs_sync_diff" towards 0?
- If so, why does it work perfectly fine in the userspace, but not in RTAI?

Best,
Mohsen

On Fri, Oct 19, 2018 at 1:05 PM Mohsen Alizadeh Noghani <
m.aliza...@gmail.com> wrote:

> Hello everyone.
> I'm using kernel 3.4.6, RTAI 4.0 and IgH Master 1.5.2.
> When running a simple RTAI program
> <https://github.com/mohse-n/L7N_EtherLab/blob/master/rtai/rtai_sample.c>
> that uses distributed clocks (basically the dc_rtai example), I encounter
> the following kernel log:
>
> *kernel: [ 1891.643677] EtherCAT 0: Link state of ecm0 changed to UP.*
> *kernel: [ 1891.647798] EtherCAT 0: 2 slave(s) responding on main device.*
> *kernel: [ 1891.647800] EtherCAT 0: Slave states on main device: PREOP.*
> *kernel: [ 1891.647837] EtherCAT 0: Scanning bus.*
> *kernel: [ 1892.083268] EtherCAT 0: Bus scanning completed in 436 ms.*
> *kernel: [ 1892.083271] EtherCAT 0: Using slave 0 as DC reference clock.*
> *kernel: [ 1906.700138] EtherCAT: Requesting master 0...*
> *kernel: [ 1906.700142] EtherCAT: Successfully requested master 0.*
> *kernel: [ 1906.700160] EtherCAT 0: Domain0: Logical address 0x,
> 24 byte, expected working counter 6.*
> *kernel: [ 1906.700161] EtherCAT 0:   Datagram domain0-0-main: Logical
> offset 0x, 24 byte, type LRW.*
> *kernel: [ 1906.700185] EtherCAT 0: Master thread exited.*
> *kernel: [ 1906.700187] EtherCAT 0: Starting EtherCAT-OP thread.*
> *kernel: [ 1906.704215] ec_rtai_sample: RT timer started with 3116/3117
> ticks.*
> *kernel: [ 1906.704218] ec_rtai_sample: Initialized.*
> *kernel: [ 1911.935059] EtherCAT WARNING 0-0: Slave did not sync after
> 5000 ms.*
> *kernel: [ 1911.946039] EtherCAT 0: Domain 0: Working counter changed to
> 3/6.*
> *kernel: [ 1914.070216] EtherCAT ERROR 0-0: Failed to set OP state, slave
> refused state change (SAFEOP + ERROR).*
> *kernel: [ 1914.073870] EtherCAT ERROR 0-0: AL status message 0x002D: "No
> Sync Error".*
> *kernel: [ 1914.081189] EtherCAT 0-0: Acknowledged state SAFEOP.*
> *kernel: [ 1919.308375] EtherCAT WARNING 0-1: Slave did not sync after
> 5000 ms.*
> *kernel: [ 1919.321187] EtherCAT 0: Domain 0: Working counter changed to
> 6/6.*
> *kernel: [ 1921.449013] EtherCAT ERROR 0-1: Failed to set OP state, slave
> refused state change (SAFEOP + ERROR).*
> *kernel: [ 1921.452670] EtherCAT ERROR 0-1: AL status message 0x002D: "No
> Sync Error".*
> *kernel: [ 1921.459991] EtherCAT 0-1: Acknowledged state SAFEOP.*
> *kernel: [ 1921.469158] EtherCAT 0: Slave states on main device: SAFEOP.*
>
> The slaves (servo drives) would give an alarm related to EtherCAT
> communication.
> Apparently, the slaves are unable to sync after 5 seconds. But why?
> (Note: I have tested the distributed clocks example in userspace and it
> works, so I don't think the issue is from the slaves' side.)
> Best,
> Mohsen
>
___
etherlab-users mailing list
etherlab-users@etherlab.org
http://lists.etherlab.org/mailman/listinfo/etherlab-users


[etherlab-users] Problem with distributed clocks in RTAI: "Slave did not sync after 5000 ms" & "No Sync Error"

2018-10-19 Thread Mohsen Alizadeh Noghani
Hello everyone.
I'm using kernel 3.4.6, RTAI 4.0 and IgH Master 1.5.2.
When running a simple RTAI program

that uses distributed clocks (basically the dc_rtai example), I encounter
the following kernel log:

*kernel: [ 1891.643677] EtherCAT 0: Link state of ecm0 changed to UP.*
*kernel: [ 1891.647798] EtherCAT 0: 2 slave(s) responding on main device.*
*kernel: [ 1891.647800] EtherCAT 0: Slave states on main device: PREOP.*
*kernel: [ 1891.647837] EtherCAT 0: Scanning bus.*
*kernel: [ 1892.083268] EtherCAT 0: Bus scanning completed in 436 ms.*
*kernel: [ 1892.083271] EtherCAT 0: Using slave 0 as DC reference clock.*
*kernel: [ 1906.700138] EtherCAT: Requesting master 0...*
*kernel: [ 1906.700142] EtherCAT: Successfully requested master 0.*
*kernel: [ 1906.700160] EtherCAT 0: Domain0: Logical address 0x, 24
byte, expected working counter 6.*
*kernel: [ 1906.700161] EtherCAT 0:   Datagram domain0-0-main: Logical
offset 0x, 24 byte, type LRW.*
*kernel: [ 1906.700185] EtherCAT 0: Master thread exited.*
*kernel: [ 1906.700187] EtherCAT 0: Starting EtherCAT-OP thread.*
*kernel: [ 1906.704215] ec_rtai_sample: RT timer started with 3116/3117
ticks.*
*kernel: [ 1906.704218] ec_rtai_sample: Initialized.*
*kernel: [ 1911.935059] EtherCAT WARNING 0-0: Slave did not sync after 5000
ms.*
*kernel: [ 1911.946039] EtherCAT 0: Domain 0: Working counter changed to
3/6.*
*kernel: [ 1914.070216] EtherCAT ERROR 0-0: Failed to set OP state, slave
refused state change (SAFEOP + ERROR).*
*kernel: [ 1914.073870] EtherCAT ERROR 0-0: AL status message 0x002D: "No
Sync Error".*
*kernel: [ 1914.081189] EtherCAT 0-0: Acknowledged state SAFEOP.*
*kernel: [ 1919.308375] EtherCAT WARNING 0-1: Slave did not sync after 5000
ms.*
*kernel: [ 1919.321187] EtherCAT 0: Domain 0: Working counter changed to
6/6.*
*kernel: [ 1921.449013] EtherCAT ERROR 0-1: Failed to set OP state, slave
refused state change (SAFEOP + ERROR).*
*kernel: [ 1921.452670] EtherCAT ERROR 0-1: AL status message 0x002D: "No
Sync Error".*
*kernel: [ 1921.459991] EtherCAT 0-1: Acknowledged state SAFEOP.*
*kernel: [ 1921.469158] EtherCAT 0: Slave states on main device: SAFEOP.*

The slaves (servo drives) would give an alarm related to EtherCAT
communication.
Apparently, the slaves are unable to sync after 5 seconds. But why?
(Note: I have tested the distributed clocks example in userspace and it
works, so I don't think the issue is from the slaves' side.)
Best,
Mohsen
___
etherlab-users mailing list
etherlab-users@etherlab.org
http://lists.etherlab.org/mailman/listinfo/etherlab-users


Re: [etherlab-users] rtai_rtdm example code hangs after activating master

2018-10-16 Thread Mohsen Alizadeh Noghani
Update: The problem persists in the latest update from SourceForge.
Best,
Mohsen

On Mon, Oct 15, 2018 at 11:43 PM Mohsen Alizadeh Noghani <
m.aliza...@gmail.com> wrote:

> I should have also mentioned that I'm using kernel 3.4.6 and IgH EtherCAT
> Master 1.5.2.
> Best,
> Mohsen
>
> On Mon, Oct 15, 2018 at 2:26 PM Mohsen Alizadeh Noghani <
> m.aliza...@gmail.com> wrote:
>
>> Running the rtai_rtdm example hangs at "ecrt_master_activate". This
>> happens in such a way that I can't even stop the process with a ctrl+c
>> signal.
>> *Additional info:*
>> - Nothing out of ordinary in dmesg, the last message is,
>> *EtherCAT successfully requested master 0.*
>> - I'm using r8169 driver (the user example works fine) and RTAI 4.0.
>> - I did receive two warnings when make ing the example,
>>  Warning: Linking the executable ec_rtai_rtdm_example against the
>> loadable module.*
>>  liblxrt.so in not portable!*
>>
>>  Warning: Linking the executable ec_rtai_rtdm_example against the
>> loadable module*
>>  librtdm.so is not portable!*
>>
>>
>>
>>
___
etherlab-users mailing list
etherlab-users@etherlab.org
http://lists.etherlab.org/mailman/listinfo/etherlab-users


Re: [etherlab-users] rtai_rtdm example code hangs after activating master

2018-10-15 Thread Mohsen Alizadeh Noghani
I should have also mentioned that I'm using kernel 3.4.6 and IgH EtherCAT
Master 1.5.2.
Best,
Mohsen

On Mon, Oct 15, 2018 at 2:26 PM Mohsen Alizadeh Noghani <
m.aliza...@gmail.com> wrote:

> Running the rtai_rtdm example hangs at "ecrt_master_activate". This
> happens in such a way that I can't even stop the process with a ctrl+c
> signal.
> *Additional info:*
> - Nothing out of ordinary in dmesg, the last message is,
> *EtherCAT successfully requested master 0.*
> - I'm using r8169 driver (the user example works fine) and RTAI 4.0.
> - I did receive two warnings when make ing the example,
>  Warning: Linking the executable ec_rtai_rtdm_example against the
> loadable module.*
>  liblxrt.so in not portable!*
>
>  Warning: Linking the executable ec_rtai_rtdm_example against the
> loadable module*
>  librtdm.so is not portable!*
>
>
>
>
___
etherlab-users mailing list
etherlab-users@etherlab.org
http://lists.etherlab.org/mailman/listinfo/etherlab-users


[etherlab-users] rtai_rtdm example code hangs after activating master

2018-10-15 Thread Mohsen Alizadeh Noghani
Running the rtai_rtdm example hangs at "ecrt_master_activate". This happens
in such a way that I can't even stop the process with a ctrl+c signal.
*Additional info:*
- Nothing out of ordinary in dmesg, the last message is,
*EtherCAT successfully requested master 0.*
- I'm using r8169 driver (the user example works fine) and RTAI 4.0.
- I did receive two warnings when make ing the example,
 Warning: Linking the executable ec_rtai_rtdm_example against the
loadable module.*
 liblxrt.so in not portable!*

 Warning: Linking the executable ec_rtai_rtdm_example against the
loadable module*
 librtdm.so is not portable!*
___
etherlab-users mailing list
etherlab-users@etherlab.org
http://lists.etherlab.org/mailman/listinfo/etherlab-users


[etherlab-users] Can I only apply gavinl's driver patches?

2018-10-11 Thread Mohsen Alizadeh Noghani
I'm using kernel 4.1.18 and RTAI 5.0.1.
Patched r8169 drivers are available in gavinl's
patchset
for kernel 4.1, 4.1.13, and 4.1.14.
1- Considering my kernel version, which one do you suggest I use?
2- What do I have do to differently before and during EtherLab's
installation process for this to work? Can I just apply the driver patches
and proceed with the installation
 as
usual? Or do I, alternatively, have to apply the other patches?
Best,
Mohsen
___
etherlab-users mailing list
etherlab-users@etherlab.org
http://lists.etherlab.org/mailman/listinfo/etherlab-users


Re: [etherlab-users] Measuring the frequency of master sending the frames to network

2018-10-07 Thread Mohsen Alizadeh Noghani
Dear Graeme,
Thanks for the excellent and detailed explanation. Since I'm already using
distributed clocks in my program, I think I just have to do capture the
packets by Wireshark and analyze the timestamps. I will look into
gavinl's patch for long-term analysis.
Best,
Mohsen

On Wed, Oct 3, 2018 at 2:49 AM Graeme Foot  wrote:

> Two options:
>
>
>
> 1) You can use wireshark on another computer.
>
>
>
> - Plug in a switch inline somewhere on your EtherCAT network, make sure it
> forwards without delay
>
> - Also plug your second computer into the switch, make sure you disable
> all protocols on the network card (but not the card itself)
>
>
>
> 1a)
>
> - In your application cycle call ecrt_master_sync_slave_clocks()
>
> - Run your application and use wireshart to log your data
>
> - Run the command:
>
> "C:\Program Files\Wireshark\tshark.exe" -r data.pcap -T fields -e
> ecat.reg.dc.systimeL > data.txt
>
> (replacing data.pcap and data.txt with your input and output filenames)
>
>
>
> 1b) If you have gavinl's patchset
>
> - In your application cycle call
> ecrt_master_64bit_reference_clock_time_queue()
>
> - Run your application and use wireshart to log your data
>
> - Run the command:
>
> "C:\Program Files\Wireshark\tshark.exe" -r data.pcap -T fields -e
> ecat.reg.dc.systime > data.txt
>
> (replacing data.pcap and data.txt with your input and output filenames)
>
>
>
> - Filter out the appropriate information from data.txt and analyse.  Note:
> wireshark will see each packet twice, once going out and once coming back
> in.  If the switch is before your reference slave then the timestamp will
> only be in the returning packet, if it's after then it will be in both.
>
>
>
>
>
> 2) analyse the info within your app
>
>
>
> 2a)
>
> - In your application cycle call ecrt_master_sync_slave_clocks()
>
> - get the 32bit clock value using ecrt_master_reference_clock_time()
>
>
>
> 2b) If you have gavinl's patch set
>
> - In your application cycle call
> ecrt_master_64bit_reference_clock_time_queue()
>
> - get the 64bit clock value using ecrt_master_64bit_reference_clock_time()
>
>
>
> - Analyse the results yourself in the app, or log to file
>
>
>
>
>
> Notes:
>
> - The wireshark message timestamp is not accurate enough by itself, hence
> using the distributed clock reference slave timestamp
>
> - EtherCAT frames are broadcast messages so you don't need to do anything
> special on the switch for your wireshark PC to be able to see them
>
> - See: https://www.wireshark.org/docs/dfref/e/ecat.html for a list of
> possible tshark ethercat fields
>
> - The EtherCAT master syncs reference slave using the lower 32bits of the
> dc clock.  If your application is running at 1khz then this value rolls
> over every 4.2 odd seconds, so gets more complicated to track long running
> time.  Gavinl's patchset adds the ability to read the whole 64bit timestamp
> using ecrt_master_sync_slave_clocks().
>
>
>
> Regards,
>
> Graeme Foot.
>
>
>
>
>
>
>
> *From:* etherlab-users  *On Behalf
> Of *Mohsen Alizadeh Noghani
> *Sent:* Tuesday, 2 October 2018 10:50 PM
> *To:* etherlab-users@etherlab.org
> *Subject:* [etherlab-users] Measuring the frequency of master sending the
> frames to network
>
>
>
> In motion control applications, smooth motion and small error often
> requires an update rate of at least 1 KHz.
>
> When defining a task in RTAI, we can set its execution frequency.
> Therefore, if we set the frequency to 2 KHz, the master is expected to send
> EtherCAT frames every 0.5 ms + jitter.
>
> Other than using a network probe (e.g. Beckhoff ET2000) connected to
> another PC and analyzing the timestamps, is there a reliable way for
> measuring this frequency? In other words, I want to stress test the master
> for a few hours and make sure that all frames are sent before the real-time
> deadlines.
>
> Best,
>
> Mohsen
>
>
>
___
etherlab-users mailing list
etherlab-users@etherlab.org
http://lists.etherlab.org/mailman/listinfo/etherlab-users


Re: [etherlab-users] Measuring the frequency of master sending the frames to network

2018-10-07 Thread Mohsen Alizadeh Noghani
Dear Gavin,
Thanks for the suggestion. I don't have access to the pins, and I'm not
sure if it's practical to identify each frame by its start or end signal
for even a few seconds on an oscilloscope (the rate of transmission is too
high). But I will try this method if all else fails.
Best,
Mohsen

On Wed, Oct 3, 2018 at 4:19 AM Gavin Lambert 
wrote:

> If you have hardware access to a slave then you can also hook a scope or
> other monitor to the ESC pins which indicate sync pulses or SOF/EOF (packet
> arrival).  This is probably easiest if you have a custom slave or if the
> particular slave you’re using exposes these for diagnostic purposes;
> otherwise I don’t recommend trying to crack an off-the-shelf slave open to
> try to access these signals. 
>
>
>
> *From:* Graeme Foot
> *Sent:* Wednesday, 3 October 2018 12:20
> *To:* Mohsen Alizadeh Noghani ;
> etherlab-users@etherlab.org
> *Subject:* Re: [etherlab-users] Measuring the frequency of master sending
> the frames to network
>
>
>
> Two options:
>
>
>
> 1) You can use wireshark on another computer.
>
>
>
> - Plug in a switch inline somewhere on your EtherCAT network, make sure it
> forwards without delay
>
> - Also plug your second computer into the switch, make sure you disable
> all protocols on the network card (but not the card itself)
>
>
>
> 1a)
>
> - In your application cycle call ecrt_master_sync_slave_clocks()
>
> - Run your application and use wireshart to log your data
>
> - Run the command:
>
> "C:\Program Files\Wireshark\tshark.exe" -r data.pcap -T fields -e
> ecat.reg.dc.systimeL > data.txt
>
> (replacing data.pcap and data.txt with your input and output filenames)
>
>
>
> 1b) If you have gavinl's patchset
>
> - In your application cycle call
> ecrt_master_64bit_reference_clock_time_queue()
>
> - Run your application and use wireshart to log your data
>
> - Run the command:
>
> "C:\Program Files\Wireshark\tshark.exe" -r data.pcap -T fields -e
> ecat.reg.dc.systime > data.txt
>
> (replacing data.pcap and data.txt with your input and output filenames)
>
>
>
> - Filter out the appropriate information from data.txt and analyse.  Note:
> wireshark will see each packet twice, once going out and once coming back
> in.  If the switch is before your reference slave then the timestamp will
> only be in the returning packet, if it's after then it will be in both.
>
>
>
>
>
> 2) analyse the info within your app
>
>
>
> 2a)
>
> - In your application cycle call ecrt_master_sync_slave_clocks()
>
> - get the 32bit clock value using ecrt_master_reference_clock_time()
>
>
>
> 2b) If you have gavinl's patch set
>
> - In your application cycle call
> ecrt_master_64bit_reference_clock_time_queue()
>
> - get the 64bit clock value using ecrt_master_64bit_reference_clock_time()
>
>
>
> - Analyse the results yourself in the app, or log to file
>
>
>
>
>
> Notes:
>
> - The wireshark message timestamp is not accurate enough by itself, hence
> using the distributed clock reference slave timestamp
>
> - EtherCAT frames are broadcast messages so you don't need to do anything
> special on the switch for your wireshark PC to be able to see them
>
> - See: https://www.wireshark.org/docs/dfref/e/ecat.html
> <https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.wireshark.org%2Fdocs%2Fdfref%2Fe%2Fecat.html=02%7C01%7Cgavin.lambert%40tomra.com%7C7fd3e029a6144a91fc0608d628bd96f4%7C4308d118edd143008a37cfeba8ad5898%7C0%7C0%7C636741192100743022=mAIOwRdHbZDk2mim4zVEMgoMtPz%2FAMSWUCQPmHXUh0o%3D=0>
> for a list of possible tshark ethercat fields
>
> - The EtherCAT master syncs reference slave using the lower 32bits of the
> dc clock.  If your application is running at 1khz then this value rolls
> over every 4.2 odd seconds, so gets more complicated to track long running
> time.  Gavinl's patchset adds the ability to read the whole 64bit timestamp
> using ecrt_master_sync_slave_clocks().
>
>
>
> Regards,
>
> Graeme Foot.
>
>
>
>
>
>
>
> *From:* etherlab-users  *On Behalf
> Of *Mohsen Alizadeh Noghani
> *Sent:* Tuesday, 2 October 2018 10:50 PM
> *To:* etherlab-users@etherlab.org
> *Subject:* [etherlab-users] Measuring the frequency of master sending the
> frames to network
>
>
>
> In motion control applications, smooth motion and small error often
> requires an update rate of at least 1 KHz.
>
> When defining a task in RTAI, we can set its execution frequency.
> Therefore, if we set the frequency to 2 KHz, the master is expected to send
> EtherCAT frames every 0.5 ms + jitter.
>
> Other than usi

Re: [etherlab-users] etherlab-users Digest, Vol 136, Issue 8

2018-10-05 Thread Mohsen Alizadeh Noghani
Dear Christoph,
Thanks, ecrt_slave_config_state was what I was looking for.
So in my first loop, I basically have
while (1)
{
...
ecrt_slave_config_state(drive0, );
ecrt_slave_config_state(drive1, );

if (slaveState0.operational && slaveState1.operational)
{
printf("All slaves have reached OP state\n");
break;
}
...
}

Best,
Mohsen


On Fri, Oct 5, 2018 at 1:31 PM  wrote:

> Send etherlab-users mailing list submissions to
> etherlab-users@etherlab.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://lists.etherlab.org/mailman/listinfo/etherlab-users
> or, via email, send a message with subject or body 'help' to
> etherlab-users-requ...@etherlab.org
>
> You can reach the person managing the list at
> etherlab-users-ow...@etherlab.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of etherlab-users digest..."
>
>
> Today's Topics:
>
>1. Re: How to check if all slaves have   reached operational
>   state? (Ian Prochazka)
>2. Re: How to check if all slaves have reached operational
>   state? (Christoph Schroeder)
>
>
> ------
>
> Message: 1
> Date: Thu, 4 Oct 2018 17:15:34 -0400
> From: Ian Prochazka 
> To: Mohsen Alizadeh Noghani ,
> "etherlab-users@etherlab.org" 
> Subject: Re: [etherlab-users] How to check if all slaves have   reached
> operational state?
> Message-ID:
> <
> a262e7bd3f5d9049adbaccc455b324b801b259811...@server.persimmontech.com>
>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Would user command from OS console give you the answer:
>
> x@x<mailto:x@x::~$>::~$<mailto:x@x::~$> ethercat
> slaves
>
>
>
> The ethercat commands can be used while your application is running. Try
> 'ethercat --help' for other options
>
>
>
> Best regards,
>
> Ian
>
>
>
> 
> From: etherlab-users [etherlab-users-boun...@etherlab.org] On Behalf Of
> Mohsen Alizadeh Noghani [m.aliza...@gmail.com]
> Sent: Thursday, October 04, 2018 3:06 AM
> To: etherlab-users@etherlab.org
> Subject: [etherlab-users] How to check if all slaves have reached
> operational state?
>
> Dear EtherLab users,
> After activating the master and starting frame exchange, is there a way to
> check whether all states have reached operational?
> Additional info:
> Currently, in my code<
> https://github.com/mohse-n/L7N_EtherLab/blob/master/simple_test.c>, I
> just send empty frames for long enough (trial and error) so that when I
> exit the loop, my slaves (servo drives) are in OP state.
> I have tried checking the working counter in the loop and exiting from it
> after the domain's working counter becomes equal to our expected value.
> However, there is still a small delay after that happens and the second
> slave reaching operational state.
> Best,
> Mohsen
> -- next part --
> An HTML attachment was scrubbed...
> URL: <
> http://lists.etherlab.org/pipermail/etherlab-users/attachments/20181004/c3ea4ccb/attachment-0001.html
> >
>
> --
>
> Message: 2
> Date: Fri, 5 Oct 2018 10:17:50 +0200
> From: Christoph Schroeder 
> To: 
> Subject: Re: [etherlab-users] How to check if all slaves have reached
> operational state?
> Message-ID: <9d29754c-7a92-1d11-c8bb-07058e17a...@helmholtz-berlin.de>
> Content-Type: text/plain; charset="windows-1252"; Format="flowed"
>
> Hi Mohsen,
>
> additionally you can use ecrt_slave_config_state in your application. I
> call this function plus ecrt_master_state and ecrt_domain_state every other
> second to check the status of the whole setup.
>
> Best regards,
> Christoph
>
> On 10/4/18 11:15 PM, Ian Prochazka wrote:
> Would user command from OS console give you the answer:
>
> x@x<mailto:x@x::~$>::~$<mailto:x@x::~$> ethercat
> slaves
>
>
>
> The ethercat commands can be used while your application is running. Try
> 'ethercat --help' for other options
>
>
>
> Best regards,
>
> Ian
>
>
>
> 
> From: etherlab-users [etherlab-users-boun...@etherlab.org etherlab-users-boun...@etherlab.org>] On Behalf Of Mohsen Alizadeh
> Noghani [m.aliza...@gmail.com<mailto:m.aliza...@gmail.com>]
> Sent: Thursday, October 04, 2018 3:06 AM
> To: etherlab-users@etherlab.org<mailto:etherlab-users@eth

[etherlab-users] Xenomai vs. RTAI+RTDM

2018-10-05 Thread Mohsen Alizadeh Noghani
Hello everyone.
It seems to me that for executing hard real-time programs alongside
userspace applications (e.g. a GUI), there are two possibilities: Xenomai
and RTAI+RTDM.
("Vanilla" RTAI programs are kernel modules so I think using a GUI
alongside it is out of the picture.).
How do these two options compare with each other in terms of
1- Performance?
2- Ease of use and support in this community?
Best,
Mohsen
___
etherlab-users mailing list
etherlab-users@etherlab.org
http://lists.etherlab.org/mailman/listinfo/etherlab-users


[etherlab-users] How to check if all slaves have reached operational state?

2018-10-04 Thread Mohsen Alizadeh Noghani
Dear EtherLab users,
After activating the master and starting frame exchange, is there a way to
check whether all states have reached operational?
*Additional info:*
Currently, in my code
, I just
send empty frames for long enough (trial and error) so that when I exit the
loop, my slaves (servo drives) are in OP state.
I have tried checking the working counter in the loop and exiting from it
after the domain's working counter becomes equal to our expected value.
However, there is still a small delay after that happens and the second
slave reaching operational state.
Best,
Mohsen
___
etherlab-users mailing list
etherlab-users@etherlab.org
http://lists.etherlab.org/mailman/listinfo/etherlab-users


Re: [etherlab-users] Error flag after requesting SAFEOP

2018-10-03 Thread Mohsen Alizadeh Noghani
Activating the master resolved this issue. ecrt_master_activate takes care
of state transitions from PREOP to OP.
Best,
Mohsen


On Fri, Sep 28, 2018 at 3:56 PM Mohsen Alizadeh Noghani <
m.aliza...@gmail.com> wrote:

> Having read EtherCAT and EtherLab documentation a bit more,
>
> 1- I should set the first bit of the sync manager's status register to 1.
> According to EtherCAT's Register Documentation, for sync manager 2 for
> instance, I have to set the first bit of byte at 0x081B to 1.
>
> 2-  I don't think using ecrt_slave_config_sync_manager will help me, since
> it only sets the direction of sync manager (as pointed out by comments in
> ecrt.h).
>
> Now, my question is, how can I modify a specific bit in a slave's address
> space?
>
> Best,
> Mohsen
>
>
> On Thu, Sep 27, 2018 at 3:19 AM Gavin Lambert 
> wrote:
>
>> EC_WD_ENABLE enables the SM watchdog; it’s a separate thing from enabling
>> the SM itself.  In general you should only activate it on one SM per slave
>> – usually the output SM if the slave has outputs or the input SM
>> otherwise.  If you don’t need the slave to drop from OP to SAFEOP when it
>> loses communication with the master then you can leave the watchdog
>> entirely disabled – though using the watchdog is usually recommended for
>> output slaves for safety reasons.
>>
>>
>>
>> Using erct_slave_config_sync_manager by itself is fairly pointless.  You
>> need to specify the PDOs contained in the SM and then also actually use at
>> least one PDO from each SM in your domain mapping.  Typically you use
>> ecrt_slave_config_pdos to do the former and ecrt_domain_reg_pdo_entry_list
>> for the latter.  See the example code.
>>
>>
>>
>> *From:* Mohsen Alizadeh Noghani
>> *Sent:* Wednesday, 26 September 2018 22:32
>> *To:* etherlab-users@etherlab.org
>> *Subject:* [etherlab-users] Error flag after requesting SAFEOP
>>
>>
>>
>> Hello everyone.
>>
>>
>>
>> When I request SAFEOP state for my slave (Mecapion L7N) using shell
>> command
>>
>>
>>
>> $ ethercat state --position 0 SAFEOP
>>
>>
>>
>> the slave's flag changes from + to E, and the state stays at PREOP.
>>
>>
>>
>> *Additional Info:*
>>
>> In a previous project, I used SOEM library and had to deal with the same
>> issue, which was fixed by manually enabling sync managers 2 & 3.
>>
>>
>>
>> ec_slave[1].SM[2].SMflags |= 0x0001;
>>
>> ec_slave[2].SM[3].SMflags |= 0x0001;
>>
>>
>>
>> I tried to do the same by the adding following lines in my a simple code
>>
>>
>>
>> ret1 = erct_slave_config_sync_manager(sc, 2, EC_DIR_INPUT, EC_WD_ENABLE)
>>
>> ret2 =  erct_slave_config_sync_manager(sc, 3, EC_DIR_OUTPUT,
>> EC_WD_ENABLE)
>>
>>
>>
>> Both function calls are successful (ret1=ret2=0) but the slave won't
>> reach SAFEOP.
>>
>>
>>
>>
>>
>
___
etherlab-users mailing list
etherlab-users@etherlab.org
http://lists.etherlab.org/mailman/listinfo/etherlab-users


Re: [etherlab-users] API for enabling/disabling sync managers of a slave

2018-10-01 Thread Mohsen Alizadeh Noghani
I still haven't been able to enable sync managers (and thus change the
state to SAFEOP)
Currently, I'm executing this code
<https://github.com/mohse-n/L7N_EtherLab/blob/master/simple_test.c>, which
is basically the user example.
Output of $ethercat xml of the slave is:



  
  
30101
  
  

  
L7N






  #x1601
  2nd Receive PDO Mapping
  
#x6040
0
16
Controlword
UINT16
  
  
#x607a
0
32
Target Position
UINT32
  


  #x1a01
  2nd Transmit PDO Mapping
  
#x6041
0
16
Statusword
UINT16
  
  
#x6064
0
32
Position Actual Value
UINT32
  

  

  



On Wed, Sep 26, 2018 at 3:02 AM Gavin Lambert 
wrote:

> You typically don’t need to explicitly disable a sync manager; you simply
> don’t refer to it or any PDOs it contains, and then it will not be included
> in the domain’s data.
>
>
>
> Alternatively, you can configure the sync manager but then list zero PDOs
> for it, to explicitly set the PDO Assign register for that SM to 0 (for
> slaves that support flexible assignment).  Note that you should not enable
> the SM watchdog if you’re setting it to have zero PDOs.
>
>
>
> It sounds like you should probably read the documentation for the EtherCAT
> protocol and for the Etherlab master in particular.
>
>
>
> *From:* Mohsen Alizadeh Noghani 
> *Sent:* Wednesday, 26 September 2018 04:52
> *To:* Gavin Lambert ; etherlab-users@etherlab.org
> *Subject:* Re: [etherlab-users] API for enabling/disabling sync managers
> of a slave
>
>
>
> Thanks Gavin.
>
>
>
> 1- Would
>
> ecrt_slave_config_sync_manager(sc, 2, EC_DIR_OUTPUT, EC_WD_ENABLE )
>
> enable Sync Manager 2 of slave sc?
>
> 2- How can I disable it then? I doesn't seems the function provides an
> option to enable/disable.
>
>
>
> Best,
>
> Mohsen
>
>
>
>
>
> On Tue, Sep 25, 2018 at 2:40 AM, Gavin Lambert 
> wrote:
>
> You need to write an application, and then use
> ecrt_slave_config_sync_manager or ecrt_slave_config_pdos to configure the
> Sync Managers for each slave.
>
>
>
> *From:* Mohsen Alizadeh Noghani
> *Sent:* Tuesday, 25 September 2018 02:29
> *To:* etherlab-users@etherlab.org
> *Subject:* [etherlab-users] API for enabling/disabling sync managers of a
> slave
>
>
>
> Hello everyone.
>
>
>
> Is there a function call that I can use for enabling a particular sync
> manager of a slave?
>
> For example, I'd like to enable sync manager 2 of slave 1.
>
>
> Best,
>
> Mohsen
>
>
>
___
etherlab-users mailing list
etherlab-users@etherlab.org
http://lists.etherlab.org/mailman/listinfo/etherlab-users


Re: [etherlab-users] Error flag after requesting SAFEOP

2018-09-28 Thread Mohsen Alizadeh Noghani
Having read EtherCAT and EtherLab documentation a bit more,

1- I should set the first bit of the sync manager's status register to 1.
According to EtherCAT's Register Documentation, for sync manager 2 for
instance, I have to set the first bit of byte at 0x081B to 1.

2-  I don't think using ecrt_slave_config_sync_manager will help me, since
it only sets the direction of sync manager (as pointed out by comments in
ecrt.h).

Now, my question is, how can I modify a specific bit in a slave's address
space?

Best,
Mohsen


On Thu, Sep 27, 2018 at 3:19 AM Gavin Lambert 
wrote:

> EC_WD_ENABLE enables the SM watchdog; it’s a separate thing from enabling
> the SM itself.  In general you should only activate it on one SM per slave
> – usually the output SM if the slave has outputs or the input SM
> otherwise.  If you don’t need the slave to drop from OP to SAFEOP when it
> loses communication with the master then you can leave the watchdog
> entirely disabled – though using the watchdog is usually recommended for
> output slaves for safety reasons.
>
>
>
> Using erct_slave_config_sync_manager by itself is fairly pointless.  You
> need to specify the PDOs contained in the SM and then also actually use at
> least one PDO from each SM in your domain mapping.  Typically you use
> ecrt_slave_config_pdos to do the former and ecrt_domain_reg_pdo_entry_list
> for the latter.  See the example code.
>
>
>
> *From:* Mohsen Alizadeh Noghani
> *Sent:* Wednesday, 26 September 2018 22:32
> *To:* etherlab-users@etherlab.org
> *Subject:* [etherlab-users] Error flag after requesting SAFEOP
>
>
>
> Hello everyone.
>
>
>
> When I request SAFEOP state for my slave (Mecapion L7N) using shell command
>
>
>
> $ ethercat state --position 0 SAFEOP
>
>
>
> the slave's flag changes from + to E, and the state stays at PREOP.
>
>
>
> *Additional Info:*
>
> In a previous project, I used SOEM library and had to deal with the same
> issue, which was fixed by manually enabling sync managers 2 & 3.
>
>
>
> ec_slave[1].SM[2].SMflags |= 0x0001;
>
> ec_slave[2].SM[3].SMflags |= 0x0001;
>
>
>
> I tried to do the same by the adding following lines in my a simple code
>
>
>
> ret1 = erct_slave_config_sync_manager(sc, 2, EC_DIR_INPUT, EC_WD_ENABLE)
>
> ret2 =  erct_slave_config_sync_manager(sc, 3, EC_DIR_OUTPUT, EC_WD_ENABLE)
>
>
>
> Both function calls are successful (ret1=ret2=0) but the slave won't reach
> SAFEOP.
>
>
>
>
>
___
etherlab-users mailing list
etherlab-users@etherlab.org
http://lists.etherlab.org/mailman/listinfo/etherlab-users


Re: [etherlab-users] Read from/write to the slave's object dictionary using SDOs

2018-09-26 Thread Mohsen Alizadeh Noghani
Thanks.

I tried the second option (used ecrt_master_sdo_download) and it worked.

Best,
Mohsen




On Wed, Sep 26, 2018 at 2:45 AM, Gavin Lambert 
wrote:

> There’s a number of different ways to do it, depending on why and how you
> want to do it.
>
>
>
> If this is a configuration setting (especially if it needs to be re-sent
> every time the slave reboots) that you can write (without needing to read
> anything), then you should use one of the ecrt_slave_config_sdo*()
> methods.  This will not do it immediately but will do it when you activate
> the master, and also if the slave reboots at any time while the master is
> active.
>
>
>
> If it’s a one-off request/query which you only do before activating the
> master, then you should use one of the ecrt_master_sdo_*() methods.  This
> will execute immediately and wait for the response.
>
>
>
> If you want to do it while the master is active, then you can either call
> ecrt_master_sdo_*() from a separate (non-realtime) thread (at the cost of a
> little extra latency on the realtime cycle), or you can use
> ecrt_slave_config_create_sdo_request() and related methods to perform
> polling on the realtime thread (for some extra code complexity).
>
>
>
> If it’s just something you need to do during commissioning and then never
> again (eg. if you can save the setting to the slave permanently), then you
> can use the “ethercat download” command.
>
>
>
> *From:* Mohsen Alizadeh Noghani
> *Sent:* Wednesday, 26 September 2018 03:41
> *To:* etherlab-users@etherlab.org
> *Subject:* [etherlab-users] Read from/write to the slave's object
> dictionary using SDOs
>
>
>
> Hello everyone.
>
>
>
> How can I read from or write to an entry of a slave's object dictionary
> using SDO? I'm going to do this before my real-time task.
>
> For example, I would like to set the value of 0x6040 to 15 before my
> cyclic task.
>
>
>
> Best,
>
> Mohsen
>
___
etherlab-users mailing list
etherlab-users@etherlab.org
http://lists.etherlab.org/mailman/listinfo/etherlab-users


Re: [etherlab-users] API for enabling/disabling sync managers of a slave

2018-09-25 Thread Mohsen Alizadeh Noghani
 Thanks Gavin.

1- Would
ecrt_slave_config_sync_manager(sc, 2, EC_DIR_OUTPUT, EC_WD_ENABLE )
enable Sync Manager 2 of slave sc?
2- How can I disable it then? I doesn't seems the function provides an
option to enable/disable.

Best,
Mohsen


On Tue, Sep 25, 2018 at 2:40 AM, Gavin Lambert 
wrote:

> You need to write an application, and then use
> ecrt_slave_config_sync_manager or ecrt_slave_config_pdos to configure the
> Sync Managers for each slave.
>
>
>
> *From:* Mohsen Alizadeh Noghani
> *Sent:* Tuesday, 25 September 2018 02:29
> *To:* etherlab-users@etherlab.org
> *Subject:* [etherlab-users] API for enabling/disabling sync managers of a
> slave
>
>
>
> Hello everyone.
>
>
>
> Is there a function call that I can use for enabling a particular sync
> manager of a slave?
>
> For example, I'd like to enable sync manager 2 of slave 1.
>
>
> Best,
>
> Mohsen
>
___
etherlab-users mailing list
etherlab-users@etherlab.org
http://lists.etherlab.org/mailman/listinfo/etherlab-users


[etherlab-users] Read from/write to the slave's object dictionary using SDOs

2018-09-25 Thread Mohsen Alizadeh Noghani
Hello everyone.

How can I read from or write to an entry of a slave's object dictionary
using SDO? I'm going to do this before my real-time task.
For example, I would like to set the value of 0x6040 to 15 before my cyclic
task.

Best,
Mohsen
___
etherlab-users mailing list
etherlab-users@etherlab.org
http://lists.etherlab.org/mailman/listinfo/etherlab-users


[etherlab-users] API for enabling/disabling sync managers of a slave

2018-09-24 Thread Mohsen Alizadeh Noghani
Hello everyone.

Is there a function call that I can use for enabling a particular sync
manager of a slave?
For example, I'd like to enable sync manager 2 of slave 1.

Best,
Mohsen
___
etherlab-users mailing list
etherlab-users@etherlab.org
http://lists.etherlab.org/mailman/listinfo/etherlab-users


[etherlab-users] Which version of kernel and RTAI should I use?

2018-09-23 Thread Mohsen Alizadeh Noghani
Hello everyone,

I have recently decided to try EtherLab and I intend to use it on RTAI,
with a Realtek (either 8139 or 8169) network card. I'm using an ordinary
Intel CPU.

I'm not sure about the best combination of EtherLab, kernel and RTAI. My
only constraint is for the installation process to be as hassle free as
possible. I would appreciate sharing your experience with me.

Thanks in advance.
___
etherlab-users mailing list
etherlab-users@etherlab.org
http://lists.etherlab.org/mailman/listinfo/etherlab-users