Subversion Repositories f9daq

Compare Revisions

Ignore whitespace Rev 202 → Rev 203

/cvi/instr/DRS/drs4.c
1,33 → 1,54
#include <formatio.h>
#include <utility.h>
#include <ansi_c.h>
#include <cvirte.h>
#include <cvirte.h>
#include <userint.h>
#include "drs4.h"
#include "drsread.h"
#include "drsread.h"
 
#define MIKRO
 
#ifdef MIKRO
#include "MIKRO.h"
#endif
 
static int daq_on;
static int ph, plothandle[4];
static int ph, p2,plothandle[4]= {0,0,0,0};
static int tfID;
static int controlID;
 
#define MAX_THREADS 10
#define MAX_THREADS 10
 
static CmtThreadPoolHandle poolHandle = 0;
static CmtThreadPoolHandle poolHandle = 0;
 
int main (int argc, char *argv[]) {
if (InitCVIRTE (0, argv, 0) == 0)
return -1; /* out of memory */
if ((ph = LoadPanel (0, "drs4.uir", PANEL)) < 0)
return -1;
SetStdioPort (CVI_STDIO_WINDOW);
SetSleepPolicy(VAL_SLEEP_MORE);
CmtNewThreadPool (MAX_THREADS, &poolHandle);
DisplayPanel (ph);
RunUserInterface ();
DiscardPanel (ph);
CmtDiscardThreadPool (poolHandle);
return 0;
short port;
if (InitCVIRTE (0, argv, 0) == 0)
return -1; /* out of memory */
if ((ph = LoadPanel (0, "drs4.uir", PANEL)) < 0)
return -1;
if ((p2 = LoadPanel (0, "drs4.uir", SCAN)) < 0)
return -1;
SetStdioPort (CVI_STDIO_WINDOW);
SetSleepPolicy(VAL_SLEEP_MORE);
CmtNewThreadPool (MAX_THREADS, &poolHandle);
 
DisplayPanel (ph);
DisplayPanel (p2);
#ifdef MIKRO
GetCtrlVal(p2, SCAN_PORT, &port);
if (MIKRO_Open (port)) MessagePopup ("Error", "Mikro Port Not found !\n Change in the GUI") ;
MIKRO_Init(1,0);
MIKRO_Init(2,0);
#endif
RunUserInterface ();
DiscardPanel (ph);
DiscardPanel (p2);
CmtDiscardThreadPool (poolHandle);
MIKRO_Close ();
return 0;
}
 
 
35,13 → 56,13
 
 
static void start_timer (double tout) {
SetCtrlAttribute (ph, PANEL_TIMER, ATTR_INTERVAL, tout);
SetCtrlAttribute (ph, PANEL_TIMER, ATTR_ENABLED, 1);
SetCtrlAttribute (ph, PANEL_TIMER, ATTR_INTERVAL, tout);
SetCtrlAttribute (ph, PANEL_TIMER, ATTR_ENABLED, 1);
}
 
static void stop_timer ( void ) {
SetCtrlAttribute (ph, PANEL_TIMER, ATTR_ENABLED, 0);
DRSSetTimeout();
SetCtrlAttribute (ph, PANEL_TIMER, ATTR_ENABLED, 0);
DRSSetTimeout();
}
 
 
48,167 → 69,377
 
 
void CVICALLBACK EndOfThread ( CmtThreadPoolHandle poolhandle,
CmtThreadFunctionID functionID, unsigned int event,
int value, void *callbackData ) {
CmtThreadFunctionID functionID, unsigned int event,
int value, void *callbackData ) {
 
daq_on=0;
//SetDimming(0);
printf("End of Thread \n");
return ;
daq_on=0;
//SetDimming(0);
printf("End of Thread \n");
return ;
 
}
 
int CVICALLBACK daq(void *functionData) {
 
int neve;
char filename[0xff];
char smask[0xff];
unsigned long mask;
int frequency;
double trgdelay;
double trglevel;
int trgtype;
int trgchannel;
int trgpolarity;
int verbose;
double range;
GetCtrlVal(ph, PANEL_FILENAME, filename );
GetCtrlVal(ph, PANEL_MASK, smask );
mask = strtoul (smask,NULL,0);
GetCtrlVal(ph,PANEL_NEVE, &neve);
GetCtrlVal(ph,PANEL_FREQUENCY, &frequency);
GetCtrlVal(ph,PANEL_TRGDELAY, &trgdelay);
GetCtrlVal(ph,PANEL_TRGCHANNEL, &trgchannel);
GetCtrlVal(ph,PANEL_TRGTYPE, &trgtype);
GetCtrlVal(ph,PANEL_TRGLEVEL, &trglevel);
GetCtrlVal(ph,PANEL_TRGPOLARITY, &trgpolarity);
GetCtrlVal(ph,PANEL_RANGE, &range);
GetCtrlVal(ph,PANEL_DEBUG, &verbose);
printf("mask=0x%x\n",mask);
DRSSetMask( (unsigned char)( mask & 0xF ) );
DRSSetFrequency( frequency );
DRSSetTriggerPolarity(trgpolarity);
DRSSetTriggerLevel(trglevel);
DRSSetRange ( range );
DRSSetTriggerType( trgtype );
DRSSetTriggerChannel(trgchannel );
FILE *fp=fopen(filename,"wb");
static unsigned char *buffer;
int CVICALLBACK daq(void *functionData) {
 
int buffer_size = 0;
const int nBoards=1;
const int waveDepth=1024;
if (buffer_size == 0) {
buffer_size = 4 + nBoards * (4 + 4*(4+waveDepth*4));
buffer_size += 24 + nBoards * (8 + 4*(4+waveDepth*2));
buffer = (unsigned char *)malloc(buffer_size);
}
time_t t=0,told=0, tstart=0;
 
if (!DRSInit()){
time(&tstart);
told=tstart;
int i=0;
for (i=0; i<neve; i++) {
start_timer(1);// 1 s timeout
int retval = DRSRead(0);
stop_timer();
int nb = ( retval == 0 && fp ) ? DRSToBuffer( buffer , i ) : 0;
SetCtrlVal(ph,PANEL_CEVE,i);
if (retval) i--;
if (!daq_on) break;
time(&t);
if (t!=told ) {
printf("%d events in %2.2f min (%d s) %s",i+1, (double)(t-tstart)/60.,(t-tstart), ctime(&t));
}
told=t;
// Save data
if (nb>0 && fp) fwrite(buffer, 1,nb ,fp);
// Plot Data
for (int k=0;k<4;k++){
if (! (mask & ( 0x1<<k )) ) continue;
float *t=DRSGetTime(k);
float *x=DRSGetWave(k);
const int col[4]={VAL_WHITE,VAL_RED,VAL_GREEN,VAL_BLUE};
if (plothandle[k]) DeleteGraphPlot (ph, PANEL_GRAPH, plothandle[k], VAL_IMMEDIATE_DRAW);
plothandle[k] = PlotXY (ph, PANEL_GRAPH, t, x, 1024, VAL_FLOAT, VAL_FLOAT, VAL_THIN_LINE, VAL_NO_POINT, VAL_SOLID, 1, col[k]);
for (int i=0 ; i<1024 ; i++) {
if (verbose) printf("[%d] %d. x= %3.2f y=%3.2f\n", k, i, t[i], x[i] );
//h[k]->Fill( t[i], x[i]*1e-3);
}
}
int neve;
char filename[0xff];
int imask[4];
unsigned long mask;
int frequency;
double trgdelay;
double trglevel;
int trgtype;
int trgchannel;
int trgpolarity;
int verbose;
double range;
int pfreq;
int enabledoutput;
int neveold = 0;
double rate;
int *args = (int *) functionData;
GetCtrlVal(ph, PANEL_FILENAME, filename );
GetCtrlVal(ph, PANEL_CH0, &imask[0] );
GetCtrlVal(ph, PANEL_CH1, &imask[1] );
GetCtrlVal(ph, PANEL_CH2, &imask[2] );
GetCtrlVal(ph, PANEL_CH3, &imask[3] );
mask = 0;
for (int i=0; i<4; i++) {
if (imask[i]) mask |= (1<<i);
}
time(&t);
printf("%d events in %2.2f min (%d s) %s",i+1, (double)(t-tstart)/60.,t-tstart, ctime(&t));
DRSEnd();
 
GetCtrlVal(ph,PANEL_NEVE, &neve);
GetCtrlVal(ph,PANEL_DEBUG, &verbose);
GetCtrlVal(ph,PANEL_PFREQ, &pfreq);
GetCtrlVal(ph,PANEL_ENABLEDOUTPUT, &enabledoutput);
 
GetCtrlVal(ph,PANEL_FREQUENCY, &frequency);
GetCtrlVal(ph,PANEL_TRGDELAY, &trgdelay);
GetCtrlVal(ph,PANEL_TRGCHANNEL, &trgchannel);
 
GetCtrlVal(ph,PANEL_TRGTYPE, &trgtype);
GetCtrlVal(ph,PANEL_TRGLEVEL, &trglevel);
GetCtrlVal(ph,PANEL_TRGPOLARITY, &trgpolarity);
GetCtrlVal(ph,PANEL_RANGE, &range);
 
 
//printf("mask=0x%x\n",mask);
 
DRSSetMask( (unsigned char)( mask & 0xF ) );
 
DRSSetFrequency( frequency );
DRSSetTriggerDelay(trgdelay );
DRSSetTriggerChannel(trgchannel );
DRSSetTriggerType( trgtype );
DRSSetTriggerLevel(trglevel);
DRSSetTriggerPolarity(trgpolarity);
 
DRSSetRange ( range );
 
 
 
FILE *fp= NULL;
 
if (enabledoutput) {
if (args[0]) fp = fopen(filename,"wb");
else fp = fopen(filename,"ab");
}
 
static unsigned char *buffer;
 
int buffer_size = 0;
const int nBoards=1;
const int waveDepth=1024;
if (buffer_size == 0) {
buffer_size = 4 + nBoards * (4 + 4*(4+waveDepth*4));
buffer_size += 24 + nBoards * (8 + 4*(4+waveDepth*2));
buffer = (unsigned char *)malloc(buffer_size);
}
 
time_t t=0,told=0, tstart=0;
 
if (!DRSInit()) {
time(&tstart);
told=tstart;
int i=0;
for (i=0; i<neve; i++) {
start_timer(1);// 1 s timeout
int retval = DRSRead(0);
stop_timer();
int nb = ( retval == 0 && fp ) ? DRSToBuffer( buffer , i ) : 0;
SetCtrlVal(ph,PANEL_CEVE,i);
if (retval) i--;
if (!daq_on) break;
time(&t);
if (t!=told ) {
rate = (i-neveold);
printf("%d events in %2.2f min (%d s) Rate %f Hz %s ",i+1, (double)(t-tstart)/60.,(t-tstart), rate , ctime(&t));
GetCtrlVal(ph,PANEL_PFREQ, &pfreq);
neveold = i;
}
told=t;
// Save data
if (nb>0 && fp) fwrite(buffer, 1,nb ,fp);
// Plot Data
if (i % pfreq == 0) for (int k=0; k<4; k++) {
if (! (mask & ( 0x1<<k )) ) continue;
float *t=DRSGetTime(k);
float *x=DRSGetWave(k);
 
const int col[4]= {VAL_WHITE,VAL_RED,VAL_GREEN,VAL_BLUE};
if (plothandle[k]) DeleteGraphPlot (ph, PANEL_GRAPH, plothandle[k], VAL_IMMEDIATE_DRAW);
plothandle[k] = PlotXY (ph, PANEL_GRAPH, t, x, 1024, VAL_FLOAT, VAL_FLOAT, VAL_THIN_LINE, VAL_NO_POINT, VAL_SOLID, 1, col[k]);
 
for (int i=0 ; i<1024 ; i++) {
if (verbose) printf("[%d] %d. x= %3.2f y=%3.2f\n", k, i, t[i], x[i] );
//h[k]->Fill( t[i], x[i]*1e-3);
}
}
 
 
}
time(&t);
printf("%d events in %2.2f min (%d s) %s",i+1, (double)(t-tstart)/60.,t-tstart, ctime(&t));
DRSEnd();
}
 
if (fp) fclose(fp);
 
free(buffer);
 
return 0;
 
}
 
if (fp) fclose(fp);
 
free(buffer);
 
return 0;
int CVICALLBACK scan(void *functionData) {
 
int dx[2];
int nx[2];
int x0[2];
int ix[2];
int size;
char buffer[12]="POSR";
int *n = (int *) &buffer[4];
char filename[0xFF];
int enabledoutput;
FILE *fp;
GetCtrlVal(ph, PANEL_FILENAME, filename );
GetCtrlVal(ph,PANEL_ENABLEDOUTPUT, &enabledoutput);
if ( GetFileInfo(filename,&size) ) {
MessagePopup ("Warning", "File exist. Remove it first or choose another file");
return 0;
}
GetCtrlVal(p2, SCAN_STEPX, &dx[0]);
GetCtrlVal(p2, SCAN_STEPY, &dx[1]);
GetCtrlVal(p2, SCAN_NSTEPSX, &nx[0]);
GetCtrlVal(p2, SCAN_NSTEPSY, &nx[1]);
GetCtrlVal(p2, SCAN_STARTX, &x0[0]);
GetCtrlVal(p2, SCAN_STARTY, &x0[1]);
for (int i=0; i<nx[0]; i++) {
 
ix[0]= x0[0]+i*dx[0];
#ifdef MIKRO
MIKRO_MoveTo(1,ix[0]);
#endif
SetCtrlVal (p2, SCAN_IX, i);
for (int j=0; j<nx[1]; j++) {
SetCtrlVal (p2, SCAN_IY, j);
 
ix[1]= x0[1]+j*dx[1];
#ifdef MIKRO
MIKRO_MoveTo(2,ix[1]);
 
MIKRO_GetPosition(1,&n[0]);
SetCtrlVal (p2, SCAN_XP, n[0]);
MIKRO_GetPosition(2,&n[1]);
SetCtrlVal (p2, SCAN_YP, n[1]);
if (enabledoutput) {
fp = fopen(filename,"ab");
if (fp) {
fwrite(buffer, 1,12 ,fp);
fclose(fp);
}
}
#endif
daq(functionData);
if (!daq_on) break;
}
if (!daq_on) break;
}
 
return 0;
}
 
 
int CVICALLBACK StartCB (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2) {
ThreadFunctionPtr mythread = NULL;
switch (event) {
case EVENT_COMMIT:
mythread = daq;
if (mythread!=NULL) {
printf("New Thread panel=%d button=%d\n", panel, control);
// SetDimming(1);
controlID= control;
daq_on=1;
CmtScheduleThreadPoolFunctionAdv (poolHandle, mythread, &controlID,
DEFAULT_THREAD_PRIORITY,
EndOfThread,
EVENT_TP_THREAD_FUNCTION_END,
NULL, RUN_IN_SCHEDULED_THREAD,
&tfID);
}
break;
}
return 0;
void *callbackData, int eventData1, int eventData2) {
ThreadFunctionPtr mythread = NULL;
switch (event) {
 
case EVENT_COMMIT:
 
controlID=0;
if (panel == ph && control == PANEL_START) {
mythread = daq;
controlID= control;
}
if (panel == p2 && control == SCAN_SCAN) mythread = scan;
if (mythread!=NULL) {
printf("New Thread panel=%d button=%d\n", panel, control);
 
// SetDimming(1);
 
daq_on=1;
CmtScheduleThreadPoolFunctionAdv (poolHandle, mythread, &controlID,
DEFAULT_THREAD_PRIORITY,
EndOfThread,
EVENT_TP_THREAD_FUNCTION_END,
NULL, RUN_IN_SCHEDULED_THREAD,
&tfID);
}
break;
}
return 0;
}
 
int CVICALLBACK StopCB (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2) {
switch (event) {
case EVENT_COMMIT:
daq_on=0;
break;
}
return 0;
void *callbackData, int eventData1, int eventData2) {
switch (event) {
case EVENT_COMMIT:
daq_on=0;
break;
}
return 0;
}
 
int CVICALLBACK ExitCB (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2) {
switch (event) {
case EVENT_COMMIT:
QuitUserInterface (0);
break;
}
return 0;
void *callbackData, int eventData1, int eventData2) {
switch (event) {
case EVENT_COMMIT:
QuitUserInterface (0);
break;
}
return 0;
}
 
int CVICALLBACK MoveStageCB (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2) {
int axis=0, step=1000, direction=1, n;
switch (event) {
case EVENT_COMMIT:
 
if (panel == p2) {
switch (control) {
case SCAN_BR :
axis = 1;
direction = 1;
GetCtrlVal(p2, SCAN_STEPX, &step);
break;
case SCAN_BL :
axis = 1;
direction = -1;
GetCtrlVal(p2, SCAN_STEPX, &step);
break;
case SCAN_BU :
axis = 2;
direction = 1;
GetCtrlVal(p2, SCAN_STEPY, &step);
break;
case SCAN_BD :
axis = 2;
direction = -1;
GetCtrlVal(p2, SCAN_STEPY, &step);
break;
}
#ifdef MIKRO
MIKRO_MoveFor(axis, direction*step );
MIKRO_GetPosition(axis,&n);
if (axis == 1) SetCtrlVal (p2, SCAN_XP, n);
if (axis == 2) SetCtrlVal (p2, SCAN_YP, n);
#endif // MIKRO
}
 
break;
}
return 0;
}
 
 
 
 
 
int CVICALLBACK GoXCB (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2) {
int n2;
switch (event) {
case EVENT_COMMIT:
GetCtrlVal (p2, SCAN_XG, &n2);
#ifdef MIKRO
MIKRO_MoveTo(1,n2);
MIKRO_GetPosition(1,&n2);
#endif
SetCtrlVal (p2, SCAN_XP, n2);
break;
}
return 0;
}
 
int CVICALLBACK GoYCB (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2) {
int n2;
switch (event) {
case EVENT_COMMIT:
GetCtrlVal (p2, SCAN_YG, &n2);
#ifdef MIKRO
MIKRO_MoveTo(2,n2);
MIKRO_GetPosition(2,&n2);
#endif
SetCtrlVal (p2, SCAN_YP, n2);
break;
}
return 0;
}
 
int CVICALLBACK GetCurrentPositionCB (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2) {
int n[2];
switch (event) {
case EVENT_COMMIT:
#ifdef MIKRO
MIKRO_GetPosition(1,&n[0]);
SetCtrlVal (p2, SCAN_XP, n[0]);
MIKRO_GetPosition(2,&n[1]);
SetCtrlVal (p2, SCAN_YP, n[1]);
#endif
break;
}
return 0;
}
 
int CVICALLBACK HomeCB (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2) {
switch (event) {
case EVENT_COMMIT:
#ifdef MIKRO
MIKRO_ReferenceMove(1);
MIKRO_ReferenceMove(2);
GetCurrentPositionCB(panel, control, event, NULL, 0, 0);
#endif
break;
}
return 0;
}
/cvi/instr/DRS/drs4.cws
13,11 → 13,11
Active Project = 1
Project 0001 = "drs4.prj"
Drag Bar Left = 280
Window Top = 104
Window Left = 58
Window Bottom = 926
Window Right = 1507
Maximized = False
Window Top = 174
Window Left = 105
Window Bottom = 996
Window Right = 1554
Maximized = True
Maximized Children = True
Max32 Number Of Errors = 20
Track Include File Dependencies = True
30,7 → 30,7
Hide Windows = False
Break At First Statement = False
Sort Type = "File Name"
Number of Opened Files = 3
Number of Opened Files = 8
Window Confinement Region Enabled = True
MainColumnWidth = 263
FileDateColumnWidth = 70
46,46 → 46,108
Batch Build Debug = False
 
[File 0001]
Path = "/c/home/dania/mcppmt/drs/drs.C"
Path = "/c/home/cvi/instr/MIKRO/MIKRO.fp"
File Type = "Function Panel"
Disk Date = 3555477334
In Projects = "1,"
 
[File 0002]
Path = "/c/home/dania/mcppmt/drs/TwoGaussian.C"
File Type = "CSource"
Disk Date = 3566552053
Disk Date = 3566801135
In Projects = ""
Window Top = 33
Window Left = 10
Window Z-Order = 3
Source Window State = "1,64,70,70,23,25,25,0,0,80,0,0,0,0,0,25,64,0,80,19,349,683,1,0,"
Window Z-Order = 8
Source Window State = "1,5,5,5,19,20,19,0,3,80,0,0,0,0,0,25,0,0,5,20,349,683,1,0,"
 
[File 0002]
[File 0003]
Path = "/c/home/rok/DRS/drs4.uir"
File Type = "User Interface Resource"
Disk Date = 3566560516
Disk Date = 3566811789
In Projects = "1,"
Window Top = 132
Window Left = 49
Window Height = 349
Window Width = 811
Window Z-Order = 1
Window Z-Order = 4
 
[File 0003]
[File 0004]
Path = "/c/home/rok/DRS/drs4.c"
File Type = "CSource"
Disk Date = 3566560308
Disk Date = 3566812196
In Projects = "1,"
Window Top = 522
Window Left = 247
Window Z-Order = 2
Source Window State = "1,145,145,145,28,95,95,0,0,80,0,2,0,2,0,25,110,0,144,48,349,683,1,0,"
Window Z-Order = 1
Source Window State = "1,128,128,128,10,14,14,0,0,170,0,3,0,3,0,39,109,0,128,4,349,683,1,0,"
 
[File 0004]
[File 0005]
Path = "/c/home/rok/DRS/drsread.lib"
File Type = "Library"
Disk Date = 3566543748
Disk Date = 3566804135
In Projects = "1,"
 
[File 0006]
Path = "/c/home/cvi/instr/MIKRO/MIKRO.c"
File Type = "CSource"
Disk Date = 3555477334
In Projects = ""
Window Top = 405
Window Left = 202
Window Z-Order = 6
Source Window State = "1,367,368,368,0,0,0,0,3,80,0,0,0,0,0,25,339,0,367,20,349,683,1,0,"
 
[File 0007]
Path = "/c/home/cvi/instr/MIKRO/MIKRO_ui.uir"
File Type = "User Interface Resource"
Disk Date = 3558584602
In Projects = ""
Window Top = 188
Window Left = 90
Window Height = 349
Window Width = 683
Window Z-Order = 7
 
[File 0008]
Path = "/c/home/rok/DRS/drs4.h"
File Type = "Include"
Disk Date = 3566811790
In Projects = ""
Window Top = 157
Window Left = 74
Window Z-Order = 5
Source Window State = "1,0,0,0,0,0,0,0,0,80,0,0,0,0,0,25,62,0,75,17,349,683,1,0,"
 
[File 0009]
Path = "/c/home/git/arich/daq/sa02_daq/cvi/sa02_CVI.c"
File Type = "CSource"
Disk Date = 3556593867
In Projects = ""
Window Top = 188
Window Left = 90
Window Z-Order = 3
Source Window State = "1,4397,4397,4397,10,89,10,0,3,80,0,0,0,0,0,25,4378,0,4397,89,349,683,1,0,"
 
[File 0010]
Path = "/c/home/git/arich/daq/sa02_daq/sa02lib.c"
File Type = "CSource"
Disk Date = 3556593867
In Projects = ""
Window Top = 33
Window Left = 10
Window Z-Order = 2
Source Window State = "1,0,0,0,0,0,0,0,0,80,0,0,0,0,0,25,0,0,26,39,349,683,1,0,"
 
[Tab Order]
Tab 0001 = "/c/home/dania/mcppmt/drs/drs.C"
Tab 0002 = "/c/home/rok/DRS/drs4.c"
Tab 0003 = "/c/home/rok/DRS/drs4.uir"
Tab 0001 = "/c/home/dania/mcppmt/drs/TwoGaussian.C"
Tab 0002 = "/c/home/rok/DRS/drs4.uir"
Tab 0003 = "/c/home/rok/DRS/drs4.c"
Tab 0004 = "/c/home/cvi/instr/MIKRO/MIKRO_ui.uir"
Tab 0005 = "/c/home/cvi/instr/MIKRO/MIKRO.c"
Tab 0006 = "/c/home/rok/DRS/drs4.h"
Tab 0007 = "/c/home/git/arich/daq/sa02_daq/cvi/sa02_CVI.c"
Tab 0008 = "/c/home/git/arich/daq/sa02_daq/sa02lib.c"
 
[Default Build Config 0001 Debug]
Generate Browse Info = True
/cvi/instr/DRS/drs4.h
14,25 → 14,55
/* Panels and Controls: */
 
#define PANEL 1
#define PANEL_Exit 2 /* control type: command, callback function: ExitCB */
#define PANEL_EXIT 2 /* control type: command, callback function: ExitCB */
#define PANEL_STOP 3 /* control type: command, callback function: StopCB */
#define PANEL_START 4 /* control type: command, callback function: StartCB */
#define PANEL_TRGTYPE 5 /* control type: numeric, callback function: (none) */
#define PANEL_TRGLEVEL 6 /* control type: numeric, callback function: (none) */
#define PANEL_TRGDELAY 7 /* control type: numeric, callback function: (none) */
#define PANEL_RANGE 8 /* control type: numeric, callback function: (none) */
#define PANEL_TRGCHANNEL 9 /* control type: numeric, callback function: (none) */
#define PANEL_CEVE 10 /* control type: numeric, callback function: (none) */
#define PANEL_NEVE 11 /* control type: numeric, callback function: (none) */
#define PANEL_FILENAME 5 /* control type: string, callback function: (none) */
#define PANEL_TIMER 6 /* control type: timer, callback function: (none) */
#define PANEL_TRGLEVEL 7 /* control type: numeric, callback function: (none) */
#define PANEL_TRGDELAY 8 /* control type: numeric, callback function: (none) */
#define PANEL_RANGE 9 /* control type: numeric, callback function: (none) */
#define PANEL_TRGCHANNEL 10 /* control type: numeric, callback function: (none) */
#define PANEL_PFREQ 11 /* control type: numeric, callback function: (none) */
#define PANEL_FREQUENCY 12 /* control type: numeric, callback function: (none) */
#define PANEL_TRGPOLARITY 13 /* control type: binary, callback function: (none) */
#define PANEL_MASK 14 /* control type: string, callback function: (none) */
#define PANEL_FILENAME 15 /* control type: string, callback function: (none) */
#define PANEL_GRAPH 16 /* control type: graph, callback function: (none) */
#define PANEL_NEVE 13 /* control type: numeric, callback function: (none) */
#define PANEL_CEVE 14 /* control type: numeric, callback function: (none) */
#define PANEL_TRGTYPE 15 /* control type: ring, callback function: (none) */
#define PANEL_ENABLEDOUTPUT 16 /* control type: radioButton, callback function: (none) */
#define PANEL_DEBUG 17 /* control type: radioButton, callback function: (none) */
#define PANEL_TIMER 18 /* control type: timer, callback function: (none) */
#define PANEL_CH3 18 /* control type: radioButton, callback function: (none) */
#define PANEL_CH2 19 /* control type: radioButton, callback function: (none) */
#define PANEL_CH1 20 /* control type: radioButton, callback function: (none) */
#define PANEL_GRAPH 21 /* control type: graph, callback function: (none) */
#define PANEL_CH0 22 /* control type: radioButton, callback function: (none) */
#define PANEL_TRGPOLARITY 23 /* control type: binary, callback function: (none) */
#define PANEL_TEXTMSG 24 /* control type: textMsg, callback function: (none) */
 
#define SCAN 2
#define SCAN_BD 2 /* control type: command, callback function: MoveStageCB */
#define SCAN_BR 3 /* control type: command, callback function: MoveStageCB */
#define SCAN_GETPOSITION 4 /* control type: command, callback function: GetCurrentPositionCB */
#define SCAN_SCAN 5 /* control type: command, callback function: StartCB */
#define SCAN_BU 6 /* control type: command, callback function: MoveStageCB */
#define SCAN_HO 7 /* control type: command, callback function: HomeCB */
#define SCAN_BL 8 /* control type: command, callback function: MoveStageCB */
#define SCAN_XG 9 /* control type: numeric, callback function: (none) */
#define SCAN_YG 10 /* control type: numeric, callback function: (none) */
#define SCAN_IX 11 /* control type: numeric, callback function: (none) */
#define SCAN_IY 12 /* control type: numeric, callback function: (none) */
#define SCAN_NSTEPSX 13 /* control type: numeric, callback function: (none) */
#define SCAN_NSTEPSY 14 /* control type: numeric, callback function: (none) */
#define SCAN_STEPX 15 /* control type: numeric, callback function: (none) */
#define SCAN_STEPY 16 /* control type: numeric, callback function: (none) */
#define SCAN_STARTX 17 /* control type: numeric, callback function: (none) */
#define SCAN_STARTY 18 /* control type: numeric, callback function: (none) */
#define SCAN_XP 19 /* control type: numeric, callback function: (none) */
#define SCAN_YP 20 /* control type: numeric, callback function: (none) */
#define SCAN_GY 21 /* control type: command, callback function: GoYCB */
#define SCAN_GX 22 /* control type: command, callback function: GoXCB */
#define SCAN_PORT 23 /* control type: numeric, callback function: (none) */
 
 
/* Control Arrays: */
 
/* (no control arrays in the resource file) */
46,6 → 76,11
/* Callback Prototypes: */
 
int CVICALLBACK ExitCB(int panel, int control, int event, void *callbackData, int eventData1, int eventData2);
int CVICALLBACK GetCurrentPositionCB(int panel, int control, int event, void *callbackData, int eventData1, int eventData2);
int CVICALLBACK GoXCB(int panel, int control, int event, void *callbackData, int eventData1, int eventData2);
int CVICALLBACK GoYCB(int panel, int control, int event, void *callbackData, int eventData1, int eventData2);
int CVICALLBACK HomeCB(int panel, int control, int event, void *callbackData, int eventData1, int eventData2);
int CVICALLBACK MoveStageCB(int panel, int control, int event, void *callbackData, int eventData1, int eventData2);
int CVICALLBACK StartCB(int panel, int control, int event, void *callbackData, int eventData1, int eventData2);
int CVICALLBACK StopCB(int panel, int control, int event, void *callbackData, int eventData1, int eventData2);
 
/cvi/instr/DRS/drs4.prj
1,15 → 1,15
[Project Header]
Version = 1302
Pathname = "/c/Users/rok/Documents/rok/lab/drs/drsctrl/drs4.prj"
CVI Dir = "/c/program files (x86)/national instruments/cvi2013"
CVI Shared Dir = "/C/Program Files (x86)/National Instruments/Shared/CVI"
Pathname = "/c/home/rok/DRS/drs4.prj"
CVI Dir = "/c/program files/national instruments/cvi2013"
CVI Shared Dir = "/C/Program Files/National Instruments/Shared/CVI"
CVI Pub Local Dir = "/C/ProgramData/National Instruments/CVI2013"
CVI Pub Global Dir = "/C/ProgramData/National Instruments/CVI"
IVI Standard Root Dir = "/C/Program Files (x86)/IVI Foundation/IVI"
VXIplug&play Framework Dir = "/C/Program Files (x86)/IVI Foundation/VISA/winnt"
IVI Standard Root Dir = "/C/Program Files/IVI Foundation/IVI"
VXIplug&play Framework Dir = "/C/Program Files/IVI Foundation/VISA/winnt"
IVI Standard Root 64-bit Dir = "/C/Program Files/IVI Foundation/IVI"
VXIplug&play Framework 64-bit Dir = "/C/Program Files/IVI Foundation/VISA/win64"
Number of Files = 3
Number of Files = 4
Target Type = "Executable"
Flags = 2064
Copied From Locked InstrDrv Directory = False
19,7 → 19,6
 
[Folders]
Include Files Folder Not Added Yet = True
Instrument Files Folder Not Added Yet = True
Folder 0 = "User Interface Files"
FolderEx 0 = "User Interface Files"
Folder 1 = "Source Files"
26,6 → 25,8
FolderEx 1 = "Source Files"
Folder 2 = "Library Files"
FolderEx 2 = "Library Files"
Folder 3 = "Instrument Files"
FolderEx 3 = "Instrument Files"
 
[File 0001]
File Type = "User Interface Resource"
33,7 → 34,7
Path Is Rel = True
Path Rel To = "Project"
Path Rel Path = "drs4.uir"
Path = "/c/Users/rok/Documents/rok/lab/drs/drsctrl/drs4.uir"
Path = "/c/home/rok/DRS/drs4.uir"
Exclude = False
Project Flags = 0
Folder = "User Interface Files"
45,7 → 46,7
Path Is Rel = True
Path Rel To = "Project"
Path Rel Path = "drs4.c"
Path = "/c/Users/rok/Documents/rok/lab/drs/drsctrl/drs4.c"
Path = "/c/home/rok/DRS/drs4.c"
Exclude = False
Compile Into Object File = False
Project Flags = 0
58,12 → 59,24
Path Is Rel = True
Path Rel To = "Project"
Path Rel Path = "drsread.lib"
Path = "/c/Users/rok/Documents/rok/lab/drs/drsctrl/drsread.lib"
Path = "/c/home/rok/DRS/drsread.lib"
Exclude = False
Project Flags = 0
Folder = "Library Files"
Folder Id = 2
 
[File 0004]
File Type = "Function Panel"
Res Id = 4
Path Is Rel = True
Path Rel To = "Project"
Path Rel Path = "../../cvi/instr/MIKRO/MIKRO.fp"
Path = "/c/home/cvi/instr/MIKRO/MIKRO.fp"
Exclude = False
Project Flags = 0
Folder = "Instrument Files"
Folder Id = 3
 
[Custom Build Configs]
Num Custom Build Configs = 0
 
356,19 → 369,19
Executable File_Debug Is Rel = True
Executable File_Debug Rel To = "Project"
Executable File_Debug Rel Path = "drs4.exe"
Executable File_Debug = "/c/Users/rok/Documents/rok/lab/drs/drsctrl/drs4.exe"
Executable File_Debug = "/c/home/rok/DRS/drs4.exe"
Executable File_Release Is Rel = True
Executable File_Release Rel To = "Project"
Executable File_Release Rel Path = "drs4.exe"
Executable File_Release = "/c/Users/rok/Documents/rok/lab/drs/drsctrl/drs4.exe"
Executable File_Release = "/c/home/rok/DRS/drs4.exe"
Executable File_Debug64 Is Rel = True
Executable File_Debug64 Rel To = "Project"
Executable File_Debug64 Rel Path = "drs4.exe"
Executable File_Debug64 = "/c/Users/rok/Documents/rok/lab/drs/drsctrl/drs4.exe"
Executable File_Debug64 = "/c/home/rok/DRS/drs4.exe"
Executable File_Release64 Is Rel = True
Executable File_Release64 Rel To = "Project"
Executable File_Release64 Rel Path = "drs4.exe"
Executable File_Release64 = "/c/Users/rok/Documents/rok/lab/drs/drsctrl/drs4.exe"
Executable File_Release64 = "/c/home/rok/DRS/drs4.exe"
Icon File Is Rel = False
Icon File = ""
Application Title = ""
/cvi/instr/DRS/drs4.uir
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/cvi/instr/DRS/drsread.cpp
416,7 → 416,7
printf ("-v verbosity \n");
printf ("-a output rootfile \n");
printf ("-o output filename \n");
printf ("-r output root filename \n");
printf ("-r range \n");
printf ("-n number of events\n");
printf ("-m channel bit mask\n");
printf ("-h trigger type (0 software, 1 fast hardware, 2 slow hardware)\n");
/cvi/instr/DRS/drsread.dll
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/cvi/instr/DRS/drsread.lib
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream