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

Reply via email to