C+ C #.#.# C C C C Task to Task Communication Subroutine (PIPE) C C C FUNCTION: C Pass variable length messages between tasks. C C C CALLING SEQUENCE: C C CALL PIPE ( DEV, FNC, NAME, BUFFER, NWDS, ERROR) C C WHERE: C ARGUMENT = DESCRIPTION ACCESS C DEV = Device number of the pipe PA C FNC = Function code PA C 0 - initialize (create queue) C 1 - write C 2 - read C 3 - wait for message then read it C 4 - create specified queue and C flush it if already exists C 5 - delete specified queue C 6 - delete all queues in the entire pool C NAME = Queue name in rad-50 (2 words) PA C BUFFER = Message buffer PA/RE C NWDS = Number of words to write or buffer PA/RE C length if read. If read operation, C the actual number of words is returned. C ERROR = Error return RE C 0 - no error C 1 - no VS: devices specified in TKB C 2 - invalid function code C C note: negative error return is from RSX-11M C or the variable send data driver. C -101. = Queue not found C -102. = Queue already exists C -103. = No more space in private pool C -104. = Read already waiting in queue C -105. = No message available C -106. = User buffer is too small for data transfer C C SUBROUTINES REFERENCED: C WTQIO GETADR C C C DESCRIPTION: C PIPE is an interface routine for passing messages to/from another C task via the VS: driver. C C SPECIAL CONSIDERATIONS: C C 1. PIPE uses RSX11-M executive services. C C- SUBROUTINE PIPE ( DEV, FNC, NAME, BUFFER, NWDS, ERROR) IMPLICIT INTEGER (A-Z) PARAMETER VXLUN = 1 DIMENSION ISB(2), PRL(6), BUFFER(1) DIMENSION IOFNC(7), NAME(2) DATA IOFNC / 1280, 256, 512, 640, 1344, 1536, 1537/ C C Get the lun number; C if [invalid lun]; C then, {return error #1}; C if [invalid function code]; C then, {return error #2}; C get virtual address of BUFFER; C calculate bytecount; C issue the QIO; C if [unsuccessful]; C then, {set ERROR = negative status}; C return. C ERROR = 0 CALL ASNLUN (VXLUN, 'VX', DEV-1) IF (FNC .LT. 0 .OR. FNC .GT. 6)GO TO 810 CALL GETADR (PRL,BUFFER) PRL(2) = NWDS*2 PRL(3) = NAME(1) PRL(4) = NAME(2) CALL WTQIO ( IOFNC(FNC+1), VXLUN, 1, PRI, ISB, PRL, IDS) IF (FNC .GT. 1) NWDS = ISB(2)/2 IF (ISB(1) .EQ. 1) GO TO 900 ERROR = IOR("177400,ISB(1)) GO TO 900 800 CONTINUE ERROR = 1 GO TO 900 810 CONTINUE ERROR = 2 900 CONTINUE RETURN END