PxPlus User Forum

Main Board => Discussions => Programming => Topic started by: Prajin P K on July 27, 2018, 03:15:05 AM

Title: Remote Process Control
Post by: Prajin P K on July 27, 2018, 03:15:05 AM
Hi,
   How can we use PROCESS SERVER directive for Remote Process Control. we tried the code as like this:

       
         PROCESS SERVER "inventory" ON "[tcp]xxx.xxx.xxx.xx;80"
         CALL "[RPC]:inventory]RPCTest"
         PROCESS SERVER "inventory" CLOSE
   
   error:


         PROCESS SERVER "inventory" ON "[tcp]xxx.xxx.xxx.xx;80"
         Error #15: Operating system command failed
         Last file accessed [tcp]xxx.xxx.xxx.xxx;80
         Current program is C:\PxPlus\xxxx\xx\RPCTestCode, line 20
         [TCP][Winsock]Error status:0 (-1:<Unk>)


   please let us know what happening here, what is the solution for this.


Thank you,
Title: Re: Remote Process Control
Post by: Stéphane Devouard on July 27, 2018, 04:54:36 AM
Again, there is a page dedicated to RPC in the On-Line Documentation I pointed you to in another forum thread, reading it carefully should give you some insight...

https://manual.pvxplus.com/PXPLUS/Remote%20Process%20Capability/Introduction.htm

xxx.xxx.xxx.xxx in "xxx.xxx.xxx.xxx;80" obviously needs to be replaced by the IP address of the server where the RPC host program is running and listening
80 in "xxx.xxx.xxx.xxx;80" is the TCP/IP port on which the RPC host program on the remote server is supposed to listen -- chances are that you'll have another program with this port already in use (maybe IIS on Windows, maybe Apache on Linux), so you'll have to use another port.

To sum it up:
- First, have the *RPSRVR program running on a remote computer on your network and listening on an available IP port (e.g. 15000)
- On another server, use the PROCESS SERVER statement to establish a connection between your "Inventory" logical name and the physical IP & Port of the RPC server, as in "[tcp]192.168.1.11;15000" (again this is an example, the IP address must be the one of the computer where *RPSRVR is running)
- To call a program on the remote server, do a CALL "[rpc:Inventory]RPCTest"

Hope that helps
Title: Re: Remote Process Control
Post by: Prajin P K on July 30, 2018, 09:36:34 AM
Hi Stephane,


    I have tried as like you mentioned, now its able to execute RPC call from my system. thank you so much for great help.