OpenEtherCATsociety / SOEM

Simple Open Source EtherCAT Master
Other
1.32k stars 673 forks source link

NI 9144 - Error 0x0017 : Invalid sync manager configuration #676

Open cnicho35 opened 1 year ago

cnicho35 commented 1 year ago

Hello,

I am trying to read IO from NI modules that are connected to a National Instruments 9144 chassis. I am trying to run the simple_test.c on Linux with the PO2SO function below.

Background: the NI 9144 has a 9239 (4x analog inputs) and a 9401 (8x DIO) mounted in it. Using NI's xml creator tool, I made the xml file that is attached below. I want to have a PDO for the 4 analog inputs (from slave to master) and the 8 digital outputs (from master to slave).

The simple test output is:

SOEM (Simple Open EtherCAT Master)
Simple test
Starting simple test
ec_init on enp3s0 succeeded.
1 slaves found and configured.
found a 9144 
ni_9144 slave 1 set, retval = 5
Slaves mapped, state to SAFE_OP.
segments : 1 : 14 0 0 0
Request operational state for all slaves
Calculated workcounter 3
Not all slaves reached operational state.
Slave 1 State=0x12 StatusCode=0x0017 : Invalid sync manager configuration
Request init state for all slaves
End simple test, close socket
End program

PO2SO Function: ec_slave[1].PO2SOconfig = ni_slave;

int ni_slave(uint16 slave)
{
   int retval;

   retval = 0;
   uint8 u8val;
   uint16 u16val;

   u8val = 0x01;
   retval += ec_SDOwrite(slave, 0x1c12, 0x00, FALSE, sizeof(u8val), &u8val, EC_TIMEOUTRXM);
   u16val = 0x1601;
   retval += ec_SDOwrite(slave, 0x1c12, 0x01, FALSE, sizeof(u16val), &u16val, EC_TIMEOUTRXM);

   u8val = 0x02;
   retval += ec_SDOwrite(slave, 0x1c13, 0x00, FALSE, sizeof(u8val), &u8val, EC_TIMEOUTRXM);
   u16val = 0x1a00;
   retval += ec_SDOwrite(slave, 0x1c13, 0x01, FALSE, sizeof(u16val), &u16val, EC_TIMEOUTRXM);
   u16val = 0x1a01;

   retval += ec_SDOwrite(slave, 0x1c13, 0x02, FALSE, sizeof(u16val), &u16val, EC_TIMEOUTRXM);

   printf("ECATERROR: %s \n", ec_elist2string());

   printf("ni_9144 slave %d set, retval = %d\n", slave, retval);
   return 1;
}

The slave info is as follows:

Slave:1
 Name:? M:000001f9 I:000023b8
 Output size: 8bits
 Input size: 104bits
 State: 18
 Delay: 0[ns]
 Has DC: 1
 DCParentport:0
 Activeports:1.0.0.0
 Configured address: 1001
 Man: 000001f9 ID: 000023b8 Rev: 00000001
 SM0 A:1c00 L:1024 F:00010026 Type:1
 SM1 A:1800 L:1024 F:00010022 Type:2
 FMMU0 Ls:00000000 Ll:   1 Lsb:0 Leb:7 Ps:0000 Psb:0 Ty:02 Act:01
 FMMU1 Ls:00000001 Ll:  13 Lsb:0 Leb:7 Ps:0000 Psb:0 Ty:01 Act:01
 FMMUfunc 0:0 1:0 2:0 3:0
 MBX length wr: 1024 rd: 1024 MBX protocols : 0d
 CoE details: 00 FoE details: 00 EoE details: 00 SoE details: 00
 Ebus current: 0[mA]
 only LRD/LWR:0
 CoE Object Description found, 65 entries.
0x1000      "Device Type"                                 [VAR]
    0x00      "Device Type"                                 [UNSIGNED32       R_R_R_]      0x00001389 / 5001
0x1001      "Error Register"                              [VAR]
    0x00      "Error Register"                              [UNSIGNED8        R_R_R_]      0x80 / 128
0x1002      "Last Error Code"                             [VAR]
    0x00      "Last Error Code"                             [UNSIGNED32       R_R_R_]      0x80054717 / 2147829527
0x1008      "Mfg Device Name"                             [VAR]
    0x00      "Mfg Device Name"                             [VISIBLE_STR(64)  R_R_R_]      "NI 9144"
0x1009      "Mfg Hardware Version"                        [VAR]
    0x00      "Mfg Hardware Version"                        [VISIBLE_STR(88)  R_R_R_]      "0x10090709"
0x100a      "Mfg Software Version"                        [VAR]
    0x00      "Mfg Software Version"                        [VISIBLE_STR(64)  R_R_R_]      "2.2.0f04"
0x1018      "Identity"                                    [RECORD  maxsub(0x04 / 4)]
    0x00      "Identity"                                    [UNSIGNED8        R_R_R_]      0x04 / 4
    0x01      "Vendor ID"                                   [UNSIGNED32       R_R_R_]      0x000001f9 / 505
    0x02      "Product Code"                                [UNSIGNED32       R_R_R_]      0x000023b8 / 9144
    0x03      "Revision Number"                             [UNSIGNED32       R_R_R_]      0x00000001 / 1
    0x04      "Serial Number"                               [UNSIGNED32       R_R_R_]      0x0164f9e7 / 23394791
0x1600      "RxPDO Mapping 1"                             [ARRAY  maxsub(0x80 / 128)]
    0x00      "RxPDO Mapping 1"                             [UNSIGNED8        RWR_R_]      0x00 / 0
0x1601      "RxPDO Mapping 2"                             [ARRAY  maxsub(0x20 / 32)]
    0x00      "RxPDO Mapping 2"                             [UNSIGNED8        RWR_R_]      0x01 / 1
    0x01      "Subindex 001"                                [UNSIGNED32       RWR_R_]      0x70100108 / 1880097032
0x1602      "RxPDO Mapping 3"                             [ARRAY  maxsub(0x20 / 32)]
    0x00      "RxPDO Mapping 3"                             [UNSIGNED8        RWR_R_]      0x00 / 0
0x1603      "RxPDO Mapping 4"                             [ARRAY  maxsub(0x20 / 32)]
    0x00      "RxPDO Mapping 4"                             [UNSIGNED8        RWR_R_]      0x00 / 0
0x1604      "RxPDO Mapping 5"                             [ARRAY  maxsub(0x20 / 32)]
    0x00      "RxPDO Mapping 5"                             [UNSIGNED8        RWR_R_]      0x00 / 0
0x1605      "RxPDO Mapping 6"                             [ARRAY  maxsub(0x20 / 32)]
    0x00      "RxPDO Mapping 6"                             [UNSIGNED8        RWR_R_]      0x00 / 0
0x1606      "RxPDO Mapping 7"                             [ARRAY  maxsub(0x20 / 32)]
    0x00      "RxPDO Mapping 7"                             [UNSIGNED8        RWR_R_]      0x00 / 0
0x1607      "RxPDO Mapping 8"                             [ARRAY  maxsub(0x20 / 32)]
    0x00      "RxPDO Mapping 8"                             [UNSIGNED8        RWR_R_]      0x00 / 0
0x1a00      "TxPDO Mapping 1"                             [ARRAY  maxsub(0x80 / 128)]
    0x00      "TxPDO Mapping 1"                             [UNSIGNED8        RWR_R_]      0x04 / 4
    0x01      "Subindex 001"                                [UNSIGNED32       RWR_R_]      0x60000118 / 1610613016
    0x02      "Subindex 002"                                [UNSIGNED32       RWR_R_]      0x60000218 / 1610613272
    0x03      "Subindex 003"                                [UNSIGNED32       RWR_R_]      0x60000318 / 1610613528
    0x04      "Subindex 004"                                [UNSIGNED32       RWR_R_]      0x60000418 / 1610613784
0x1a01      "TxPDO Mapping 2"                             [ARRAY  maxsub(0x20 / 32)]
    0x00      "TxPDO Mapping 2"                             [UNSIGNED8        RWR_R_]      0x01 / 1
    0x01      "Subindex 001"                                [UNSIGNED32       RWR_R_]      0x60100108 / 1611661576
0x1a02      "TxPDO Mapping 3"                             [ARRAY  maxsub(0x20 / 32)]
    0x00      "TxPDO Mapping 3"                             [UNSIGNED8        RWR_R_]      0x00 / 0
0x1a03      "TxPDO Mapping 4"                             [ARRAY  maxsub(0x20 / 32)]
    0x00      "TxPDO Mapping 4"                             [UNSIGNED8        RWR_R_]      0x00 / 0
0x1a04      "TxPDO Mapping 5"                             [ARRAY  maxsub(0x20 / 32)]
    0x00      "TxPDO Mapping 5"                             [UNSIGNED8        RWR_R_]      0x00 / 0
0x1a05      "TxPDO Mapping 6"                             [ARRAY  maxsub(0x20 / 32)]
    0x00      "TxPDO Mapping 6"                             [UNSIGNED8        RWR_R_]      0x00 / 0
0x1a06      "TxPDO Mapping 7"                             [ARRAY  maxsub(0x20 / 32)]
    0x00      "TxPDO Mapping 7"                             [UNSIGNED8        RWR_R_]      0x00 / 0
0x1a07      "TxPDO Mapping 8"                             [ARRAY  maxsub(0x20 / 32)]
    0x00      "TxPDO Mapping 8"                             [UNSIGNED8        RWR_R_]      0x00 / 0
0x1c00      "Sync Manager Communication Type"             [ARRAY  maxsub(0x04 / 4)]
    0x00      "Sync Manager Communication Type"             [UNSIGNED8        R_R_R_]      0x04 / 4
    0x01      "Subindex 001"                                [UNSIGNED8        R_R_R_]      0x00 / 0
    0x02      "Subindex 002"                                [UNSIGNED8        R_R_R_]      0x01 / 1
    0x03      "Subindex 003"                                [UNSIGNED8        R_R_R_]      0x02 / 2
    0x04      "Subindex 004"                                [UNSIGNED8        R_R_R_]      0x03 / 3
0x1c02      "Timing Diagnosis Counters"                   [ARRAY  maxsub(0x03 / 3)]
    0x00      "Timing Diagnosis Counters"                   [UNSIGNED8        R_R_R_]      0x03 / 3
    0x01      "Missed SM2"                                  [UNSIGNED16       R_R_R_]      0x0000 / 0
    0x02      "Short Shift"                                 [UNSIGNED16       R_R_R_]      0x0000 / 0
    0x03      "Exceeded Cycle"                              [UNSIGNED16       R_R_R_]      0x0000 / 0
0x1c12      "RxPDO Assign"                                [ARRAY  maxsub(0x08 / 8)]
    0x00      "RxPDO Assign"                                [UNSIGNED8        RWR_R_]      0x01 / 1
    0x01      "Subindex 001"                                [UNSIGNED16       RWR_R_]      0x1601 / 5633
0x1c13      "TxPDO Assign"                                [ARRAY  maxsub(0x08 / 8)]
    0x00      "TxPDO Assign"                                [UNSIGNED8        RWR_R_]      0x02 / 2
    0x01      "Subindex 001"                                [UNSIGNED16       RWR_R_]      0x1a00 / 6656
    0x02      "Subindex 002"                                [UNSIGNED16       RWR_R_]      0x1a01 / 6657
0x1c32      "RxPDO Timing"                                [RECORD  maxsub(0x0d / 13)]
    0x00      "RxPDO Timing"                                [UNSIGNED8        R_R_R_]      0x0d / 13
    0x01      "Sync Mode"                                   [UNSIGNED16       RWR_R_]      0x0000 / 0
    0x02      "Cycle Time"                                  [UNSIGNED32       R_R_R_]      0x00006387 / 25479
    0x03      "Shift Time"                                  [UNSIGNED32       RWR_R_]      0x00000000 / 0
    0x04      "Sync Supported"                              [UNSIGNED16       R_R_R_]      0x4015 / 16405
    0x05      "Minimum Cycle"                               [UNSIGNED32       R_R_R_]      0x00006387 / 25479
    0x06      "Convert Time"                                [UNSIGNED32       R_R_R_]      0x00000a94 / 2708
    0x07      "-"                                           [UNSIGNED32       R_R_R_]      0x00000000 / 0
    0x08      "Gen Time Trigger"                            [UNSIGNED16       RWR_R_]      0x0000 / 0
    0x09      "Delay Time"                                  [UNSIGNED32       R_R_R_]      0x00000000 / 0
    0x0a      "Sync0 Cycle"                                 [UNSIGNED32       R_R_R_]      0x00006387 / 25479
    0x0b      "Cycle Too Small"                             [UNSIGNED32       R_R_R_]      0x00000000 / 0
    0x0c      "-"                                           [UNSIGNED32       R_R_R_]      0x00000000 / 0
    0x0d      "Shift Too Small"                             [UNSIGNED32       R_R_R_]      0x00000000 / 0
0x1c33      "TxPDO Timing"                                [RECORD  maxsub(0x0d / 13)]
    0x00      "TxPDO Timing"                                [UNSIGNED8        R_R_R_]      0x0d / 13
    0x01      "Sync Mode"                                   [UNSIGNED16       RWR_R_]      0x0000 / 0
    0x02      "Cycle Time"                                  [UNSIGNED32       R_R_R_]      0x00006387 / 25479
    0x03      "Shift Time"                                  [UNSIGNED32       RWR_R_]      0x00000000 / 0
    0x04      "Sync Supported"                              [UNSIGNED16       R_R_R_]      0x4015 / 16405
    0x05      "Minimum Cycle"                               [UNSIGNED32       R_R_R_]      0x00006387 / 25479
    0x06      "Convert Time"                                [UNSIGNED32       R_R_R_]      0x00005ae7 / 23271
    0x07      "-"                                           [UNSIGNED32       R_R_R_]      0x00000000 / 0
    0x08      "Gen Time Trigger"                            [UNSIGNED16       RWR_R_]      0x0000 / 0
    0x09      "Delay Time"                                  [UNSIGNED32       R_R_R_]      0x00000a94 / 2708
    0x0a      "Sync0 Cycle"                                 [UNSIGNED32       R_R_R_]      0x00006387 / 25479
    0x0b      "Cycle Too Small"                             [UNSIGNED32       R_R_R_]      0x00000000 / 0
    0x0c      "-"                                           [UNSIGNED32       R_R_R_]      0x00000000 / 0
    0x0d      "Shift Too Small"                             [UNSIGNED32       R_R_R_]      0x00000000 / 0
0x3000      "Timing Details"                              [ARRAY  maxsub(0x04 / 4)]
    0x00      "Timing Details"                              [UNSIGNED8        R_R_R_]      0x04 / 4
    0x01      "DMAinTime"                                   [UNSIGNED32       R_R_R_]      0x00000cc7 / 3271
    0x02      "DMAoutTime"                                  [UNSIGNED32       R_R_R_]      0x00000687 / 1671
    0x03      "ScanDelayTime"                               [UNSIGNED32       R_R_R_]      0x00000000 / 0
    0x04      "ScanLengthTime"                              [UNSIGNED32       R_R_R_]      0x00000000 / 0
0x3001      "Timing Overrides"                            [ARRAY  maxsub(0x02 / 2)]
    0x00      "Timing Overrides"                            [UNSIGNED8        R_R_R_]      0x02 / 2
    0x01      "Freerun Scan"                                [UNSIGNED32       RWR_R_]      0x00000000 / 0
    0x02      "Disable NumScan"                             [UNSIGNED32       RWR_R_]      0x00000000 / 0
0x4000      "Phantom Modules"                             [ARRAY  maxsub(0x08 / 8)]
    0x00      "Phantom Modules"                             [UNSIGNED8        RWRWRW]      0x08 / 8
    0x01      "Subindex 001"                                [UNSIGNED32       RWRWRW]      0x00000000 / 0
    0x02      "Subindex 002"                                [UNSIGNED32       RWRWRW]      0x00000000 / 0
    0x03      "Subindex 003"                                [UNSIGNED32       RWRWRW]      0x00000000 / 0
    0x04      "Subindex 004"                                [UNSIGNED32       RWRWRW]      0x00000000 / 0
    0x05      "Subindex 005"                                [UNSIGNED32       RWRWRW]      0x00000000 / 0
    0x06      "Subindex 006"                                [UNSIGNED32       RWRWRW]      0x00000000 / 0
    0x07      "Subindex 007"                                [UNSIGNED32       RWRWRW]      0x00000000 / 0
    0x08      "Subindex 008"                                [UNSIGNED32       RWRWRW]      0x00000000 / 0
0x4002      "FPGA IOV Limit"                              [VAR]
    0x00      "FPGA IOV Limit"                              [UNSIGNED32       R_R_R_]      0x00000080 / 128
0x5fff      "CoE Port Override"                           [VAR]
    0x00      "CoE Port Override"                           [UNSIGNED32       RW____]      0x00000000 / 0
0x6000      "TxPDO Area 1"                                [ARRAY  maxsub(0x80 / 128)]
    0x00      "TxPDO Area 1"                                [UNSIGNED8        R_R_R_]      0x04 / 4
    0x01      "Subindex 001"                                [UNSIGNED32       R_R_R_]      0x00000000 / 0
    0x02      "Subindex 002"                                [UNSIGNED32       R_R_R_]      0x00000000 / 0
    0x03      "Subindex 003"                                [UNSIGNED32       R_R_R_]      0x00000000 / 0
    0x04      "Subindex 004"                                [UNSIGNED32       R_R_R_]      0x00000000 / 0
0x6010      "TxPDO Area 2"                                [ARRAY  maxsub(0x20 / 32)]
    0x00      "TxPDO Area 2"                                [UNSIGNED8        R_R_R_]      0x01 / 1
    0x01      "Subindex 001"                                [UNSIGNED32       R_R_R_]      0x00000000 / 0
0x6020      "TxPDO Area 3"                                [ARRAY  maxsub(0x20 / 32)]
    0x00      "TxPDO Area 3"                                [UNSIGNED8        R_R_R_]      0x00 / 0
0x6030      "TxPDO Area 4"                                [ARRAY  maxsub(0x20 / 32)]
    0x00      "TxPDO Area 4"                                [UNSIGNED8        R_R_R_]      0x00 / 0
0x6040      "TxPDO Area 5"                                [ARRAY  maxsub(0x20 / 32)]
    0x00      "TxPDO Area 5"                                [UNSIGNED8        R_R_R_]      0x00 / 0
0x6050      "TxPDO Area 6"                                [ARRAY  maxsub(0x20 / 32)]
    0x00      "TxPDO Area 6"                                [UNSIGNED8        R_R_R_]      0x00 / 0
0x6060      "TxPDO Area 7"                                [ARRAY  maxsub(0x20 / 32)]
    0x00      "TxPDO Area 7"                                [UNSIGNED8        R_R_R_]      0x00 / 0
0x6070      "TxPDO Area 8"                                [ARRAY  maxsub(0x20 / 32)]
    0x00      "TxPDO Area 8"                                [UNSIGNED8        R_R_R_]      0x00 / 0
0x7000      "RxPDO Area 1"                                [ARRAY  maxsub(0x80 / 128)]
    0x00      "RxPDO Area 1"                                [UNSIGNED8        R_R_R_]      0x00 / 0
0x7010      "RxPDO Area 2"                                [ARRAY  maxsub(0x20 / 32)]
    0x00      "RxPDO Area 2"                                [UNSIGNED8        R_R_R_]      0x01 / 1
    0x01      "Subindex 001"                                [UNSIGNED32       RWRWRW]      0x00000000 / 0
0x7020      "RxPDO Area 3"                                [ARRAY  maxsub(0x20 / 32)]
    0x00      "RxPDO Area 3"                                [UNSIGNED8        R_R_R_]      0x00 / 0
0x7030      "RxPDO Area 4"                                [ARRAY  maxsub(0x20 / 32)]
    0x00      "RxPDO Area 4"                                [UNSIGNED8        R_R_R_]      0x00 / 0
0x7040      "RxPDO Area 5"                                [ARRAY  maxsub(0x20 / 32)]
    0x00      "RxPDO Area 5"                                [UNSIGNED8        R_R_R_]      0x00 / 0
0x7050      "RxPDO Area 6"                                [ARRAY  maxsub(0x20 / 32)]
    0x00      "RxPDO Area 6"                                [UNSIGNED8        R_R_R_]      0x00 / 0
0x7060      "RxPDO Area 7"                                [ARRAY  maxsub(0x20 / 32)]
    0x00      "RxPDO Area 7"                                [UNSIGNED8        R_R_R_]      0x00 / 0
0x7070      "RxPDO Area 8"                                [ARRAY  maxsub(0x20 / 32)]
    0x00      "RxPDO Area 8"                                [UNSIGNED8        R_R_R_]      0x00 / 0
0x9000      "Module 1 Identification"                     [RECORD  maxsub(0x0c / 12)]
    0x00      "Module 1 Identification"                     [UNSIGNED8        R_R_R_]      0x0c / 12
    0x01      "Address"                                     [UNSIGNED16       R_R_R_]      0x0001 / 1
    0x02      "Module Type"                                 [VISIBLE_STR(16)  R_R_R_]      "-"
    0x03      "Module Name"                                 [VISIBLE_STR(16)  R_R_R_]      "-"
    0x04      "ProfileID"                                   [UNSIGNED32       R_R_R_]      0x00040191 / 262545
    0x05      "Vendor ID"                                   [UNSIGNED32       R_R_R_]      0x000001f9 / 505
    0x06      "Product Code"                                [UNSIGNED32       R_R_R_]      0x00002417 / 9239
    0x07      "Revision"                                    [UNSIGNED32       R_R_R_]      0x00000001 / 1
    0x08      "Serial No"                                   [UNSIGNED32       R_R_R_]      0x016c35c2 / 23868866
    0x09      "PDO Group"                                   [UNSIGNED16       R_R_R_]      0x0001 / 1
    0x0a      "Module ID"                                   [UNSIGNED32       R_R_R_]      0x00002417 / 9239
    0x0b      "Slot"                                        [UNSIGNED16       R_R_R_]      0x0001 / 1
    0x0c      "Slot Group"                                  [UNSIGNED16       R_R_R_]      0x0000 / 0
0x9010      "Module 2 Identification"                     [RECORD  maxsub(0x0c / 12)]
    0x00      "Module 2 Identification"                     [UNSIGNED8        R_R_R_]      0x0c / 12
    0x01      "Address"                                     [UNSIGNED16       R_R_R_]      0x0002 / 2
    0x02      "Module Type"                                 [VISIBLE_STR(16)  R_R_R_]      "-"
    0x03      "Module Name"                                 [VISIBLE_STR(16)  R_R_R_]      "-"
    0x04      "ProfileID"                                   [UNSIGNED32       R_R_R_]      0x00030191 / 197009
    0x05      "Vendor ID"                                   [UNSIGNED32       R_R_R_]      0x000001f9 / 505
    0x06      "Product Code"                                [UNSIGNED32       R_R_R_]      0x000024b9 / 9401
    0x07      "Revision"                                    [UNSIGNED32       R_R_R_]      0x00000001 / 1
    0x08      "Serial No"                                   [UNSIGNED32       R_R_R_]      0x01ec0f2f / 32247599
    0x09      "PDO Group"                                   [UNSIGNED16       R_R_R_]      0x0001 / 1
    0x0a      "Module ID"                                   [UNSIGNED32       R_R_R_]      0x000024b9 / 9401
    0x0b      "Slot"                                        [UNSIGNED16       R_R_R_]      0x0002 / 2
    0x0c      "Slot Group"                                  [UNSIGNED16       R_R_R_]      0x0000 / 0
0x9020      "Module 3 Identification"                     [RECORD  maxsub(0x0c / 12)]
    0x00      "Module 3 Identification"                     [UNSIGNED8        R_R_R_]      0x00 / 0
0x9030      "Module 4 Identification"                     [RECORD  maxsub(0x0c / 12)]
    0x00      "Module 4 Identification"                     [UNSIGNED8        R_R_R_]      0x00 / 0
0x9040      "Module 5 Identification"                     [RECORD  maxsub(0x0c / 12)]
    0x00      "Module 5 Identification"                     [UNSIGNED8        R_R_R_]      0x00 / 0
0x9050      "Module 6 Identification"                     [RECORD  maxsub(0x0c / 12)]
    0x00      "Module 6 Identification"                     [UNSIGNED8        R_R_R_]      0x00 / 0
0x9060      "Module 7 Identification"                     [RECORD  maxsub(0x0c / 12)]
    0x00      "Module 7 Identification"                     [UNSIGNED8        R_R_R_]      0x00 / 0
0x9070      "Module 8 Identification"                     [RECORD  maxsub(0x0c / 12)]
    0x00      "Module 8 Identification"                     [UNSIGNED8        R_R_R_]      0x00 / 0
0xf000      "General Device Settings"                     [RECORD  maxsub(0x04 / 4)]
    0x00      "General Device Settings"                     [UNSIGNED8        R_R_R_]      0x04 / 4
    0x01      "Index Distance"                              [UNSIGNED16       R_R_R_]      0x0010 / 16
    0x02      "Max Modules"                                 [UNSIGNED16       R_R_R_]      0x0008 / 8
    0x03      "General Config Enable"                       [UNSIGNED32       R_R_R_]      0x00000000 / 0
    0x04      "General Info Enable"                         [UNSIGNED32       R_R_R_]      0x000001f3 / 499
0xf001      "Scan Modules"                                [VAR]
    0x00      "Scan Modules"                                [UNSIGNED32       RWR_R_]      0x00000000 / 0
0xf010      "Device Profile List"                         [ARRAY  maxsub(0x08 / 8)]
    0x00      "Device Profile List"                         [UNSIGNED8        R_R_R_]      0x02 / 2
    0x01      "Subindex 001"                                [UNSIGNED32       R_R_R_]      0x00040191 / 262545
    0x02      "Subindex 002"                                [UNSIGNED32       R_R_R_]      0x00030191 / 197009
0xf040      "Device Address List"                         [ARRAY  maxsub(0x08 / 8)]
    0x00      "Device Address List"                         [UNSIGNED8        R_R_R_]      0x02 / 2
    0x01      "Subindex 001"                                [UNSIGNED16       R_R_R_]      0x0001 / 1
    0x02      "Subindex 002"                                [UNSIGNED16       R_R_R_]      0x0002 / 2
0xf050      "Module ID List"                              [ARRAY  maxsub(0x08 / 8)]
    0x00      "Module ID List"                              [UNSIGNED8        R_R_R_]      0x02 / 2
    0x01      "Subindex 001"                                [UNSIGNED32       R_R_R_]      0x00002417 / 9239
    0x02      "Subindex 002"                                [UNSIGNED32       R_R_R_]      0x000024b9 / 9401
0xf800      "FPGA Mode"                                   [VAR]
    0x00      "FPGA Mode"                                   [UNSIGNED32       RW____]      0x00000000 / 0
0xf801      "Module Scan Status"                          [VAR]
    0x00      "Module Scan Status"                          [UNSIGNED32       RW____]      0x00000000 / 0
End slaveinfo, close socket
End program

-map:

PDO mapping according to CoE :
Activated SM type workaround, possible incorrect mapping.
  SM2 outputs
     addr b   index: sub bitl data_type    name
  [0x0000.0] 0x7010:0x01 0x08 UNSIGNED32   Subindex 001
  SM3 inputs
     addr b   index: sub bitl data_type    name
  [0x0001.0] 0x6000:0x01 0x18 UNSIGNED32   Subindex 001
  [0x0004.0] 0x6000:0x02 0x18 UNSIGNED32   Subindex 002
  [0x0007.0] 0x6000:0x03 0x18 UNSIGNED32   Subindex 003
  [0x000A.0] 0x6000:0x04 0x18 UNSIGNED32   Subindex 004
  [0x000D.0] 0x6010:0x01 0x08 UNSIGNED32   Subindex 001
End slaveinfo, close socket
End program

Can someone please help me determine why I am getting this SyncManager error?

From Beckhoff: Error Code 0x0017 Meaning

Invalid Sync Manager configuration Description

Process data communication (cyclic communication) is done via extra memory areas on the ESC, separated for outputs and inputs. The process data length and the process data SyncManager length have to be the same. If this is not the case or the start address or direction does not match this error is returned.

Example: The process data configuration was changed of the slaves which also changed the length of the data. The change was not activated in the configuration so that the configuration tool would have recalculated the SyncManager settings. Current State (or state change)

P→S, S→O Resulting state

Current State + E Solution

Issue a re-calculation of the EtherCAT configuration

simple_test.txt

NI 9144 XML File: 9239_9401_Scan_xml.txt

ArthurKetels commented 1 year ago

There is something wrong with the information the slave returns to SOEM. Most critical are the SM memory addresses. According to your XML it should be: SM0 : 0x1f00 SM1 : 0x1c00 SM2 : 0x1000 SM3: 0x1600

The addresses SOEM gets from the slave are: SM0 : 0x1c00 SM1 : 0x1800 SM2 : 0x0000 SM3 : 0x0000

This will cause the slave to complain with error code 0x0017. Either ask for a slave firmware update to fix the bug or hack the SM settings yourself in the ni_slave() function. Although SM0 and SM1 are off, they do seem to work. So you could be lucky and get away with redefining SM2, SM3, FMMU0 and FMMU1.

You also made a small mistake. The procedure to remap a slave is to first set subindex 0 to value 0 then update the mapping entries, and last set subindex 0 to the correct value.