Re: [etherlab-users] Problems initializing Omron system

2017-03-28 Thread Gavin Lambert
On 28 March 2017 23:21, quoth Asier Tamayo:
> After some debug, we have finally got the system working properly. We had
> to define EC_SII_ASSIGN in the config.h file and recompile the EtherLab
> master.

The right way to define this is not to modify config.h directly, but to specify 
--enable-sii-assign when running configure.  (You can run configure --help to 
see the options.)

> Does anyone know if defining EC_SII_ASIGN has any side effect? We have
> found very little information about it.

All this does is to assign control of the SII EEPROM to the slave device at 
specific points during the configuration process.  This is required by some 
complex slaves that store additional settings in the SII EEPROM; it's disabled 
by default presumably just because it's a little slower and most common slaves 
don't need it.

(There are some bugs in its implementation and it doesn't quite follow the 
standard, but that's mostly around treatment of the BOOT state and most people 
won't notice or care about that as it's only used for firmware programming.)


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


Re: [etherlab-users] Problems initializing Omron system

2017-03-22 Thread Henry Bausley
 
1.   Get a copy of Omron’s Sysmac Studio setup software.
2.   Connect your PC to the NX Coupler via the USB cable.
3.   Create a New Sysmac Studio Project.
4.   Within your Sysmac Studio Project configure the “virtual” NX
Coupler with the slices (“boards”) in exactly the same order that you
physically have them on your “real” NX Coupler.
5.   Then download/upload the virtual NX Coupler’s configuration to
your real Coupler via the USB connection.  This places the configuration
on the NX Coupler’s EEPROM.  Then the Input and Output PDO’s for each of
the slices will show up in the Coupler’s Input and Output available PDO
mappings on the Etherlab Master ie. use the ethercat pdos.  A power
cycle may be required after the download.



On Wed, 2017-03-22 at 12:16 +, Asier Tamayo wrote:
> Dear all,
> 
>  
> 
> We have our Etherlab master running without any problem with Beckhoff
> boards (digital I/O, analog I/O…). Now, we wanted to make some tests
> with an Omron system, but we fail to get it running. We seem unable to
> make it go further than the INIT state. Has anyone got any experience
> in working with Etherlab and Omron systems? Do we have to make
> something different?
> 
>  
> 
> In Beckhoff, each board is an EtherCAT slave. However, in Omron all
> the boards connected to an EtherCAT coupler are a unique slave, but
> “ethercat slaves” only returns the configuration of the coupler
> itself. In TwinCAT, we can use an XML file to set the correct
> configuration for the system. Then, we can create a binary file in
> TwinCAT and write it with “ethercat sii_write” to the SII (EEPROM) of
> the coupler. After that, “ethercat slaves” returns the correct Omron
> system configuration.
> 
>  
> 
> For our demo, at this moment, we will use the coupler by itself:
> 
>  
> 
> # ./ethercat rescan
> 
>  
> 
> # ./ethercat slaves
> 
> 0  0:0  INIT  E  NX-ECC202 EtherCAT coupler V1.2
> 
>  
> 
> # ./ethercat cstruct
> 
> /* Master 0, Slave 0, "NX-ECC202"
> 
> * Vendor ID:   0x0083
> 
> * Product code:0x00a6
> 
> * Revision number: 0x00010002
> 
> */
> 
>  
> 
> ec_pdo_entry_info_t slave_0_pdo_entries[] = {
> 
> {0x2003, 0x04, 128}, /* NX Unit Registration Status 125 */
> 
> {0x2005, 0x04, 128}, /* NX Unit I/O Data Active Status 125 */
> 
> {0x2001, 0x01, 8}, /* Sysmac Error Status */
> 
> {0x, 0x00, 8},
> 
> };
> 
>  
> 
> ec_pdo_info_t slave_0_pdos[] = {
> 
> {0x1bf8, 2, slave_0_pdo_entries + 0}, /* 505th transmit PDO
> Mapping */
> 
> {0x1bff, 1, slave_0_pdo_entries + 2}, /* 512th transmit PDO
> Mapping */
> 
> {0x1bf4, 1, slave_0_pdo_entries + 3}, /* PaddingTxPdo */
> 
> };
> 
>  
> 
> ec_sync_info_t slave_0_syncs[] = {
> 
> {0, EC_DIR_OUTPUT, 0, NULL, EC_WD_DISABLE},
> 
> {1, EC_DIR_INPUT, 0, NULL, EC_WD_DISABLE},
> 
> {2, EC_DIR_OUTPUT, 0, NULL, EC_WD_ENABLE},
> 
> {3, EC_DIR_INPUT, 3, slave_0_pdos + 0, EC_WD_DISABLE},
> 
> {0xff}
> 
> };
> 
>  
> 
> # ./ethercat master
> 
> Master0
> 
>   Phase: Idle
> 
>   Active: no
> 
>   Slaves: 1
> 
>   Ethernet devices:
> 
> Main: 00:12:34:56:78:9a (attached)
> 
>   Link: UP
> 
>   Tx frames:   1027404
> 
>   Tx bytes:62023504
> 
>   Rx frames:   1012682
> 
>   Rx bytes:61140360
> 
>   Tx errors:   0
> 
>   Tx frame rate [1/s]:986   1277   2060
> 
>   Tx rate [KByte/s]: 57.8   74.8  120.8
> 
>   Rx frame rate [1/s]:986   1277   2056
> 
>   Rx rate [KByte/s]: 57.8   74.8  120.6
> 
> Common:
> 
>   Tx frames:   1027404
> 
>   Tx bytes:62023504
> 
>   Rx frames:   1012682
> 
>   Rx bytes:61140360
> 
>   Lost frames: 14722
> 
>   Tx frame rate [1/s]:986   1277   2060
> 
>   Tx rate [KByte/s]: 57.8   74.8  120.8
> 
>   Rx frame rate [1/s]:986   1277   2058
> 
>   Rx rate [KByte/s]: 57.8   74.8  120.7
> 
>   Loss rate [1/s]:  0 -0  4
> 
>   Frame loss [%]: 0.0   -0.00.2
> 
>   Distributed clocks:
> 
> Reference clock: Slave 0
> 
> Application time: 0
> 
>   2000-01-01 00:00:00.0
> 
>  
> 
> # ./ethercat slaves -v
> 
> === Master 0, Slave 0 ===
> 
> Device: Main
> 
> State: INIT
> 
> Flag: E
> 
> Identity:
> 
>   Vendor Id:   0x0083
> 
>   Product code:0x00a6
> 
>   Revision number: 0x00010002
> 
>   Serial number:   0x
> 
> DL information:
> 
>   FMMU bit operation: no
> 
>   Distributed clocks: yes, 64 bit
> 
>   DC system time transmission delay: 0 ns
> 
> Port  Type  Link  LoopSignal  NextSlave  RxTime [ns]  Diff [ns]
> NextDc [ns]
> 
>0  MII   upopenyes -   3370868674   0
> 0
> 
>1  MII   down  closed  no  --   -
> -
> 
>2  N/A   down  closed  no  --   -
> -
> 
>3  N/A   down  closed  no  --   -
> -
> 
> Mailboxes:
> 
>   

[etherlab-users] Problems initializing Omron system

2017-03-22 Thread Asier Tamayo
Dear all,

We have our Etherlab master running without any problem with Beckhoff boards 
(digital I/O, analog I/O…). Now, we wanted to make some tests with an Omron 
system, but we fail to get it running. We seem unable to make it go further 
than the INIT state. Has anyone got any experience in working with Etherlab and 
Omron systems? Do we have to make something different?

In Beckhoff, each board is an EtherCAT slave. However, in Omron all the boards 
connected to an EtherCAT coupler are a unique slave, but “ethercat slaves” only 
returns the configuration of the coupler itself. In TwinCAT, we can use an XML 
file to set the correct configuration for the system. Then, we can create a 
binary file in TwinCAT and write it with “ethercat sii_write” to the SII 
(EEPROM) of the coupler. After that, “ethercat slaves” returns the correct 
Omron system configuration.

For our demo, at this moment, we will use the coupler by itself:

# ./ethercat rescan

# ./ethercat slaves
0  0:0  INIT  E  NX-ECC202 EtherCAT coupler V1.2

# ./ethercat cstruct
/* Master 0, Slave 0, "NX-ECC202"
* Vendor ID:   0x0083
* Product code:0x00a6
* Revision number: 0x00010002
*/

ec_pdo_entry_info_t slave_0_pdo_entries[] = {
{0x2003, 0x04, 128}, /* NX Unit Registration Status 125 */
{0x2005, 0x04, 128}, /* NX Unit I/O Data Active Status 125 */
{0x2001, 0x01, 8}, /* Sysmac Error Status */
{0x, 0x00, 8},
};

ec_pdo_info_t slave_0_pdos[] = {
{0x1bf8, 2, slave_0_pdo_entries + 0}, /* 505th transmit PDO Mapping */
{0x1bff, 1, slave_0_pdo_entries + 2}, /* 512th transmit PDO Mapping */
{0x1bf4, 1, slave_0_pdo_entries + 3}, /* PaddingTxPdo */
};

ec_sync_info_t slave_0_syncs[] = {
{0, EC_DIR_OUTPUT, 0, NULL, EC_WD_DISABLE},
{1, EC_DIR_INPUT, 0, NULL, EC_WD_DISABLE},
{2, EC_DIR_OUTPUT, 0, NULL, EC_WD_ENABLE},
{3, EC_DIR_INPUT, 3, slave_0_pdos + 0, EC_WD_DISABLE},
{0xff}
};

# ./ethercat master
Master0
  Phase: Idle
  Active: no
  Slaves: 1
  Ethernet devices:
Main: 00:12:34:56:78:9a (attached)
  Link: UP
  Tx frames:   1027404
  Tx bytes:62023504
  Rx frames:   1012682
  Rx bytes:61140360
  Tx errors:   0
  Tx frame rate [1/s]:986   1277   2060
  Tx rate [KByte/s]: 57.8   74.8  120.8
  Rx frame rate [1/s]:986   1277   2056
  Rx rate [KByte/s]: 57.8   74.8  120.6
Common:
  Tx frames:   1027404
  Tx bytes:62023504
  Rx frames:   1012682
  Rx bytes:61140360
  Lost frames: 14722
  Tx frame rate [1/s]:986   1277   2060
  Tx rate [KByte/s]: 57.8   74.8  120.8
  Rx frame rate [1/s]:986   1277   2058
  Rx rate [KByte/s]: 57.8   74.8  120.7
  Loss rate [1/s]:  0 -0  4
  Frame loss [%]: 0.0   -0.00.2
  Distributed clocks:
Reference clock: Slave 0
Application time: 0
  2000-01-01 00:00:00.0

# ./ethercat slaves -v
=== Master 0, Slave 0 ===
Device: Main
State: INIT
Flag: E
Identity:
  Vendor Id:   0x0083
  Product code:0x00a6
  Revision number: 0x00010002
  Serial number:   0x
DL information:
  FMMU bit operation: no
  Distributed clocks: yes, 64 bit
  DC system time transmission delay: 0 ns
Port  Type  Link  LoopSignal  NextSlave  RxTime [ns]  Diff [ns]   NextDc 
[ns]
   0  MII   upopenyes -   3370868674   0   0
   1  MII   down  closed  no  --   -   -
   2  N/A   down  closed  no  --   -   -
   3  N/A   down  closed  no  --   -   -
Mailboxes:
  Bootstrap RX: 0x/0, TX: 0x/0
  Standard  RX: 0x2800/256, TX: 0x2a00/256
  Supported protocols: CoE
General:
  Group: CommCoupler
  Image name:
  Order number: NX-ECC202
  Device name: NX-ECC202 EtherCAT coupler V1.2
  CoE details:
Enable SDO: yes
Enable SDO Info: no
Enable PDO Assign: no
Enable PDO Configuration: no
Enable Upload at startup: no
Enable SDO complete access: yes
  Flags:
Enable SafeOp: no
Enable notLRW: no
  Current consumption: 0 mA

We can see the slave is in state INIT. With the debug set to 1:

# dmesg -c
EtherCAT DEBUG 0: Sending broadcast-write to measure transmission delays on 
main link.
EtherCAT DEBUG 0: 1 slaves responded to delay measuring on main link.
EtherCAT 0: Scanning bus.
EtherCAT DEBUG 0: Scanning slave 0 on main link.
EtherCAT DEBUG 0-0: Slave has the System Time register.
EtherCAT DEBUG 0-0: Unknown category type 0x002A.
EtherCAT DEBUG 0-0: Unknown category type 0x003C.
EtherCAT DEBUG 0-0: Slave is not in the state to do mailbox com (INIT), setting 
to PREOP.
EtherCAT DEBUG 0-0: Configuring...
EtherCAT DEBUG 0-0: Now in INIT.
EtherCAT DEBUG 0-0: Clearing FMMU configurations...
EtherCAT DEBUG 0-0: Clearing sync manager configurations...
EtherCAT DEBUG 0-0: Clearing DC assignment...
EtherCAT DEBUG