PROGRAM RMDMO2 C+ C C Copyright (C) 1981 C Digital Equipment Corporation, Maynard, Massachusetts 01754 C C This software is furnished under a license and may be used and copied C only in accordance with the terms of such license and with the C inclusion of the above copyright notice. This software or any other C copies thereof may not be provided or otherwise made available to any C other person. No title to and ownership of the software is hereby C transferred. C C The information in this software is subject to change without notice C and should not be construed as a commitment by Digital Equipment C Corporation. C C Digital Equipment Corporation assumes no responsibility for the use or C reliability of its software on equipment which is not supplied by C Digital Equipment Corporation. C C+ C C Version: 1.0 C C Date: 20-October-1982 C C Authors: Thomas A. Turano C C Purpose: This program demonstrates several REAL11 C functions using the intertask communications C feature of RSX11S DECNET. C C A task RMDEMO2 on the VAX host requests that C this task be started on the LABSTATION node. C This task then does the following: C C C- C C set up arrays C DIMENSION istat(40) !network status buffer DIMENSION ibuff1(2048),ibuff2(2048),ibuff3(2048)!a/d collection buffers BYTE recv1(4096),recv2(4096),recv3(4096) !transmission buffers BYTE mlbx(98) !mailbox buffer EQUIVALENCE (ibuff1(1),recv1(1))!recv1 and ibuff1 share space EQUIVALENCE (ibuff2(1),recv2(1))!recv2 and ibuff2 share space EQUIVALENCE (ibuff3(1),recv3(1))!recv3 and ibuff3 share space C C set up variables C C errflg error flag C ibufno number of next buffer in user queue C ibufsz buffer size C icount number of buffers transmitted C ind success indicator C iost I/O status block C iprset clock preset C irate clock rate C mltype mailbox buffer type INTEGER*2 errflg,ibufno,ibufsz,icount,ind,iost(2) INTEGER*2 iprset,irate,mltype,mstat(3) C C prepare for DECnet communications by: C C 1. accessing the network C 2. getting the network data C 3. accepting the connect request from the host C CALL opnntw(3,iost,mstat) !open network IF(iost(1).NE.1)GOTO 999 !if error simply exit CALL gndntw(iost,mltype,98,mlbx)!get network data IF(iost(1).LT.0)GOTO 989 !if error close net first 20 CALL accntw(4,iost,mlbx) !accept connect request IF(iost(1).EQ.1)GOTO 30 !if connected go on to the REAL11 part IF(iost(1).EQ.-1)GOTO 20 !if resources not available try again IF(iost(1).LE.-3)GOTO 989 !if anything else shutdown C C prepare for REAL11 tasks C C C 1. set the buffers for the D/A conversion C 30 CONTINUE CALL setibf(istat,ind,,ibuff1,ibuff2,ibuff3)!initialize buffers IF(ind.EQ.0)GOTO 988 !on error shut down net C C 2. set the clock parameters C dwell=.02 !time between samples CALL xrate(dwell,irate,iprset) !get the rate CALL clocka(irate,iprset,ind) !start the clock IF(ind.EQ.0)GOTO 988 !on error shut down net C C get the three buffers from the host C DO 85 jj=1,3 IF(jj.EQ.3)GOTO 75 IF(jj.EQ.2)GOTO 70 IF(jj.EQ.1)GOTO 65 65 CONTINUE CALL recntw(4,iost,4096,recv1) !receive buffer1 GOTO 80 !branch to check status 70 CONTINUE CALL recntw(4,iost,4096,recv2) !receive buffer2 GOTO 80 !branch to check status 75 CONTINUE CALL recntw(4,iost,4096,recv3) !receive buffer3 GOTO 80 !branch to check status 80 IF(iost(1).EQ.1)GOTO 83 !if successful continue errflg=1 !else set error flag to 1 GOTO 988 !and shut down net 85 CONTINUE C C 3. release the buffers to the D/A C 100 CONTINUE CALL rlsbuf(istat,ind,0,1,2) !release buffers in order IF(ind.EQ.0)GOTO 988 !on error shut down net C C 3. start the D/A sweep C ibufsz=2048 !define the size of the buffer CALL daswp(istat,ibufsz,3,,iprset,,,1,) !start the sweep CALL iwtbuf(istat,,ibufno,ind) !wait for buffers to be released C C terminate the link C C 1. disconnect the network C 2. close the network C 988 CONTINUE CALL dscntw(4,iost) !disconnect net 989 CONTINUE CALL clsntw(iost(1)) !close net 999 CONTINUE CALL exit END