From: jackson@pravda.enet.dec.com
Newsgroups: comp.os.vms
Subject: Re: Dual monitor on VS3100: HELP!
Date: 7 Oct 92 18:58:42 GMT
Article-I.D.: engage.1992Oct7.185842.21784
Reply-To: jackson@pravda.enet.dec.com ()
Organization: Digital Equipment Corporation


In article <1992Oct3.132146.4019@spcvxb.spc.edu>, terry@spcvxb.spc.edu (Terry Kennedy, Operations Mgr.) writes:
>> Some time ago, someone explained how to connect a second monitor to a
|>> VAXstation 3100. I already have the cable that splits the video output
|>> into a black and white, and a color signal (RGB). This also works in
|>> console mode ( test 61 and test 81 for a "EEEEEEEE" pattern on the bw
|>> and color monitor resp.). I want to use this in VMS, but can't find how
|>> to connect the BW video controller. The system starts on the color
|>> monitor, and i can start DECWindows.
|>
Terry


Here's the text of my DECW$PRIVATE_SERVER_SETUP.COM.  I have a dual-screen 
SPX configuration with one monochrome VR150 attached.  This COM file is probably
more complex than it has to be since I have switched back and forth between
SPX and GPX configurations and didn't want to have to edit the file.  GEA0 is
the SPX, GAA0 is the GPX.

(SYS$MANAGER:DECW$PRIVATE_SERVER_SETUP.COM)


$       if f$getdvi("GCA0:","EXISTS") then goto gc_present
$       run sys$system:sysgen
        connect gca0/adap=0/csr=%X5000/vect=%o400/numv=01/driver=gcbdriver
$gc_present:
$!
$       If F$Getdvi("GEA0:","Exists") Then Device1="GEA0"
$       If F$Getdvi("GAB0:","Exists") Then Device1="GAA0"
$!
$       DECW$DEVICE == "''Device1',GCA0"
$!      DECW$COLOR == "F,F"
$       DECW$COLOR == "T,F"
$!
$!      Find the server density from USERD2
$!
$       Density = F$Getsyi("Userd2")
$       If Density .NE. 75
$         Then
$         If Density .NE. 100 Then Density = 75
$         Endif
$       decw$server_density == Density
$!
$       exit



By the way, if you switch the order of the devices and logical names, you can
put the session manager on the monochrome screen.  (it always runs on screen
0)


Also, you'll like the following program which allows the cursor to WRAP around
instead of being bouned on the far right side of screen 1 and left side of 
screen 0

(WRAP.C.  Build and link like any other DECwindows program)


/*
	The following program when run with privs on a VMS DECWindows
	workstation will cause the pointer to wrap around from the
	right edge of the screen to the left edge of the screen for
	both single and dual head systems.
*/
#include <iodef>
#include <ssdef>
#include <descrip>
#include <lnmdef>
#include <lib$routines>
#include <starlet>
typedef struct _itemlist
    {
    short   bufferLen;
    short   itemCode;
    char    *bufferAddress;
    int	    *returnLength;
    } itemlist;
    static $DESCRIPTOR (DEVNAM, "DECW$SERVER_SCREENS");
    static $DESCRIPTOR(SERVER0,"DECW$SERVER0_TABLE");
    static $DESCRIPTOR(first_dev,"xxxx");
    static $DESCRIPTOR(last_dev,"xxxx");
/*                                                                          */
/* DECwindows Driver for SETMODE of ATTACH_SCREEN call.                     */
/*	The following are different parameters allowed by                   */
/*	attach screen. Thus the prefix "DECW_AS_".                          */
/*                                                                          */
#define IO$K_DECW_AS_TO_INPUT 2
#define IO$K_DECW_AS_TO_RIGHT 3
#define IO$K_DECW_AS_TO_LEFT 4
#define IO$K_DECW_AS_TO_TOP 5
#define IO$K_DECW_AS_TO_BOTTOM 6
#define IO$K_LAST 7
/*                                                                          */
/* QIO function codes, modifiers and submodifiers                           */
/*                                                                          */
/*                                                                          */
/* DECwindows Driver SENSEMODE and SETMODE function modifier codes          */
/*                                                                          */
#define IO$K_DECW_CURSOR_ASSOC 2
#define IO$K_DECW_ENABLE_INPUT 3
#define IO$K_DECW_BUTTON_INFO 4
#define IO$K_DECW_CURSOR_COLOR 5
#define IO$K_DECW_CURSOR_PATTERN 6
#define IO$K_DECW_CURSOR_POSITION 7
#define IO$K_DECW_DEVICE_INFO 8
#define IO$K_DECW_KB_INFO 9
#define IO$K_DECW_MOTION_BUFFER 10
#define IO$K_DECW_POINTER_FILTER_BOX 11
#define IO$K_DECW_POINTER_INFO 12
#define IO$K_DECW_OPWIN_KEY 13
#define IO$K_DECW_SCREEN_SAVER 14
#define IO$K_DECW_KB_LED 15
#define IO$K_DECW_RING_BELL 16
#define IO$K_DECW_ATTACH_SCREEN 17
#define IO$K_DECW_PMOUSE_KEY 18
#define IO$K_DECW_PTR_ACCEL 19
#define IO$K_DECW_MOTION_COMP 20
#define IO$K_DECW_MOTION_BUFFER_INIT 21
#define IO$K_DECW_CURSOR_BOUNDRIES 22
#define IO$K_LAST 23
main()
{
    unsigned long int       condValue;		/* VMS condition value */
    unsigned short int      iosb[4];		/* i/o status block */
    unsigned short int	    chan;
    int			    index;
    int			    maxIndex;
    int			    temp,size;
    itemlist crelnm_itemlist[20];
    itemlist trnlnm_itemlist[3];
    itemlist *crelnm_listptr;
    char lognam_buffer[2048];

    trnlnm_itemlist[1].itemCode = LNM$_MAX_INDEX;
    trnlnm_itemlist[1].bufferAddress = &maxIndex;
    trnlnm_itemlist[1].returnLength = &temp;
    trnlnm_itemlist[1].bufferLen = 4;
    trnlnm_itemlist[2].itemCode=trnlnm_itemlist[2].bufferLen=0;
    condValue = sys$trnlnm(0,&SERVER0,&DEVNAM,0,&trnlnm_itemlist[1]);
    if (condValue != SS$_NORMAL)
    {
	PrintF("Couldn't translate logical name\n");
	lib$stop(condValue);
	return;
    }

    /*
    * Get first device
    */
    index = 0;
    trnlnm_itemlist[0].returnLength = &temp;
    trnlnm_itemlist[0].itemCode = LNM$_INDEX;
    trnlnm_itemlist[0].bufferLen = 4;
    trnlnm_itemlist[0].bufferAddress = &index;
    trnlnm_itemlist[1].bufferLen = 4;
    trnlnm_itemlist[1].itemCode = LNM$_STRING;
    trnlnm_itemlist[1].bufferAddress = first_dev.dsc$a_pointer;
    trnlnm_itemlist[1].returnLength = &size;
    trnlnm_itemlist[2].itemCode = trnlnm_itemlist[2].bufferLen = 0;
    condValue = sys$trnlnm(0,&SERVER0,&DEVNAM,0,&trnlnm_itemlist[0]);
    if (condValue != SS$_NORMAL)
    {
	PrintF("Couldn't translate logical name\n");
	lib$stop(condValue);
	return;
    }

    /*
    * Get last device
    */
    index = maxIndex;
    trnlnm_itemlist[0].returnLength = &temp;
    trnlnm_itemlist[0].itemCode = LNM$_INDEX;
    trnlnm_itemlist[0].bufferLen = 4;
    trnlnm_itemlist[0].bufferAddress = &index;
    trnlnm_itemlist[1].bufferLen = 4;
    trnlnm_itemlist[1].itemCode = LNM$_STRING;
    trnlnm_itemlist[1].bufferAddress = last_dev.dsc$a_pointer;
    trnlnm_itemlist[1].returnLength = &size;
    trnlnm_itemlist[2].itemCode = trnlnm_itemlist[2].bufferLen = 0;
    condValue = sys$trnlnm(0,&SERVER0,&DEVNAM,0,&trnlnm_itemlist[0]);
    if (condValue != SS$_NORMAL)
    {
	PrintF("Couldn't translate logical name\n");
	lib$stop(condValue);
	return;
    }

    condValue = sys$assign (&first_dev, &chan, 0, 0);
    if (condValue != SS$_NORMAL)
    {
	PrintF("Couldn't assign channel to DECW$SERVER_SCREENS\n");
	lib$stop(condValue);
	return;
    }
    condValue = sys$qiow (0, chan,         
			IO$_SETMODE,                
			&iosb, 0, 0,                
			IO$K_DECW_ATTACH_SCREEN,    
			IO$K_DECW_AS_TO_RIGHT,      
			&last_dev, 0, 0, 0) ;
    if (condValue != SS$_NORMAL)
    {
	PrintF("\nAttach screen failed %d", condValue) ;
	lib$stop(condValue);
	return;
    }
}


|--


William M. Jackson
Workstation Product Marketing Manager
Workstation Engineering
Digital Equipment Corporation
146 Main Street
Maynard, MA 01754

Mail:	Jackson@pravda.enet.dec.com