Ethernet/IP ODVA conformance test > Non-Printing Character found in String <

Hello!

I use ODVA conformance test tool for our Ethernet/IP anybus CompactCOM B40 which argues in parmeter object 0x0F that some ADI Parameters contain non-printing characters in string. Unfortunately this test cannot be ignored was the Response from ODVA. I should take care to use only printable characters.

The ADI line Looks like this:
{ 15, “FwUpdate Status”, ABP_CHAR, 128, ABP_APPD_DESCR_GET_ACCESS, { { &tempBuffer, (AD_CHARType*) &Props.FwUpdateStatus } }, ftGetADIValue, NULL },

I want to printf a string which has got a buffer size of 128 characters but only part of it is used during runtime until printf sets the \0 or 0x00 as the end of the string. Conformance test tool gets this:

CIP Data 8E 00 00 00 80 4E 6F 20 66 69 72 6D 77 61 72 65 20 75 70 64 61 74 65 20 72 75 6E 6E 69 6E 67
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 30 30 30 30 30 30 30 30 30 20
30 30 30 30 30 30 30 30 30 20 30 30 30 30 30 30 30 30 30 20 30 30 30 30 30 30 30 30 30 20 30 30
30 30 30 30 30 30

It doesn’t accept the 0x00 after first ASCII signs. But since the length of the buffer is fixed by ADI table I cannot modify the length during runtime.
And I don’t want to fill the whole buffer by spaces because the user then will always get ugly strings with a lot of spaces in the end. Furthermore I would Need to modify a lot (> 100) string printf- memcpy or strcpy - calls.

Do you have good idea what I can do?
Did you also use ODVA conformance test tool and had to handle strings?

Best regards,
Daniel

Hello Daniel,

Are you able to do a find of the \0 or 0x00 and do a printf of the length calculated?

Deryck

Hi Deryck,

in which way should I be able?
Of course in C programming I can do almost everything. I can call strlen() and get the string length which is defined as number of ASCII Bytes until first occurance of \0.
At any part in my source Code I can call printf()…

I don’t understand your question.

I am not able to modify ODVA conformance test tool. If it doesn’t accept \0 why should I check internally the string length and printf it? I don’t get the relation.

Regards,
Daniel

Hi Daniel,
I answered a bit hastily initially. I would recommend taking a look at section 10.4.3 of the design guide.

What it look like you will want to do is adapt ad_obj.c handling of ABP_APPD_IA_VALUE (other cases may need to be adapted depending on application, but this should be sufficient for this particular case) to check if the ADI has the datatype ABP_CHAR. If so, instead of setting “iDataSize = SizeInOctets( 0, iMsgBitOffset );”, you would want to perform something along the lines of “iDataSize = strnlen((char*)psAdiEntry->uData.sCHAR.pbValuePtr, psAdiEntry->bNumOfElements);”

Deryck

Hi Deryck,

that was a great idea! I implemented it successfully.
Additionally ODVA conformance test tool wants to write strings (e.g. 3 stars “***”) which isn’t set in ADI specified length (iItemSize).
Now I allow
if( iLeTOi( psMsgBuffer->sHeader.iDataSize < iItemSize )
for type ABP_CHAR and write a 0x00 at the end of the string.

Parameter object 0x0F runs successfully!

Currently I’m getting an error because at “Ethernet Link Object 0xF6)”, Instance 3 (internal port) all bytes of “Interface capability” are “0” (see. EIP Network guide, page 108):

1269 Sending
1270 Encapsulation Header 70 0 1E 0 CC DE 4 88 0 0 0 0 4 77 1 0 0 0 0 0 0 0 0 0
1271 Command Specific Data 0 0 0 0 0 0 2 0 A1 0 4 0 5D 81 14 71 B1 0 A 0 72 7
1272 CIP Data 0E 03 20 F6 24 03 30 0B
1273 Received
1274 Encapsulation Header 70 0 1F 0 CC DE 4 88 0 0 0 0 4 77 1 0 0 0 0 0 0 0 0 0
1275 Command Specific Data 0 0 0 0 0 0 2 0 A1 0 4 0 16 0 0 0 B1 0 B 0 72 7
1276 CIP Data 8E 00 00 00 00 00 00 00 00
1277 1> *** The Capability Bits field is 0, please verify if it’s acceptable for this DUT.
1278 ***** Found 1 Errors *****
1279 End: (null) Object Test
1280 ***** Found 1 Errors in (null) Object *****

Is it possible to disable instance 3? I read if port 2 is disabled, there will be only one instance (port 1) but we need both ports.

Regards,
Daniel

Hello Daniel,

This is normal acceptable behavior for this device. The log suggest this in the statement “The Capability Bits field is 0, please verify if it’s acceptable for this DUT.”. The interface capability bits for the internal port are indicating: internal port applies changes automatically without reset, the internal port does not support auto-negotiation, MDIX operation, or setting speed/duplex settings. This all makes sense since it is an internal port and these should not be needed.

Deryck

Hello Deryck,

yes, I’ll accept this “error”, but since I normally wanted to stop on error because mostly the next errors are the same or in relation with the first one I can’t do this anymore:

1

It seems there’s no other way than not stopping on error. When I run it in Conformance Mode it’ll always take a lot of time until the end of the test when only trying to eliminate a particular error.

Regards,
Daniel

Here is the response I received from a developer I asked about this.

Basically, this is just an unfortunate limitation of the current version of the test tool. The tool does not distinguish between informational/warning events from actual “error”/”failure” events. The ABCC’s internal port cannot be disabled. The two main options for dealing with this behavior are:

  • Deselect “Stop On Error”
  • Skip the “Ethernet Link” test in the “Development test”

Deryck

Hello Deryck,
your proposal to limit variable iDataSize in ad_obj.c for object 0Fh works fine. Since I cannot read a specific ADI value by its index with object 0Fh but only a “ADI table index” (1 till x) I prefer reading object A2h in the same way. Unfortunately there iDataSize doesn’t work. Object A2h seems to use all the time the fixed size as pre-defined in ADI table. Is there a way to
a) limit string size (attr. 5) in object A2h?
b) read specific ADI index number in object 0Fh? (or how to find out table index by ADI number?)

Looking forward hearing from you!
Best regards,
Daniel