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