00001 /* 00002 * MAX : gpib.h, Sam Dez 29 19:41:25 CET 2001 -sg 00003 * 00004 * (c) 1998 by C. Rosen, C. Otto, D. Rohloff, M. Dammasch 00005 * 00006 * This file is part of Max data acquisition software 00007 * Copyright (C) 1997,98 Christian Rosen 00008 * 00009 * Max is free software; you can redistribute it and/or modify it 00010 * under the terms of the version 2 of GNU General Public License as 00011 * published by the Free Software Foundation. 00012 * 00013 * Max is distributed in the hope that it will be useful, but WITHOUT 00014 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00015 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 00016 * for more details. 00017 * 00018 * You should have received a copy of the GNU General Public License 00019 * (see the file COPYING) in this directory; if not, write to the 00020 * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00021 */ 00022 00023 #ifndef __GPIB_HPP__ 00024 #define __GPIB_HPP__ 00025 00026 #define GPIB_OK 1 00027 #define GPIB_ERR 0 00028 00029 #define GPIB_STRMAX 255 00030 #define GPIB_NAMEMAX 80 00031 00032 // initflags for gpib_init() 00033 #define IB_IFC 1 00034 #define IB_REM 2 00035 #define IB_CLEAR 4 00036 00037 // 00038 // Definition of GPIB_Device structure 00039 // 00040 typedef struct { 00041 int addr; // Bus-Address of the device 00042 char name[GPIB_NAMEMAX+1]; // Name-String of the device (as defined in GPIB.CONF) 00043 int stat; // Status of the Device (GPIB_ERR or GPIB_OK) 00044 } GPIB_Device; 00045 00046 // 00047 // function prototypes as defined in GPIB.CPP 00048 // 00049 GPIB_Device gpib_init ( char *device_name, int initflag ); 00050 int gpib_clear ( GPIB_Device *device ); 00051 int gpib_write ( GPIB_Device *device, char *formatstr, ... ); 00052 int gpib_read ( GPIB_Device *device, char *buffer, unsigned long length ); 00053 00054 #endif