source: trigger/v560_test.c@ 781

Last change on this file since 781 was 52, checked in by rissim, 15 years ago
trigger software (VME) v1
File size: 1.1 KB
Line 
1//Simple Program to check the communication with the v560-modules listed in the file 'v560_base.dat'.
2#include <unistd.h>
3
4#include <stdio.h>
5//#include "rcc_error/rcc_error.h"
6//#include "vme_rcc/vme_rcc.h"
7#include "v560.h"
8
9int main(void)
10{
11 //return values
12 //0: programm run successful
13 //1: VME open not successful
14 //2: v560 open not successful
15 //3: v560 print info not successful
16 //4: v560 close not successful
17 //5: VME close not succesful
18
19 VME_ErrorCode_t error_code;
20
21 printf("This program checks the communication with the v560-modules\nlisted in the file 'v560_base.dat'.\nThe programm should print the manufacturer's information\nstored in each module.\n\n");
22
23 /* if(error_code = VME_Open()) {
24 VME_ErrorPrint(error_code);
25 printf("VME open not successful.\n");
26 return 1;
27 }*/
28
29 V560_Open();
30
31
32 V560_Print_Info();
33 //now send an increment and read the counter:
34 int cc;
35 V560_Clear_Scales(1);
36 while(1)
37 {
38 V560_Clear_Scales(1);
39 sleep(1);
40 printf("rate: %i kHz (C0), %i kHz (C1) \n",(int)(V560_Read_Counter(1,0)/1000.),(int)(V560_Read_Counter(1,1)/1000.));
41
42
43
44
45 }
46 V560_Close();
47
48
49
50
51 //
52 return 0;
53
54}
Note: See TracBrowser for help on using the repository browser.