AlcapDAQ  1
Functions
CAENVMEDemoMain.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include "CAENVMElib.h"
#include "console.h"

Go to the source code of this file.

Functions

void CaenVmeManual (long, short)
 
int main (int argc, void *argv[])
 

Function Documentation

void CaenVmeManual ( long  ,
short   
)

Referenced by main().

int main ( int  argc,
void *  argv[] 
)

Definition at line 57 of file CAENVMEDemoMain.c.

References CAENVME_End(), CAENVME_Init(), CaenVmeManual(), con_end(), con_init(), cvSuccess, cvV1718, cvV2718, and printf().

59 {
60 CVBoardTypes VMEBoard;
61 short Link;
62 short Device;
63 int32_t BHandle;
64 
65 
66 
67 if( (argc != 3) && (argc != 4) )
68  {
69  printf("Usage: CAENVMEDemo V1718 <VMEDevice>\n");
70  printf(" CAENVMEDemo V2718 <VMEDevice> <VMELink>\n");
71  exit(1);
72  }
73 else
74  {
75  if( strcmp((char*)argv[1], "V1718") == 0 )
76  {
77  if( argc == 3 )
78  {
79  VMEBoard = cvV1718;
80  Device = atoi((const char*)argv[2]);
81  Link = 0;
82  }
83  else
84  {
85  printf(" CAENVMEDemo V1718 <VMEDevice>\n");
86  exit(1);
87  }
88  }
89  else
90  {
91  if( strcmp((char*)argv[1], "V2718") == 0 )
92  {
93  if( argc == 4 )
94  {
95  Device = atoi((const char*) argv[2]);
96  Link = atoi((const char*) argv[3]);
97  VMEBoard = cvV2718;
98  }
99  else
100  {
101  printf(" CAENVMEDemo V2718 <VMEDevice> <VMELink>\n");
102  exit(1);
103  }
104  }
105  else
106  {
107  printf("Usage: CAENVMEDemo V1718 <VMEDevice>\n");
108  printf(" CAENVMEDemo V2718 <VMEDevice> <VMELink>\n");
109  exit(1);
110  }
111  }
112 
113  }
114 
115 // Initialize the Board
116 
117 if( CAENVME_Init(VMEBoard, Link, Device, &BHandle) != cvSuccess )
118  {
119  printf("\n\n Error opening the device\n");
120  exit(1);
121  }
122 
123 
124 con_init() ;
125 
126 // CAENVME_SetFIFOMode(BHandle,1) ;
127 
128 CaenVmeManual(BHandle,1) ;
129 
130 con_end() ;
131 
132 CAENVME_End(BHandle);
133 }