1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 <2006> 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 | Index | 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 <2006> 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: Ethernet/IP Device Support and CompactLogix |
From: | John Dobbins <[email protected]> |
To: | Kay-Uwe Kasemir <[email protected]> |
Cc: | EPICS Tech-Talk <[email protected]> |
Date: | Thu, 06 Apr 2006 13:19:49 -0400 |
Data Received (92 bytes): 00000000 6F 00 44 00 4C 71 02 0A 00 00 00 00 46 75 6E 73 - o.D.Lq......Funs 00000010 74 75 66 66 00 00 00 00 00 00 00 00 00 00 02 00 - tuff............ 00000020 00 00 00 00 B2 00 34 00 8E 00 00 00 17 31 37 36 - ......4......176 00000030 39 2D 4C 33 35 45 20 45 74 68 65 72 6E 65 74 20 - 9-L35E Ethernet 00000040 50 6F 72 74 00 00 00 00 00 00 00 00 01 00 EB CD - Port............ 00000050 1E 00 00 00 0E 02 0E 01 0E 00 0E 00 - ............ EncapsulationHeader: UINT command = 0x6F (SendRRData) UINT length = 68 UDINT session = 0x0A02714C UDINT status = 0x00000000 (OK) USINT context[8]= 'Funstuff' UDINT options = 0x00000000 Received RR Data UDINT interface handle 0 UINT timeout 0 UINT count (addr+data) 2 UINT address_type 0x0 (UCMM) UINT address_length 0 UINT data_type 0xB2 (Unconnected Message) UINT data_length 52 MR_Response: USINT service = 0x8E (Response to Get_Attribute_Single) USINT reserved = 0x00 USINT status = 0x00 (Ok) USINT ext. stat. size = 0 Data (net format) = 00000000 17 31 37 36 39 2D 4C 33 35 45 20 45 74 68 65 72 - .1769-L35E Ether 00000010 6E 65 74 20 50 6F 72 74 00 00 00 00 00 00 00 00 - net Port........ 00000020 01 00 EB CD 1E 00 00 00 0E 02 0E 01 0E 00 0E 00 - ................
On Apr 6, 2006, at 12:17 , Carl Cork wrote:According to CIP Protocol Ed. 2.2 (Dec 2005), C-5.2.6 String Encodings:
a SHORT_STRING consists of a 1-Byte character count followed by count characters (1 byte per character). Therefore, the Product Name attribute field should have a maximum length of 33 bytes.
John Dobbins wrote:Kay,
Actually, it looks like there may be another interpretation. The product name is defined as (DeviceNet?) type SHORT_STRING. I don't know where this is defined but it looks like it may be: "a single byte length field and 'n' data bytes".
In which case the Product Name is being returned inside a longer field. The Product Name is less than 32 characters but the data field it is returned in is longer than 32 bytes.
EIP_check_interface() rejects the product name because is finds the length of the data returned >32, even though the string length is less than 32.
You're right in that the length check used the data package size, and the package contains BYTE length BYTE name[length]
So the actual name length is one less than the package byte count. Then it's copied into a C char name[] with an added final '\0', which adds another byte. Strictly speaking, I need to check the length byte, instead of silently expecting it to contain (package length-1). OK, I'll do that.
Now where are we with CompactLogix? What product name does it return? How long is it? BTYE 51 + 51 characters? Or does it return BYTE length=32 char name[32] ... plus more junk to get a package of 52 bytes
-Kay