I'm having some trouble with a property of DataType UInt32 being transformed to Double unexpectedly. We are using the C++ SDK version 1.4.3.
The DataType of the property ExpectedNumberOfBirds is defined in my model as UInt32. In the generated code I also see that the type of this property is a UInt32; the getter and setter functions show this.
When browsing through the address space using UaExpert, the window on the right shows DataType UInt32 for the ExpectedNumberOfBirds node. However, when I drag this node to the Data Access View, the DataType is Double: Using another client (not UaExpert) I confirmed that the actual returned DataType is indeed Double, while it should be UInt32. Finally, I used Wireshark to examine the ReadResponse message from the server. This message actually contains the DataType Double.
Wireshark ReadRequest: Wireshark ReadResponse: The trace logging shows the ReadRequest and ReadResponse message produced by reading the ExpectedNumberOfBirds Node. The stack indicates the ReadReponse contains value 7 (=UInt32 builtin type) for attribute 14 (=DataType):
Code: Select all
11:36:40.934Z|4|F20CC700* [uastack] * OpcUa_TcpListener_EventCallback: Socket(0xe9bae0), Port(0), Data(0xe958d0), Event(OPCUA_SOCKET_READ_EVENT)
11:36:40.934Z|4|F20CC700* [uastack] OpcUa_TcpListener_ReadEventHandler: Connection 0xe97250.
11:36:40.934Z|4|F20CC700* [uastack] OpcUa_TcpStream_DataReady: Read 8 bytes.
11:36:40.934Z|4|F20CC700* [uastack] OpcUa_TcpStream_DataReady: Read 718 bytes.
11:36:40.934Z|4|F20CC700* [uastack] OpcUa_TcpStream_DataReady: total 726 bytes (718 last) of 718 (w/o header) received.
11:36:40.934Z|4|F20CC700* [uastack] OpcUa_TcpListener_ReadEventHandler: MessageType SecureChannel Message
11:36:40.934Z|4|F20CC700* [uastack] OpcUa_TcpListener_ProcessRequest: Handing TcpInputStream 0x7f09e00138d0 to upper layer!
11:36:40.934Z|4|F20CC700* [uastack] OpcUa_SecureListener_OnNotify: Request
11:36:40.934Z|4|F20CC700* [uastack] SecureStream - CheckInputHeaderType - Common Service
11:36:40.934Z|4|F20CC700* [uastack] OpcUa_SecureListener_ProcessSessionCallRequest: SecureChannelId 1569736928, SecurityTokenId 1
11:36:40.934Z|4|F20CC700* [uastack] GetSecurityKeyset: Keysets for token id 1 at channel 1569736928 requested.
11:36:40.934Z|4|F20CC700* [uastack] OpcUa_SecureListener_ProcessSessionCallRequest: All 1 chunks received; start processing!
11:36:40.934Z|4|F20CC700* [uastack] OpcUa_SecureStream_AppendInput: Appending buffer at index 0 with data 0x0x7f09e00142e0!
11:36:40.934Z|4|F20CC700* [uastack] OpcUa_SecureStream_AppendInput: appended chunk with SN 129, RID 79
11:36:40.934Z|4|F20CC700* [uastack] ReleaseSecurityKeyset: Keyset for token 1 released.
11:36:40.934Z|4|F20CC700* [uastack] OpcUa_Endpoint_OnNotify: Underlying listener raised request event!
11:36:40.934Z|4|F20CC700* [uastack] OpcUa_SecureStream_Read: end of buffer reached: 1 requested, 0 available in buffer; need to skip)!
11:36:40.934Z|4|F20CC700* [uastack] OpcUa_Endpoint_BeginProcessRequest: Service with RequestTypeId 629 called! (Request: ReadRequest)
11:36:40.934Z|4|F20CC700* [uastack] OpcUa_Endpoint_BeginProcessRequest: Invoking service handler with context 0x0x7f09e000d530!
11:36:40.934Z|4|F20CC700* ==> UaServer::Read [Request=1000144]
11:36:40.934Z|6|F20CC700* --> UaSession::startingServiceProcessing [ID=1569736911]
11:36:40.934Z|6|F20CC700* <-- UaSession::startingServiceProcessing - activeServiceCount = 3
11:36:40.934Z|6|F20CC700* --> UaTransactionManager::beginRead with 8 nodes
11:36:40.934Z|7|F20CC700* Read Request [Request=1000144]:
11:36:40.934Z|7|F20CC700* MaxAge = 0.000000 ms
11:36:40.934Z|7|F20CC700* TimestampsToReturn = Neither
11:36:40.934Z|7|F20CC700* NoOfNodesToRead = 8
11:36:40.934Z|7|F20CC700* Node[0] NS2|String|{8b2b83ac-f56d-4805-82c6-01859780d476}.ExpectedNumberOfBirds Attribute=2
11:36:40.934Z|7|F20CC700* Node[1] NS2|String|{8b2b83ac-f56d-4805-82c6-01859780d476}.ExpectedNumberOfBirds Attribute=3
11:36:40.934Z|7|F20CC700* Node[2] NS2|String|{8b2b83ac-f56d-4805-82c6-01859780d476}.ExpectedNumberOfBirds Attribute=4
11:36:40.934Z|7|F20CC700* Node[3] NS2|String|{8b2b83ac-f56d-4805-82c6-01859780d476}.ExpectedNumberOfBirds Attribute=5
11:36:40.934Z|7|F20CC700* Node[4] NS2|String|{8b2b83ac-f56d-4805-82c6-01859780d476}.ExpectedNumberOfBirds Attribute=14 <--- request DataType
11:36:40.934Z|7|F20CC700* Node[5] NS2|String|{8b2b83ac-f56d-4805-82c6-01859780d476}.ExpectedNumberOfBirds Attribute=15
11:36:40.934Z|7|F20CC700* Node[6] NS2|String|{8b2b83ac-f56d-4805-82c6-01859780d476}.ExpectedNumberOfBirds Attribute=16
11:36:40.934Z|7|F20CC700* Node[7] NS2|String|{8b2b83ac-f56d-4805-82c6-01859780d476}.ExpectedNumberOfBirds Attribute=10
11:36:40.934Z|6|F20CC700* --> IOManagerUaNode::beginTransaction ID=1
11:36:40.934Z|6|F20CC700* <-- IOManagerUaNode::beginTransaction [ret=0x0]
11:36:40.934Z|6|F20CC700* --> IOManagerUaNode::finishTransaction ID=1
11:36:40.934Z|6|F20CC700* <-- IOManagerUaNode::finishTransaction [ret=0x0]
11:36:40.934Z|6|F20CC700* <-- UaTransactionManager::beginRead [ret=0x0]
11:36:40.934Z|4|F20CC700* <== UaServer::Read
11:36:40.934Z|4|F21CD700* [uastack] OpcUa_Endpoint_BeginSendResponse: Context 0x0x7f09e000d530
11:36:40.934Z|7|F21CD700* Read Response [Request=1000144]:
11:36:40.934Z|7|F21CD700* NoOfResults = 8
11:36:40.934Z|4|F20CC700* [uastack] OpcUa_Endpoint_BeginProcessRequest: Service handler returned! (0x00000000)
11:36:40.934Z|4|F20CC700* [uastack] * OpcUa_TcpListener_EventCallback: Event Handler returned with status 0x00000000.
11:36:40.934Z|7|F21CD700* Node[0] SrvTS=00:00:00.000Z SrcTS=00:00:00.000Z Val=2
11:36:40.934Z|7|F21CD700* Node[1] SrvTS=00:00:00.000Z SrcTS=00:00:00.000Z Val=ExpectedNumberOfBirds
11:36:40.934Z|7|F21CD700* Node[2] SrvTS=00:00:00.000Z SrcTS=00:00:00.000Z Val=ExpectedNumberOfBirds
11:36:40.934Z|7|F21CD700* Node[3] Status = 0x80350000
11:36:40.934Z|7|F21CD700* Node[4] SrvTS=00:00:00.000Z SrcTS=00:00:00.000Z Val=7 <----- value 7 is NodeId from UInt32 builtin type
11:36:40.934Z|7|F21CD700* Node[5] SrvTS=00:00:00.000Z SrcTS=00:00:00.000Z Val=-1
11:36:40.934Z|7|F21CD700* Node[6] SrvTS=00:00:00.000Z SrcTS=00:00:00.000Z Val={}
11:36:40.934Z|7|F21CD700* Node[7] Status = 0x80350000
11:36:40.934Z|6|F21CD700* --> UaSession::lockSendResponse [ID=1569736911]
11:36:40.934Z|6|F21CD700* <-- UaSession::lockSendResponse
11:36:40.934Z|4|F21CD700* CALL Send Response for Read [Request=1000144][ServiceResult=0x0]
11:36:40.934Z|4|F21CD700* [uastack] OpcUa_Endpoint_EndSendResponse: Status 0x00000000, Context 0x0x7f09e000d530!
11:36:40.934Z|4|F21CD700* [uastack] OpcUa_SecureListener_BeginSendResponse: 1 streams now active at channel 1569736928
11:36:40.934Z|4|F21CD700* [uastack] GetCurrentSecuritySet: Current Keysets requested. Returned token id is 1
11:36:40.934Z|4|F21CD700* [uastack] ReleaseSecurityKeyset: Keyset for token 1 released.
11:36:40.934Z|4|F21CD700* [uastack] OpcUa_SecureListener_EndSendResponse: ID 79, Status 0x00000000
11:36:40.934Z|4|F21CD700* [uastack] OpcUa_SecureListener_EndSendResponse: 0 stream remaining at channel 1569736928!
11:36:40.934Z|4|F21CD700* [uastack] GetCurrentSecuritySet: Current Keysets requested. Returned token id is 1
11:36:40.934Z|4|F21CD700* [uastack] GetCurrentSecuritySet: Current Keysets requested. Returned token id is 1
11:36:40.934Z|4|F21CD700* [uastack] ReleaseSecurityKeyset: Keyset for token 1 released.
11:36:40.934Z|4|F21CD700* [uastack] ReleaseSecurityKeyset: Keyset for token 1 released.
11:36:40.934Z|4|F21CD700* [uastack] OpcUa_TcpStream_Flush: Flush no. 1 with 5000 max flushes and final flag 1!
11:36:40.934Z|4|F21CD700* [uastack] OpcUa_TcpStream_Flush: Messagelength is 153! Last Call!
11:36:40.934Z|4|F21CD700* [uastack] OpcUa_TcpStream_Flush: Buffer emptied!
11:36:40.934Z|4|F21CD700* [uastack] OpcUa_SecureStream_Flush: Flush number 0! (Last)
11:36:40.934Z|4|F21CD700* [uastack] OpcUa_TcpListener_EndSendResponse: Status 0x00000000, Stream 0x7f09d8000b60, Connection 0xe97250
11:36:40.934Z|4|F21CD700* [uastack] SecureListener - ChannelManager_ReleaseChannel: invalid ref count!
11:36:40.934Z|4|F21CD700* [uastack] OpcUa_Endpoint_DeleteContext!
11:36:40.934Z|4|F21CD700* CLEAN Send Response for Read
11:36:40.934Z|6|F21CD700* --> UaSession::unlockSendResponse [ID=1569736911]
11:36:40.934Z|6|F21CD700* <-- UaSession::unlockSendResponse
11:36:40.934Z|6|F21CD700* --> UaSession::finishedServiceProcessing [ID=1569736911]
11:36:40.934Z|6|F21CD700* <-- UaSession::finishedServiceProcessing - activeServiceCount = 2
11:36:40.934Z|4|F21CD700* DONE Send Response for Read
Do you have any ideas on what might be going wrong?
Regards,
Dave