Response to Get_Enum_String (EtherNet/IP)

The service Get_enum_string, in the parameter object (0x0F) returns a string for all values between min value and max value. According to the CT19 test protocol, it is supposed to return “0x94 0x20 0xFF”, Invalid_Parameter_Value when a string is requested above the max value. If I am understanding things correctly, this would be CIP Status Code 0x20 The problem is that there does not appear to be a way to have the host driver request the Anybus module to send back “0x20” as the status code (according to the table of 10.2 in the CC40 EtherNet/IP Network Guide) for this scenario. This is resulting in error in the conformance test: “Incorrect error code, Srv Code x4B”.

Any ideas on how I can solve this issue?

Hi @Penn_Linder,

I have not seen this issue with CT19 yet. What test is running? Could you share a log for the conformance test showing this error? It might help me better understand what is going on.

CT19_DS4000.log (3.2 MB)

CT19_DS4000.log (4.9 MB)
Sorry, this is a more accurate log (I was trying out different things). This is returning a 0x1E, which is the normal behavior of the driver.

Hello Penn,

What do you have setup in your test configuration? I am trying to recreate the error, but I am not seeing the Get_Enum_String service verification test run.

In CT19, in STC Editor, DUT Information, under 15 - Parameter Object, under Services Implemented, I highlight the 0x4B - Get_Enum_String and check the “Yes” checkbox. Then I change to the “Conformance Test” tab and select to run 15 - Parameter Object.

Hello Penn,
Ah I had made a mistake setting up the enum ADI.
I am now seeing it run but not seeing that error. Can you share your Enum ADI’s along with the strings used? The error you are getting back 0x1E would be pointing towards an error in the application. Perhaps the ADI is not setup correctly?

Also, what firmware are you using?

Here is the result of my test.

6.5) Get_Enum_String service verification
3973	 Sending
3974	  Encapsulation Header 70 00 1D 00 C4 2C 05 88 00 00 00 00 DD 67 00 00 00 00 00 00 00 00 00 00
3975	  Command Specific Data 00 00 00 00 00 00 02 00 A1 00 04 00 C6 77 10 C1 B1 00 09 00 AC 67
3976	  CIP Data  4B 02 20 0F 24 03 00
3977	 Received
3978	  Encapsulation Header 70 00 1D 00 C4 2C 05 88 00 00 00 00 DD 67 00 00 00 00 00 00 00 00 00 00
3979	  Command Specific Data 00 00 00 00 00 00 02 00 A1 00 04 00 00 00 00 00 B1 00 09 00 AC 67
3980	  CIP Data  CB 00 00 00 02 4E 6F
3981	 Sending
3982	  Encapsulation Header 70 00 1D 00 C4 2C 05 88 00 00 00 00 DE 67 00 00 00 00 00 00 00 00 00 00
3983	  Command Specific Data 00 00 00 00 00 00 02 00 A1 00 04 00 C6 77 10 C1 B1 00 09 00 AD 67
3984	  CIP Data  4B 02 20 0F 24 03 01
3985	 Received
3986	  Encapsulation Header 70 00 20 00 C4 2C 05 88 00 00 00 00 DE 67 00 00 00 00 00 00 00 00 00 00
3987	  Command Specific Data 00 00 00 00 00 00 02 00 A1 00 04 00 00 00 00 00 B1 00 0C 00 AD 67
3988	  CIP Data  CB 00 00 00 05 4D 61 79 62 65
3989	 Sending
3990	  Encapsulation Header 70 00 1D 00 C4 2C 05 88 00 00 00 00 DF 67 00 00 00 00 00 00 00 00 00 00
3991	  Command Specific Data 00 00 00 00 00 00 02 00 A1 00 04 00 C6 77 10 C1 B1 00 09 00 AE 67
3992	  CIP Data  4B 02 20 0F 24 03 02
3993	 Received
3994	  Encapsulation Header 70 00 1E 00 C4 2C 05 88 00 00 00 00 DF 67 00 00 00 00 00 00 00 00 00 00
3995	  Command Specific Data 00 00 00 00 00 00 02 00 A1 00 04 00 00 00 00 00 B1 00 0A 00 AE 67
3996	  CIP Data  CB 00 00 00 03 59 65 73
3997	 Sending
3998	  Encapsulation Header 70 00 1D 00 C4 2C 05 88 00 00 00 00 E0 67 00 00 00 00 00 00 00 00 00 00
3999	  Command Specific Data 00 00 00 00 00 00 02 00 A1 00 04 00 C6 77 10 C1 B1 00 09 00 AF 67
4000	  CIP Data  4B 02 20 0F 24 03 03
4001	 Received
4002	  Encapsulation Header 70 00 1A 00 C4 2C 05 88 00 00 00 00 E0 67 00 00 00 00 00 00 00 00 00 00
4003	  Command Specific Data 00 00 00 00 00 00 02 00 A1 00 04 00 00 00 00 00 B1 00 06 00 AF 67
4004	  CIP Data  CB 00 20 00
4005	

My code is based on the host driver, 3.08.01, with EtherNet/IP firmware 1.52.02.

The code in question in the driver is:

if( bStringIndex < psAdiEntry->uData.sENUM.psValueProps->bNumOfEnumStrings )
{
iDataSize = (UINT16)strlen( psAdiEntry->uData.sENUM.psValueProps->pasEnumStrings[ bStringIndex ].acEnumStr );

     ABCC_SetMsgString( psMsgBuffer,

       psAdiEntry->uData.sENUM.psValueProps->pasEnumStrings[ bStringIndex ].acEnumStr,
                                 iDataSize, 0 );
           }
           else
           {
              /*
              ** The enum value was not found in the string lookup.
              */
              bErrCode = ABP_ERR_INV_CMD_EXT_1;
           }

If I’m understanding it correctly, it returns ABP_ERR_INV_CMD_EXT_1 when the requested string is above the maximum value. Your results showing is sending “CB 00 20 00” instead.

Hi @Penn_Linder,

We do have newer firmware that you would need for the latest CT19 test the added some new features such as LLDP that was not in older version. This doesn’t explain your issue

This section of code seems to be pointing towards an issue with the Enum string. Do you have the enum ADI’s setup correctly? I would expect something like this.

static AD_ENUMStrType asEnumStrings[3] = { { 0, “No” }, { 1, “Maybe” }, { 2, “Yes” } };
static AD_ENUMType sEnumProps = { { 0, 2, 0 }, 3, asEnumStrings };
static UINT8 bEnumProd = 0;

const AD_AdiEntryType APPL_asAdiEntryList[] =
{
{ 0x3, “multistate_prod”, ABP_ENUM, 1, APPL_READ_MAP_WRITE_ACCESS_DESC, { &bEnumProd, &sEnumProps } }
}

I’ve got some modified code that was originally based on the example application. My code works fine for all of the enumerated strings within range - it only causes a problem when responding to max value + 1. There is not string for that case and it needs to respond with the general status “20” rather than the error code “1E”.

I’m signed up to receive notifications for firmware updates so I’m concerned that I have not received a notification for that. I should try that because that might explain my issue. It is possible that the newer firmware translates ABP_ERR_INV_CMD_EXT_1 into “20” in this scenario.

Hi Penn,

Can you share the values you are using? Are you saying the Max value is outside the Enum ranges? It seems like you have invalid enum properties setup. The device is most likely not responding with a 0x20 since it is failing earlier in the process and that error is being provided.
image

The new firmware seems to have fixed the issue.

Great! Glad to hear the update resolved the issue.