on 2019 Nov 15 1:12 AM
Hi,
Following are system details.
SAP MII: 15.2 SP0 Patch 12
SAP Pco: 15.2.3.3682
RS232 Device: lika LD200 length scale
Serial to Ethernet Device: Lantronix xDirect
Requirement: Send Hex Command from Pco Query to device connected to Pco Socket agent and receive notification in Pco.
Issue: Pco Query is not writing the command into device however i am receiving success (0) in Pco Query response.
CALL SEND (address=' ', port=' ', message='[0x7C,0x00,0x54,0x50,0x4F,0x53,0x00,0x00,0x00,0x00,0x00,0x01,0xC2,0x04]');
I tried with various formats in command below are few of them. but never received the notification back from device.
\\7C\\00\\53\\54\\41\\52\\00\\00\\00\\00\\64\\02\\1A\\04
7C0054504F53000000000001C204
I tried with node js (node-RED) tcp/ip request its working perfect, even if i send start cyclic communication command to device from node js than start pco agent it starts receiving the multiple pco notification but that is not what we want.
Please let me know if more details required.
I appreciate any help on this issue.
Request clarification before answering.
Check out this thread - https://answers.sap.com/questions/11841480/pco-socket-agent-hex-characters.html . I haven't done it in a while but I remember the format can be picky and sometimes you have to see whats coming out of PCo at the other end like Kevin suggested to be sure the command isn't getting escaped or malformed somewhere. Hercules is also a good tool - https://www.hw-group.com/software/hercules-setup-utility
Regards,
Christian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Have you also tried sending the command as ASCII ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Manoj,
If I have trouble when using the socket agent I typically would use an app called Socket Test (http://sockettest.sourceforge.net/) and connect PCo to that rather than the RS232 to ethernet adapter to see what is really being sent. This might give you a clue.
What data should you be sending ? What data is being received by the machine?
You can also use Socket Test to emulate PCo and manually send messages to the serial server to test it.
Thanks
Kevin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just a heads up because it may not be clear. I think PCo may only escape/convert hex control characters so the message you send may need to be formatted something like this
My recommendation is to get Hercules and wire-shark going to see whats going over the wire with a working source and the PCo one and try to troubleshoot/tweak the message until it looks right.
Regards,
Christian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The proper way to execute a PcoQuery FixedQuery CALL SEND() function is as follows:
CALL SEND(address='127.0.0.1',port='20000',message='<your message>');
NOTE: address and port values are required, even if PCo Socket Agent/Instance is already connected to the socket port for subscriptions.
For encoding control characters use this format for EACH character: &#xx; where xx is the numeric character value: for example, to send a carriage return(13), line feed(10), and tab(8), the value of <your message> would be like this:
CALL SEND(address='127.0.0.1',port='20000',message=' ');
Hope this helps!
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 Christian, Kevin,
I tried Hercules tool TCP/IP Client sending Hex command and receiving data as expected command i used was (7C 00 54 50 4F 53 00 00 00 00 00 01 C2 04).
Then I used TCP Server of tool and connected to Pco socket agent and Query I am receiving the same command whatever i am sending from Pco Query without distortion following are two samples i tried.
(7C 00 54 50 4F 53 00 00 00 00 00 01 C2 04)
\\7C\\00\\54\\50\\4F\\53\\00\\00\\00\\00\\00\\01\\C2\\04.
Please let me know thats how you wanted me to test it o i missed any part of it.
Still not able to write command to the device.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Kevin, Christian!!
I tried with &# characters but its endup as parsing error in Pco.
I will try the tools suggested by both of you and update accordingly.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
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.