cancel
Showing results for 
Search instead for 
Did you mean: 

RS 232 Serial Deice - SAP MII Integration Issue

manoj_bilthare123
Discoverer

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.

Kevin_Hunter
Advisor
Advisor

Try message='C;56)4@A;');

I tried it with socket test and Im not seeing what I expected !

Can you connect node red to socket test and paste what you receive ? Note control characters will not be shown in socket test (appear as a space) so copy it to notepad ++ and it will display the hidden control characters.

Thanks

Kevin

Kevin_Hunter
Advisor
Advisor

Great ! The webpage converted what I typed

This is what it was supposed to say !

Accepted Solutions (0)

Answers (7)

Answers (7)

former_member185280
Active Contributor

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

Kevin_Hunter
Advisor
Advisor

Have you also tried sending the command as ASCII ?

Kevin_Hunter
Advisor
Advisor

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

0 Kudos

Hi kevin.hunter3

Thanks for the quick response! The device is a length gauge. The device needs to respond to a request for the measurement results from MII through PCo. It is a required Go/No Go wicket and the data is also used for SPC Analysis.

Regards, Mike

former_member185280
Active Contributor
0 Kudos

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

steve_stubbs
Participant
0 Kudos

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

steve_stubbs
Participant
0 Kudos

I see that my definition of the message got "converted". So to state a different way:

To send a carriage return (13), line feed (10) and tab (08), the message would be '&#aa;&#bb;&#cc;'

where aa=13, bb-10, cc=08.

Regards, Steve

manoj_bilthare123
Discoverer
0 Kudos

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.

0 Kudos

salvatore.castro and @Steve Stubbs (not sure if you follow this anymore), but any thoughts on this item?

Thanks, Mike

manoj_bilthare123
Discoverer
0 Kudos

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.