cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

PCO Socket agent hex characters

pieter_conradie2
Explorer
0 Likes
1,092

Dear Forum,

I have a requirement to connect to a plant PLC using a socket connection in SAP PCO to extract batching weights for produced product. To communicate with the PLC different strings need to be sent to it to get these results back. A typical wake-up string template would be "SYN(16) SYN(16) ENQ(05) ID# ID# EOT(04)" which will return "SYN(16) ACK(06) Status Code EOT(04) CR(0D)". (Hex in brackets)

I have successfully connected to the PLC via the socket agent, but when sending the wake-up string from MII to PCO it results in error:

Message sent - CALL SEND(address='nnn.nn.n.nn', port='7000', message='\16\16\05 0115AF\04');

Error received - Query execution failed due to following:

[Tag] : Exception [TokenizerException] - Token error (Invalid Escape Character), at location 55, expected tokens [String,Double,Long,Time].

rt='7000', message='                     \16\16\05 0115AF\04'                    ^

The question is: How do I escape the control characters in the message to get a successful transmission?

SAP MII version 15.0 SP3 Patch 0

SAP PCO version 2.3 SP4

View Entire Topic
pieter_conradie2
Explorer
0 Likes

Resolved it myself. Control charters should be sent in the following format:

Text string:     <16><16><05> 011AF<04>

Hex string:     &#22;&#22;&#05; 011AF&#04;