source: tools/FAD/simple_daq/simple_daq.h@ 254

Last change on this file since 254 was 248, checked in by dneise, 14 years ago
initial check in of FAD tools simple daq - simple command line interface to FAD will produce binary socket_x.dat files ddd_for_fad - simple GUI able to plot FAD raw data.
File size: 1.4 KB
Line 
1#ifndef SOCKETCLIENT_H_
2#define SOCKETCLIENT_H_
3
4#include <stdlib.h>
5#include <string.h>
6#include <stdio.h>
7#include <unistd.h>
8#include <sys/socket.h>
9#include <arpa/inet.h>
10#include <netdb.h>
11#include <signal.h>
12
13#define MAX_COM_SIZE 32000
14#define IP_ADDR_LENGTH 16
15//#define IP_ADDR_DEFAULT "192.33.99.225"
16#define IP_ADDR_DEFAULT "129.217.160.119"
17
18#define FIRST_DAQPORT 5000
19
20// Commands for FAD
21#define CMD_Start 0xC000 // Start Run
22#define CMD_Stop 0x3000 // Stop Run
23#define CMD_Trigger 0xA000 // single trigger
24#define CMD_DENABLE 0x0600 // DENABLE line HIGH
25#define CMD_DDISABLE 0x0700 // DENABLE line LOW
26#define CMD_DWRITE_RUN 0x0800 // DWRITE possibly HIGH
27#define CMD_DWRITE_STOP 0x0900 // DWRITE always LOW
28#define CMD_Trigger_C 0xB000 // continous trigger
29#define CMD_Trigger_S 0x2000 // stop continous trigger
30#define CMD_Read 0x0A00 // read from Config-RAM
31#define CMD_Write 0x0500 // write to Config-RAM
32
33// Addresses in FAD Config-RAM
34#define MAX_ADDR 0xFF // highest address in Config-RAM
35#define BADDR_ROI 0x00 // Baseaddress ROI-Values
36#define BADDR_DAC 0x24 // Baseaddress DAC-Values
37
38// Max-Values
39#define MAX_VAL 65535
40#define MAX_ROINUM 35
41#define MAX_ROIVAL 1024
42#define MAX_DACNUM 7
43#define MAX_DACVAL 65535
44
45void cmd_send (char* Buffer, int Socket); // Send commands to socket
46void int_handler (int sig); // Handle signal SIGINT (CTRL-C)
47void exit_program (int exit_status); // Cleanup and exit
48
49#endif /*SOCKETCLIENT_H_*/
Note: See TracBrowser for help on using the repository browser.