on 07-16-2015 11:55 AM
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
Resolved it myself. Control charters should be sent in the following format:
Text string: <16><16><05> 011AF<04>
Hex string:  011AF
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Pieter,
Use an additional backslash character (\) to escape each backslash character. I have tested this with PCo 2.305.2141.1051 and it works correctly:
CALL SEND(address='127.0.0.1', port='20000', message='\\16\\16\\05 0115AF\\04');
Just curious, which PLC model are you connecting to?
Regards, Steve
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Steve,
Thank you for the reply. Padding the string with the additional escape character did resolve the error in PCo, but sniffing the data packet revealed that the string no contained the second "\" character. Thus not sending the string as control characters.
Just to eliminate any other errors, I patch PCo to 2.305.2177.1541
Any other thoughts?
I am connecting to a niche application used for batching a product. It uses the modified BISYNC protocol on TCP/IP socket connection
Regards, Pieter
Hi Pieter,
try to encode the message string before sending. It wont accept something with <space>.
Regards,
Manisha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
12 | |
7 | |
3 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.