Date: Mon, 07 May 2001 13:33:41 -0700 (PDT) From: MGEORGE@SSRL.SLAC.STANFORD.EDU Subject: using dxp modules from ics... To: GEORGE@SSRL.SLAC.STANFORD.EDU X-VMS-To: GEORGE X-VMS-Cc: Graham - The following should give you a good idea of how to clear and read DXP modules within ics.... - Martin Using DXP devices within ICS. 1. Assign a channel like any other device. 2. To clear a DXP: Use two subroutine calls. The value for dxp_mode should be defined as a parameter in the fortran include file ICS_LIBRARY:ICS_USER_DEFS.FOR as DXP_GO_GT_UPD. If this is a problem, the actual value should be 2293968. int dxp_mode = DXP_GO_GT_UPD; /* value for the mode */ clear_device(&ics_chan); /* first generic clear */ mode_device(&ics_chan,&dxp_mode); /* then this mode op. */ 3. To read a DXP: Each DXP module has four channels, so you should call the following subroutine for each ICS DXP device. As for the clear operation, the mode flag ICS_READONLY_STATS is defined in the Fortran include file, it should be 2293764. int i,trans = 9,dxp_mode; /* trans = 9 nums/chan */ unsigned int read_chans[36]; for(i=0;i<4;i++) /* for each channel */ { dxp_mode = ICS_READONLY_STATS + i; /* set the mode flag */ ret = read_device_mode(&ics_chan, /* same ics channel */ &read_chans[i * trans], /* move down the array */ &dxp_mode, /* mode flag */ &trans); /* number of chans (9) */ }