Skip to content

Unable to write STRUCT value #7

@uthaman

Description

@uthaman

Hi,

I am not able to write Message type data to PLC, When i read the value and check the Type , it says "STRUCT" and when I use the same to write it says "(CIP type does not match object type)"

final byte[] data = new byte[] { (byte)0xCE, (byte)0x0F, 7, 0, 0, 0, 'w', 'j', 'h', ' ', '1', '2', '4' };
CIPData value1 = new CIPData(Type.STRUCT, data);
plc.writeTag("S1_ScreenId", value1);

Below is the finest logs.

Jun 21, 2016 4:32:07 PM etherip.protocol.Connection write
FINER: Protocol Encoding
Encapsulation Header
UINT command : SendRRData (0x006F)
UINT length : 64
UDINT session : 0x1002D600
UDINT status : 0x00000000
USINT context[8] : 'Funstuff'
UDINT options : 0x00000000
Send RR Data
UDINT interface handle : 0
UINT timeout : 0
UINT count (addr., data): 2
UINT address type : 0x0 (UCMM)
UINT address length : 0x00
UINT data type : 0xB2 (Unconnected Message)
UINT data length : 48
MR Request
USINT service : CM_Unconnected_Send (0x52)
USINT path : Path (2 el) Class(0x20) 0x6 (ConnectionManager), instance(0x24) 1
CM_Unconnected_Send
USINT tick_time : 10
USINT ticks : -16
UINT message size : 33
/// embedded message /// (33 bytes)
MR Request
USINT service : CIP_WriteData (0x4D)
USINT path : Path Symbol(0x91) 'S1_ScreenId', 0x00
USINT type, data : 'wjh 124'
///\ embedded message ///
USINT pad : 0 (odd length message)
USINT path size : 1 words
USINT reserved : 0
USINT port 1, slot 0

Jun 21, 2016 4:32:07 PM etherip.protocol.Connection write
FINEST: Data sent (88 bytes):
0000 - 6F 00 40 00 00 D6 02 10 00 00 00 00 46 75 6E 73 - o.@.........Funs
0010 - 74 75 66 66 00 00 00 00 00 00 00 00 00 00 02 00 - tuff............
0020 - 00 00 00 00 B2 00 30 00 52 02 20 06 24 01 0A F0 - ......0.R. .$...
0030 - 21 00 4D 07 91 0B 53 31 5F 53 63 72 65 65 6E 49 - !.M...S1_ScreenI
0040 - 64 00 A0 02 01 00 CE 0F 07 00 00 00 77 6A 68 20 - d...........wjh
0050 - 31 32 34 00 01 00 01 00 - 124.....

Jun 21, 2016 4:32:07 PM etherip.protocol.Connection read
FINEST: Data read (46 bytes):
0000 - 6F 00 16 00 00 D6 02 10 00 00 00 00 46 75 6E 73 - o...........Funs
0010 - 74 75 66 66 00 00 00 00 00 00 00 00 00 00 02 00 - tuff............
0020 - 00 00 00 00 B2 00 06 00 CD 00 FF 01 07 21 - .............!

Jun 21, 2016 4:32:07 PM etherip.protocol.Connection read
FINER: Protocol Decoding
Encapsulation Header
UINT command : SendRRData (0x006F)
UINT length : 22
UDINT session : 0x1002D600
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 : 6
MR Response
USINT service : CIP_WriteData_Reply (0xCD)
USINT reserved : 0x0
USINT status : 0xffffffff ()
USINT ext. stat. size : 0x1
USINT ext status : 0x2107 (CIP type does not match object type)

Jun 21, 2016 4:32:07 PM etherip.protocol.Connection write
FINER: Protocol Encoding
Encapsulation Header
UINT command : UnRegisterSession (0x0066)
UINT length : 0
UDINT session : 0x1002D600
UDINT status : 0x00000000
USINT context[8] : 'Funstuff'
UDINT options : 0x00000000

Jun 21, 2016 4:32:07 PM etherip.protocol.Connection write
FINEST: Data sent (24 bytes):
0000 - 66 00 00 00 00 D6 02 10 00 00 00 00 46 75 6E 73 - f...........Funs
0010 - 74 75 66 66 00 00 00 00 - tuff....

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions