      SUBROUTINE PLIP.CALL.RPC.3(CMD,R.RES,V1,V2,V3)
*PIC-LAN
*
*ALL
*PC
*Y
*
*
*
*
*
* (C) Copyright 2001 Modular Software Corporation.  All rights reserved.
*
* This is a subroutine "template" that is used to make calling remote
* subroutines easier.
*
* You can call this template to remotely call subroutines on another
* system.
*
*
* There are 20 versions of this template available for subroutine calls
* with 1 to 20 parameters.
*
* The first paramter to this subroutine is a string that specifies the
* name of the server that you are calling, the name of the remote
* subroutine, and some optional parameters.  These fields can be
* seperated with spaces, commas, or system delimiters.
*
*    Field 1    - Server name             (required)
*    Field 2    - Subroutine name         (required)
*    Field 3    - Subroutine password     (optional)
*    Field 4    - Parameter direction control list (optional)
*    Field 5    - Xmit timeout (seconds)           (optional)
*    Field 6    - Xmit max size (bytes)            (optional)
*    Field 7    - Recv timeout (seconds)           (optional)
*    Field 8    - Recv max size (bytes)            (optional)
*    Field 9    - Retry limit count                (optional)
*
* Optional fields are set by default or can be setup in the servers
* control file.
*
* R.RES is the returned result code.  If the RPC call suceeds, then
* this paramter will return null.  Otherwise, this parameter will tell
* you what aspect of the call itself failed.
*
      DIM P.ARRAY(20)
*
      EQUATE N.PARAMETERS TO 3
*
*----------------------------------------------------------------------*
*
      I.CMD = CMD
*
      I.CMD = PL_REPL(I.CMD,' ',AM)
      I.CMD = PL_REPL(I.CMD,',',AM)
      I.CMD = PL_REPL(I.CMD,SVM,AM)
      I.CMD = PL_REPL(I.CMD, VM,AM)
*
      SERVER.NAME = OCONV(I.CMD<1>,'MCU')
      SUB.NAME    = OCONV(I.CMD<2>,'MCU')
      SUB.PSWD    = OCONV(I.CMD<3>,'MCU')
      SUB.PARMS   = OCONV(I.CMD<4>,'MCU')
      XMIT.TIMEOUT  = I.CMD<5> + 0
      XMIT.MAX.SIZE = I.CMD<6> + 0
      RECV.TIMEOUT  = I.CMD<7> + 0
      RECV.MAX.SIZE = I.CMD<8> + 0
      MAX.RETRIES   = I.CMD<9> + 0
*
      MAT P.ARRAY = ''
*
      ON N.PARAMETERS GOTO 201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220
*
220   P.ARRAY(20) = V20
219   P.ARRAY(19) = V19
218   P.ARRAY(18) = V18
217   P.ARRAY(17) = V17
216   P.ARRAY(16) = V16
215   P.ARRAY(15) = V15
214   P.ARRAY(14) = V14
213   P.ARRAY(13) = V13
212   P.ARRAY(12) = V12
211   P.ARRAY(11) = V11
210   P.ARRAY(10) = V10
209   P.ARRAY(9) = V9
208   P.ARRAY(8) = V8
207   P.ARRAY(7) = V7
206   P.ARRAY(6) = V6
205   P.ARRAY(5) = V5
204   P.ARRAY(4) = V4
203   P.ARRAY(3) = V3
202   P.ARRAY(2) = V2
201   P.ARRAY(1) = V1
*
      CTRL = ''
      CTRL<1>  = SERVER.NAME
      CTRL<2>  = ''               ; * Place holder for target account (not implemented)
      CTRL<3>  = SUB.NAME
      CTRL<4>  = SUB.PSWD
      CTRL<5>  = XMIT.TIMEOUT
      CTRL<6>  = XMIT.MAX.SIZE
      CTRL<7>  = RECV.TIMEOUT
      CTRL<8>  = RECV.MAX.SIZE
      CTRL<9>  = MAX.RETRIES
      CTRL<10> = N.PARAMETERS
      CTRL<11> = SUB.PARMS
*
      CALL PLIP.RPC.CLIENT(CTRL,MAT P.ARRAY,R.RES)
*
      ON N.PARAMETERS GOTO 301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320
*
320   V20 = P.ARRAY(20)
319   V19 = P.ARRAY(19)
318   V18 = P.ARRAY(18)
317   V17 = P.ARRAY(17)
316   V16 = P.ARRAY(16)
315   V15 = P.ARRAY(15)
314   V14 = P.ARRAY(14)
313   V13 = P.ARRAY(13)
312   V12 = P.ARRAY(12)
311   V11 = P.ARRAY(11)
310   V10 = P.ARRAY(10)
309   V9 = P.ARRAY(9)
308   V8 = P.ARRAY(8)
307   V7 = P.ARRAY(7)
306   V6 = P.ARRAY(6)
305   V5 = P.ARRAY(5)
304   V4 = P.ARRAY(4)
303   V3 = P.ARRAY(3)
302   V2 = P.ARRAY(2)
301   V1 = P.ARRAY(1)
*
      RETURN
   END
