Subversion Repositories f9daq

Compare Revisions

No changes between revisions

Ignore whitespace Rev 317 → Rev 316

/cvi/instr/DRS/usb.h
File deleted
/cvi/instr/DRS/scaler.uir
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Deleted: svn:mime-type
-application/octet-stream
\ No newline at end of property
/cvi/instr/DRS/scaler.c
File deleted
/cvi/instr/DRS/scaler.h
File deleted
/cvi/instr/DRS/xxusbdll.h
File deleted
/cvi/instr/DRS/libxxusb.dll
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Deleted: svn:mime-type
-application/octet-stream
\ No newline at end of property
/cvi/instr/DRS/drs4.c
1,4 → 1,3
#include <tcpsupp.h>
#include "H1D.h"
#include "H2D.h"
#include <formatio.h>
7,34 → 6,18
#include <cvirte.h>
#include <userint.h>
#include "drs4.h"
#include "scaler.h"
#include "drsread.h"
#include "K6517.h"
 
K6517STATUS K6517Stat;
static int K6517_Interface,K6517_Port,K6517_Gdev;
//#define MIKRO
#define MIKRO
 
#ifdef MIKRO
#include "MIKRO.h"
#endif
 
 
/*---------------------------------------------------------------------------*/
/* Module-globals */
/*---------------------------------------------------------------------------*/
static unsigned int g_hconversation;
static int g_hmainPanel;
static int g_connected = 0;
static int g_TCPError = 0;
 
 
int daq_on;
int ph, p2,p3,p4, plothandle[4]= {0,0,0,0};
static int qdcplothandle[4]= {0,0,0,0};
static int daq_on;
static int ph, p2,plothandle[4]= {0,0,0,0};
static int scanplothandle;
static int tfID;
static int rID;
static int controlID;
 
#define MAX_THREADS 10
42,13 → 25,6
static CmtThreadPoolHandle poolHandle = 0;
 
static float gSum[4]={0,0,0,0};
 
 
int gActive[4]= {0,0,0,0};
double gTwinMin[4]= {0,0,0,0};
double gTwinMax[4]= {0,0,0,0};
double gFx[4]= {0,0,0,0};
 
int main (int argc, char *argv[]) {
short port;
if (InitCVIRTE (0, argv, 0) == 0)
57,12 → 33,6
return -1;
if ((p2 = LoadPanel (0, "drs4.uir", SCAN)) < 0)
return -1;
if ((p3 = LoadPanel (0, "drs4.uir", QDC)) < 0)
return -1;
if ((p4 = LoadPanel (0, "scaler.uir", SCALER)) < 0)
return -1;
DisableBreakOnLibraryErrors();
SetStdioPort (CVI_STDIO_WINDOW);
SetSleepPolicy(VAL_SLEEP_MORE);
CmtNewThreadPool (MAX_THREADS, &poolHandle);
69,8 → 39,7
 
DisplayPanel (ph);
DisplayPanel (p2);
DisplayPanel (p3);
DisplayPanel (p4);
#ifdef MIKRO
GetCtrlVal(p2, SCAN_PORT, &port);
if (MIKRO_Open (port)) MessagePopup ("Error", "Mikro Port Not found !\n Change in the GUI") ;
78,17 → 47,11
MIKRO_Init(2,0);
#endif
K6517_open (1,4,3,0,13);
RunUserInterface ();
DiscardPanel (ph);
DiscardPanel (p2);
DiscardPanel (p3);
DiscardPanel (p4);
CmtDiscardThreadPool (poolHandle);
#ifdef MIKRO
MIKRO_Close ();
#endif
MIKRO_Close ();
return 0;
}
 
129,14 → 92,7
 
 
 
void CVICALLBACK EndOfThresholdScanThread ( CmtThreadPoolHandle poolhandle,
CmtThreadFunctionID functionID, unsigned int event,
int value, void *callbackData ) {
printf("End of Threshold Scan Thread \n");
return ;
 
}
 
void CVICALLBACK EndOfThread ( CmtThreadPoolHandle poolhandle,
CmtThreadFunctionID functionID, unsigned int event,
int value, void *callbackData ) {
150,7 → 106,6
 
 
static float xs[4][1024];
 
int CVICALLBACK daq(void *functionData) {
 
 
171,28 → 126,20
int neveold = 0;
double rate;
int *args = (int *) functionData;
double twin[2];
 
int wfm=0;
const int init[4] = { QDC_INIT_1 ,QDC_INIT_2 ,QDC_INIT_3 ,QDC_INIT_4 };
const int fx[4] = { PANEL_SCALE_1 ,PANEL_SCALE_2 ,PANEL_SCALE_3 ,PANEL_SCALE_4 };
const int active[4] = { QDC_ACTIVE_1 ,QDC_ACTIVE_2 ,QDC_ACTIVE_3 ,QDC_ACTIVE_4 };
 
GetCtrlVal(ph, PANEL_CH0, &imask[0] );
GetCtrlVal(ph, PANEL_CH1, &imask[1] );
GetCtrlVal(ph, PANEL_CH2, &imask[2] );
GetCtrlVal(ph, PANEL_CH3, &imask[3] );
GetCtrlVal(p3, QDC_WFM, &wfm );
mask = 0;
for (int i=0; i<4; i++) {
if (imask[i]) {
mask |= (1<<i);
ScaleCB(ph,fx[i],EVENT_COMMIT,NULL, 0,0);
SetActiveCB(p3,active[i],EVENT_COMMIT,NULL, 0,0);
InitQdcHistogramCB(p3, init[i],EVENT_COMMIT,NULL, 0,0);
}
if (imask[i]) mask |= (1<<i);
}
LogScaleCB(p3, QDC_LOGY,EVENT_COMMIT,NULL, 0,0);
 
 
GetCtrlVal(ph,PANEL_NEVE, &neve);
GetCtrlVal(ph,PANEL_DEBUG, &verbose);
209,7 → 156,8
GetCtrlVal(ph,PANEL_TRGPOLARITY, &trgpolarity);
GetCtrlVal(ph,PANEL_RANGE, &range);
 
GetCtrlVal(ph,PANEL_TWIN0, &twin[0]);
GetCtrlVal(ph,PANEL_TWIN1, &twin[1]);
//printf("mask=0x%x\n",mask);
 
DRSSetMask( (unsigned char)( mask & 0xF ) );
228,14 → 176,12
FILE *fp= NULL;
 
if (enabledoutput) {
if (1==1) {
if (args[0]) {
GetCtrlVal(ph, PANEL_FILENAME, filename );
printf("%s\n", filename);
fp = fopen(filename,"wb");
} else {
GetCtrlVal(p2, SCAN_FILENAME, filename );
fp = fopen(filename,"ab");
printf("%s\n", filename);
}
}
 
273,7 → 219,6
if (!daq_on) break;
time(&t);
if (t!=told ) {
PlotQdcHistogramCB(0,0,EVENT_COMMIT,NULL, 0,0);
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);
281,37 → 226,23
}
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 )) ){
double fSum= 0;
float *t=DRSGetTime(k);
float *x=DRSGetWave(k);
;
for (int j=0 ; j<1024 ; j++) {
xs[k][j]= x[j]*1e-3*gFx[k];
if (gActive[k]){
if (t[j]> gTwinMin[k] && t[j] < gTwinMax[k]) {
fSum+= fabs(xs[k][j]);
}
if (wfm){
H2D_Fill(200+k,t[j], xs[k][j],1);
}
//if (verbose) printf("[%d] %d. x= %3.2f y=%3.2f\n", k, i, t[j], x[j] );
}
xs[k][j]= x[j]*1e-3;
if (t[j]> twin[0] && t[j] < twin[1]) gSum[k]+= fabs(xs[k][j]);
if (verbose) printf("[%d] %d. x= %3.2f y=%3.2f\n", k, i, t[j], x[j] );
//h[k]->Fill( t[i], x[i]*1e-3);
}
if (verbose) printf("qdc[%d] %3.2f active=%d\n", k, fSum ,gActive[k]);
if (gActive[k]) {
if (!wfm) {
H1D_Fill(200+k,fSum,1.);
}
}
gSum[k]+=fSum;
 
if (i % pfreq == 0) {
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, xs[k], 1024, VAL_FLOAT, VAL_FLOAT, VAL_THIN_LINE, VAL_NO_POINT, VAL_SOLID, 1, col[k]);
336,271 → 267,7
}
 
 
void CVICALLBACK EndOfThrScan ( CmtThreadPoolHandle poolhandle,
CmtThreadFunctionID functionID, unsigned int event,
int value, void *callbackData ) {
 
 
//SetDimming(0);
printf("End of thrscan \n");
return ;
 
}
 
 
 
int scaler(int min, int max, int dx, int time_set, char *filename);
 
int CVICALLBACK thrscan(void *functionData) {
char str[0xFF];
char path[0xFF];
int step,min,max, mtime;
GetCtrlVal(p4, SCALER_STEP,&step);
GetCtrlVal(p4, SCALER_TIME,&mtime);
GetCtrlVal(p4, SCALER_MAX,&max);
GetCtrlVal(p4, SCALER_MIN,&min);
GetCtrlVal(ph, PANEL_FILENAME,path);
sprintf(str, "%s.thr", path);
scaler(min,max,step,mtime,str);
return 0;
}
 
 
int CVICALLBACK acquire_data (void *arg) {
char *sarg = (char *) arg;
printf("sarg %s\n", sarg);
char str[0xFF];
char path[0xFF];
GetCtrlVal(ph,PANEL_PATH,path);
sprintf(str, "%s%s.dat", path, sarg);
SetCtrlVal(ph, PANEL_FILENAME,str);
int flag=0;
ThreadFunctionPtr mythread = thrscan;
int data;
int threadhandle;
CmtScheduleThreadPoolFunctionAdv (poolHandle, mythread, &data,
DEFAULT_THREAD_PRIORITY,
EndOfThresholdScanThread,
EVENT_TP_THREAD_FUNCTION_END,
NULL, RUN_IN_SCHEDULED_THREAD,
&threadhandle);
daq(&flag);
CmtWaitForThreadPoolFunctionCompletionEx (poolHandle, threadhandle, OPT_TP_PROCESS_EVENTS_WHILE_WAITING, CMT_WAIT_FOREVER);
return 0;
}
 
int CVICALLBACK SwitchOnOffCB (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{
unsigned char state;
switch (event)
{
case EVENT_COMMIT:
GetCtrlVal(panel, control, &state);
K6517_vsource_operate (state);
break;
}
return 0;
}
 
 
int CVICALLBACK SetVoltageCB (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2) {
double vbr;
switch (event) {
case EVENT_COMMIT:
GetCtrlVal (ph, PANEL_VBR, &vbr );
K6517_vsource_set (vbr+2);
break;
}
return 0;
}
 
 
 
int TScan () {
 
double temp;
double volt,vbr;
int n=0;
int led;
GetNumTableRows (ph, PANEL_TABLE, &n );
daq_on = 1;
for(int i=0; i<n; i++) {
if (!daq_on) break;
GetTableCellVal (ph, PANEL_TABLE, MakePoint (1,i+1), &temp);
GetTableCellVal (ph, PANEL_TABLE, MakePoint (2,i+1), &vbr);
if (temp>100) break;
char transmitBuf[512]= {0};
sprintf(transmitBuf, "1 %f\n", temp);
if (g_connected)
if ( ClientTCPWrite (g_hconversation, transmitBuf, strlen (transmitBuf), 1000) < 0) printf("Transmit Error\n"); else printf("%s\n", transmitBuf);
SetCtrlVal(ph,PANEL_LED, 0);
do {
time_t t0 = time(NULL);
SetCtrlVal(ph,PANEL_TIME, ctime(&t0));
Delay(1);
GetCtrlVal(ph,PANEL_LED, &led);
if (led) {
for (int k=0;k<10;k++){
Delay(1);
if (!daq_on) break;
}
GetCtrlVal(ph,PANEL_LED, &led);
}
if (!daq_on) break;
} while (!led);
if (!daq_on) break;
int itemp = (int) temp;
int n1=0;
GetNumTableRows (ph, PANEL_VTABLE, &n1 );
for(int k=0; k<n1; k++) {
if (!daq_on) break;
GetTableCellVal (ph, PANEL_VTABLE, MakePoint (1,k+1), &volt);
if (volt<-100) break;
double voltage = vbr + volt;
int ivolt=(int)(volt*100);
K6517_vsource_set (voltage);
K6517_vsource_operate (1);
char str[0xFF];
sprintf(str,"%d_%d", itemp, ivolt);
printf("%d %d %s\n",i,k, str);
acquire_data(str);
K6517_vsource_operate (0);
}
}
 
return 0;
}
int CVICALLBACK TScanCB (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2) {
 
switch (event) {
case EVENT_COMMIT:{
ThreadFunctionPtr mythread = TScan;
CmtScheduleThreadPoolFunctionAdv (poolHandle, mythread, &rID,
DEFAULT_THREAD_PRIORITY,
EndOfThread,
EVENT_TP_THREAD_FUNCTION_END,
NULL, RUN_IN_SCHEDULED_THREAD,
&tfID);
}
break;
}
return 0;
}
 
int CVICALLBACK LogScaleCB (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2) {
const unsigned int gr[4] = { QDC_GRAPH_1 ,QDC_GRAPH_2 ,QDC_GRAPH_3 ,QDC_GRAPH_4 };
int wfm=0;
int attr, logy, selected;
switch (event) {
case EVENT_COMMIT:
GetCtrlVal(p3,QDC_WFM,&wfm);
GetCtrlVal(panel, control, &selected);
attr= ATTR_YMAP_MODE;
if(selected) logy=VAL_LOG; else logy=VAL_LINEAR;
if (wfm) logy=VAL_LINEAR;
for (int i=0;i<4;i++) SetCtrlAttribute (panel, gr[i],attr, logy);
break;
}
return 0;
}
 
int CVICALLBACK ExecRootCB (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2) {
switch (event) {
case EVENT_COMMIT:{
char fileName[100];
char fname[100];
char path[100];
int trgchannel;
GetCtrlVal(panel, PANEL_FILENAME, fileName);
GetCtrlVal(panel,PANEL_TRGCHANNEL, &trgchannel);
GetCtrlVal(panel, PANEL_PATH, path);
sprintf(fname, "%s/%s", path, fileName);
//sprintf(fname, "%s", fileName);
int status;
char name[MAX_PATHNAME_LEN];
// char dfile[MAX_PATHNAME_LEN];
// char efile[MAX_PATHNAME_LEN];
// status = FileSelectPopup ("dat", "*.dat", ".dat",
// "Izberi datoteko s podatki",
// VAL_LOAD_BUTTON, 0, 0, 1, 0, efile);
// EscapeString(efile,dfile);
sprintf(name ,"C:/home/dominik/runroot.bat \"C:/home/dominik/AnalyseWaveForms.cxx(-1,1000,\\\"%s\\\",%d)\" ", fname, trgchannel);
 
printf("%s\n",name);
LaunchExecutable(name);
break;
}
}
return 0;
}
 
 
int CVICALLBACK TempTableCB (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2) {
switch (event) {
case EVENT_COMMIT: {
int status;
char name[MAX_PATHNAME_LEN];
char dfile[MAX_PATHNAME_LEN];
char efile[MAX_PATHNAME_LEN];
status = FileSelectPopup ("dat", "*.dat", ".dat",
"Izberi datoteko s podatki",
VAL_LOAD_BUTTON, 0, 0, 1, 0, efile);
printf("%s", efile);
 
 
FILE *fp=fopen(efile,"r");
float I;
float V;
int temp;
int ndim=400;
char line[400];
if (fp) {
int k=0;
while (fgets(line,ndim,fp)!=NULL) {
k++;
sscanf(line,"%*s%d%f%f",&temp,&I,&V);
printf("%d %f %f\n", temp, I, V);
SetTableCellVal (ph, PANEL_TABLE, MakePoint (1,k), (double)temp);
SetTableCellVal (ph, PANEL_TABLE, MakePoint (2,k), V);
}
 
SetTableCellVal (ph, PANEL_TABLE, MakePoint (1,k+1), 1000.0);
fclose(fp);
 
 
}
break;
}
}
return 0;
}
 
 
 
 
int CVICALLBACK scan(void *functionData) {
 
int dx[3]={0,0,0};
705,8 → 372,6
}
 
 
 
 
int CVICALLBACK StartCB (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2) {
ThreadFunctionPtr mythread = NULL;
720,12 → 385,6
controlID= control;
}
if (panel == p2 && control == SCAN_SCAN) mythread = scan;
if (panel == p4 && control == SCALER_START) mythread = thrscan;
if (panel == ph && control == PANEL_ACQUIRE) {
mythread = acquire_data;
controlID=50;
}
if (mythread!=NULL) {
printf("New Thread panel=%d button=%d\n", panel, control);
 
875,61 → 534,6
return 0;
}
 
int CVICALLBACK InitQdcHistogramCB (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2) {
const int min[4] = { QDC_MIN_1 ,QDC_MIN_2 ,QDC_MIN_3 ,QDC_MIN_4 };
const int max[4] = { QDC_MAX_1 ,QDC_MAX_2 ,QDC_MAX_3 ,QDC_MAX_4 };
const int nbin[4] = { QDC_NBIN_1 ,QDC_NBIN_2 ,QDC_NBIN_3 ,QDC_NBIN_4 };
const int init[4] = { QDC_INIT_1 ,QDC_INIT_2 ,QDC_INIT_3 ,QDC_INIT_4 };
char title[0xFF];
char name[0xFF];
switch (event) {
case EVENT_COMMIT:{
int ctrl=-1;
for (int k=0;k<4;k++) if ( init[k]==control & panel==p3 ) ctrl=k;
if (ctrl<0) break;
double minx;
double maxx;
int nbins;
int wfm;
int frq;
GetCtrlVal(p3,min[ctrl],&minx);
GetCtrlVal(p3,max[ctrl],&maxx);
GetCtrlVal(p3,nbin[ctrl],&nbins);
GetCtrlVal(p3,QDC_WFM,&wfm);
GetCtrlVal(ph,PANEL_FREQUENCY,&frq);
sprintf(name,"qdc%d", ctrl);
sprintf(title,"QDC ch %d", ctrl);
H1D_Init(200+ctrl, name, title, nbins, minx,maxx);
sprintf(name,"avgwfm%d", ctrl);
sprintf(title,"Average waveform ch %d", ctrl);
H2D_Init(200+ctrl, name, title, 1024, 0,1024/frq, 100, -0.5,0.5);
break;
}
}
return 0;
 
}
 
 
int CVICALLBACK PlotQdcHistogramCB (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2) {
int hid=0;
int nx;
int ny;
const unsigned int gr[4] = { QDC_GRAPH_1 ,QDC_GRAPH_2 ,QDC_GRAPH_3 ,QDC_GRAPH_4 };
int wfm=0;
switch (event) {
case EVENT_COMMIT:
GetCtrlVal(p3,QDC_WFM,&wfm);
for (int i=0;i<4;i++) if (wfm) H2D_Draw(200+i,p3,gr[i],&qdcplothandle[i]); else H1D_Draw(200+i,p3,gr[i],&qdcplothandle[i]);
break;
}
return 0;
}
 
 
int CVICALLBACK PlotScanHistogramCB (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2) {
int hid=0;
969,19 → 573,6
return 0;
}
 
 
int CVICALLBACK OpenQdcCB (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2) {
switch (event) {
case EVENT_COMMIT:
DisplayPanel (ph);
DisplayPanel (p3);
break;
}
return 0;
}
 
 
int CVICALLBACK CalibrateCB (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2) {
int status = 0;
993,162 → 584,3
}
return 0;
}
 
int CVICALLBACK SetActiveCB (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2) {
const int c[4] = { QDC_ACTIVE_1 ,QDC_ACTIVE_2 ,QDC_ACTIVE_3 ,QDC_ACTIVE_4 };
const double twin0[4] = { QDC_TWIN0_1 ,QDC_TWIN0_2 ,QDC_TWIN0_3 ,QDC_TWIN0_4 };
const double twin1[4] = { QDC_TWIN1_1 ,QDC_TWIN1_2 ,QDC_TWIN1_3 ,QDC_TWIN1_4 };
int val=0;
switch (event) {
case EVENT_COMMIT:
GetCtrlVal(panel, control, &val);
int ctrl=-1;
for (int k=0;k<4;k++) if ( c[k]==control & panel==p3 ) ctrl=k;
if (ctrl<0) break;
gActive[ctrl] = val;
GetCtrlVal(panel, twin0[ctrl], &gTwinMin[ctrl]);
GetCtrlVal(panel, twin1[ctrl], &gTwinMax[ctrl]);
printf("Channel gActive[%d]=%d tmin %f tmax %f\n", ctrl,gActive[ctrl], gTwinMin[ctrl], gTwinMax[ctrl]);
break;
}
return 0;
}
 
int CVICALLBACK ScaleCB (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2) {
const int c[4] = { PANEL_SCALE_1 ,PANEL_SCALE_2 ,PANEL_SCALE_3 ,PANEL_SCALE_4 };
switch (event) {
case EVENT_COMMIT: {
double val;
GetCtrlVal(panel, control, &val);
int ctrl=-1;
for (int k=0;k<4;k++) if ( c[k]==control & panel==ph ) ctrl=k;
if (ctrl<0) break;
gFx[ctrl] = val;
printf("Scaling factor gFx[%d]=%f\n", ctrl,gFx[ctrl]);
break;
}
}
return 0;
}
 
 
 
 
/*---------------------------------------------------------------------------*/
/* Macros */
/*---------------------------------------------------------------------------*/
#define tcpChk(f) if ((g_TCPError=(f)) < 0) {ReportTCPError();}
 
 
/*---------------------------------------------------------------------------*/
/* Internal function prototypes */
/*---------------------------------------------------------------------------*/
int CVICALLBACK ClientTCPCB (unsigned handle, int event, int error,
void *callbackData);
static void ReportTCPError (void);
 
 
/*---------------------------------------------------------------------------*/
/* Report TCP Errors if any */
/*---------------------------------------------------------------------------*/
static void ReportTCPError(void)
{
if (g_TCPError < 0)
{
char messageBuffer[1024];
sprintf(messageBuffer,
"TCP library error message: %s\nSystem error message: %s",
GetTCPErrorString (g_TCPError), GetTCPSystemErrorString());
MessagePopup ("Error", messageBuffer);
g_TCPError = 0;
}
}
/*---------------------------------------------------------------------------*/
 
 
int CVICALLBACK DisconnectCB (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2) {
switch (event) {
case EVENT_COMMIT:
if (g_connected)
DisconnectFromTCPServer (g_hconversation);
g_hconversation = 0;
g_connected = 0;
break;
}
return 0;
}
 
int CVICALLBACK ConnectCB (int panel, int control, int event, void *callbackData, int eventData1, int eventData2) {
int portNum=10000;
char tempBuf[512];
sprintf(tempBuf,"localhost");
switch (event) {
case EVENT_COMMIT:
if (g_connected) return 0;
if (ConnectToTCPServer (&g_hconversation, portNum, tempBuf, ClientTCPCB, NULL, 5000) < 0)
MessagePopup("TCP Client", "Connection to server failed !");
else
{
SetWaitCursor (0);
g_connected = 1;
/* We are successfully connected -- gather info */
if (GetTCPHostAddr (tempBuf, 256) >= 0) printf("%s\n" ,tempBuf);
if (GetTCPHostName (tempBuf, 256) >= 0) printf("%s\n" ,tempBuf);
tcpChk (GetTCPPeerAddr (g_hconversation, tempBuf, 256));
printf("%s\n" ,tempBuf);
tcpChk (GetTCPPeerName (g_hconversation, tempBuf, 256));
printf("%s\n" ,tempBuf);
}
break;
}
return 0;
}
 
 
int CVICALLBACK ClientTCPCB (unsigned handle, int event, int error, void *callbackData)
{
char receiveBuf[256] = {0};
ssize_t dataSize = sizeof (receiveBuf) - 1;
 
switch (event)
{
case TCP_DATAREADY:
if ((dataSize = ClientTCPRead (g_hconversation, receiveBuf,
dataSize, 1000))
< 0)
{
printf( "Receive Error\n");
}
else
{
receiveBuf[dataSize] = '\0';
//printf("%s", receiveBuf);
float temp = 0;
float humidity = 0;
float dt=0;
float tdiff=0;
int t0 = 0;
sscanf(receiveBuf, "%d%f%f%f%f", &t0,&humidity,&temp, &tdiff, &dt);
SetCtrlVal(ph,PANEL_TMON, temp);
SetCtrlVal(ph,PANEL_HUMIDITY, humidity);
if (fabs(tdiff)<0.2 && fabs(dt) < 0.05) SetCtrlVal(ph,PANEL_LED, 1);
else SetCtrlVal(ph,PANEL_LED, 0);
}
break;
case TCP_DISCONNECT:
MessagePopup ("TCP Client", "Server has closed connection!");
g_connected = 0;
break;
}
return 0;
}
/cvi/instr/DRS/drs4.cws
1,6 → 1,6
[Workspace Header]
Version = 1302
Pathname = "/c/home/CVI/instr/DRS/drs4.cws"
Pathname = "/c/home/rok/DRS/drs4.cws"
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"
9,16 → 9,15
IVI Standard Root 64-bit Dir = "/C/Program Files/IVI Foundation/IVI"
VXIplug&play Framework Dir = "/C/Program Files/IVI Foundation/VISA/winnt"
VXIplug&play Framework 64-bit Dir = "/C/Program Files/IVI Foundation/VISA/win64"
Number of Projects = 2
Number of Projects = 1
Active Project = 1
Project 0001 = "drs4.prj"
Project 0002 = "/c/home/CVI/apps/TempCtrl/TempCtrl.prj"
Drag Bar Left = 245
Window Top = 65
Window Left = 31
Window Bottom = 795
Window Right = 1432
Maximized = False
Drag Bar Left = 280
Window Top = 31
Window Left = 105
Window Bottom = 853
Window Right = 1554
Maximized = True
Maximized Children = True
Max32 Number Of Errors = 20
Track Include File Dependencies = True
31,9 → 30,9
Hide Windows = False
Break At First Statement = False
Sort Type = "File Name"
Number of Opened Files = 15
Number of Opened Files = 3
Window Confinement Region Enabled = True
MainColumnWidth = 228
MainColumnWidth = 263
FileDateColumnWidth = 70
FileSizeColumnWidth = 70
 
46,227 → 45,65
Batch Build Release = False
Batch Build Debug = False
 
[Project Header 0002]
Version = 1302
Don't Update DistKit = False
Platform Code = 4
Build Configuration = "Debug"
Warn User If Debugging Release = 1
Batch Build Release = False
Batch Build Debug = False
 
[File 0001]
Path = "/c/home/CVI/instr/HISTO/H1D.fp"
Path = "/c/home/cvi/instr/HISTO/H1D.fp"
File Type = "Function Panel"
Disk Date = 3568705022
Disk Date = 3568268329
In Projects = "1,"
 
[File 0002]
Path = "/c/home/CVI/instr/HISTO/H2D.fp"
Path = "/c/home/cvi/instr/HISTO/H2D.fp"
File Type = "Function Panel"
Disk Date = 3568705022
Disk Date = 3568268329
In Projects = "1,"
 
[File 0003]
Path = "/c/home/CVI/instr/K6517/K6517.fp"
Path = "/c/home/cvi/instr/MIKRO/MIKRO.fp"
File Type = "Function Panel"
Disk Date = 3603694414
Disk Date = 3555480934
In Projects = "1,"
 
[File 0004]
Path = "/c/home/CVI/instr/MIKRO/MIKRO.fp"
File Type = "Function Panel"
Disk Date = 3228639698
In Projects = "1,"
 
[File 0005]
Path = "/c/home/CVI/instr/PROLOGIX/prologix.fp"
File Type = "Function Panel"
Disk Date = 3596087345
In Projects = "1,"
 
[File 0006]
Path = "/c/home/CVI/instr/pw18-1.8aq/pw18-1.8aq.fp"
File Type = "Function Panel"
Disk Date = 3606995791
In Projects = "2,"
 
[File 0007]
Path = "/c/home/CVI/instr/DRS/drs4.c"
Path = "/c/home/rok/DRS/drs4.c"
File Type = "CSource"
Disk Date = 3622171186
Disk Date = 3577693051
In Projects = "1,"
Window Top = 33
Window Left = 10
Window Z-Order = 1
Source Window State = "1,389,389,389,40,49,49,0,0,140,0,291,0,1,0,30,393,0,403,42,349,683,1,15,"
Source Window State = "1,580,580,580,15,35,15,0,0,160,0,0,0,0,0,37,537,0,581,59,349,683,1,0,"
 
[File 0008]
Path = "/c/home/CVI/instr/DRS/drs4.uir"
[File 0005]
Path = "/c/home/rok/DRS/drs4.uir"
File Type = "User Interface Resource"
Disk Date = 3622173437
Disk Date = 3577692711
In Projects = "1,"
Window Top = 132
Window Left = 49
Window Height = 349
Window Width = 811
Window Z-Order = 4
Window Z-Order = 3
 
[File 0009]
Path = "/c/home/CVI/instr/DRS/drsread.h"
File Type = "Include"
Disk Date = 3596087344
In Projects = ""
Window Top = 219
Window Left = 106
Window Z-Order = 6
Source Window State = "1,11,11,11,15,30,30,0,3,80,0,0,0,0,0,25,0,0,11,15,349,683,1,0,"
[File 0006]
Path = "/c/home/rok/DRS/drsread.lib"
File Type = "Library"
Disk Date = 3577692972
In Projects = "1,"
 
[File 0010]
Path = "/c/home/CVI/instr/HISTO/H1D.c"
File Type = "CSource"
Disk Date = 3621685621
In Projects = ""
Window Top = 374
Window Left = 186
Window Z-Order = 14
Source Window State = "1,118,118,118,15,89,15,0,0,86,0,0,0,0,0,25,28,0,32,28,349,731,1,0,"
 
[File 0011]
Path = "/c/home/CVI/instr/HISTO/H2D.c"
File Type = "CSource"
Disk Date = 3621932547
In Projects = ""
Window Top = 250
Window Left = 122
Window Z-Order = 12
Source Window State = "1,340,350,340,0,0,0,0,0,86,0,0,0,0,0,25,326,0,340,0,349,731,1,0,"
 
[File 0012]
Path = "/c/home/CVI/instr/HISTO/H1D.h"
[File 0007]
Path = "/c/home/rok/DRS/drsread.h"
File Type = "Include"
Disk Date = 3596087344
Disk Date = 3577691433
In Projects = ""
Window Top = 64
Window Left = 26
Window Z-Order = 15
Source Window State = "1,48,48,48,14,22,22,0,3,86,0,0,0,0,0,25,0,0,48,14,349,731,1,0,"
 
[File 0013]
Path = "/c/home/CVI/instr/HISTO/H2D.h"
File Type = "Include"
Disk Date = 3621840179
In Projects = ""
Window Top = 312
Window Left = 154
Window Z-Order = 13
Source Window State = "1,65,65,65,0,36,36,0,0,86,0,0,0,0,0,25,33,0,65,44,349,731,1,0,"
 
[File 0014]
Path = "/c/home/CVI/instr/K6517/K6517.c"
File Type = "CSource"
Disk Date = 3615357025
In Projects = ""
Window Top = 33
Window Left = 10
Window Z-Order = 7
Source Window State = "1,675,675,675,2,32,2,0,0,80,0,0,0,0,0,15,658,0,675,9,219,683,1,0,"
 
[File 0015]
Path = "/c/home/CVI/instr/K6517/K6517-ctrl.uir"
File Type = "User Interface Resource"
Disk Date = 3621934230
In Projects = ""
Window Top = 126
Window Left = 58
Window Height = 219
Window Width = 683
Window Z-Order = 11
 
[File 0016]
Path = "/c/home/CVI/apps/TempCtrl/TempCtrl.c"
File Type = "CSource"
Disk Date = 3621915607
In Projects = "2,"
Window Top = 64
Window Left = 26
Window Z-Order = 5
Source Window State = "1,387,387,387,81,91,81,0,0,80,0,0,0,0,0,25,345,0,387,43,349,683,1,0,"
 
[File 0017]
Path = "/c/home/CVI/apps/TempCtrl/TempCtrl.uir"
File Type = "User Interface Resource"
Disk Date = 3614830800
In Projects = "2,"
Window Top = 250
Window Left = 122
Window Height = 349
Window Width = 731
Window Z-Order = 8
 
[File 0018]
Path = "/c/home/CVI/instr/pw18-1.8aq/pw18-1.8aq.c"
File Type = "CSource"
Disk Date = 3607489935
In Projects = ""
Window Top = 188
Window Left = 90
Window Z-Order = 10
Source Window State = "1,191,191,191,10,16,16,0,0,86,0,0,0,0,0,25,154,0,190,15,349,731,1,0,"
 
[File 0019]
Path = "/c/home/CVI/instr/pw18-1.8aq/TMI_Api.h"
File Type = "Include"
Disk Date = 3596105599
In Projects = ""
Window Top = 219
Window Left = 106
Window Z-Order = 9
Source Window State = "1,122,122,122,30,32,30,0,0,86,0,0,0,0,0,25,80,0,123,32,349,731,1,0,"
 
[File 0020]
Path = "/c/home/CVI/instr/DRS/scaler.c"
File Type = "CSource"
Disk Date = 3622174227
In Projects = "1,"
Window Top = 64
Window Left = 26
Window Z-Order = 2
Source Window State = "1,257,257,257,4,15,15,0,0,80,0,0,0,0,0,21,238,0,259,18,297,683,1,0,"
Source Window State = "1,0,0,0,0,0,0,0,0,80,0,0,0,0,0,25,0,0,0,0,349,683,1,0,"
 
[File 0021]
Path = "/c/home/CVI/instr/DRS/scaler.uir"
File Type = "User Interface Resource"
Disk Date = 3622173696
In Projects = "1,"
Window Top = 64
Window Left = 26
Window Height = 297
Window Width = 683
Window Z-Order = 3
 
[File 0022]
Path = "/c/home/CVI/instr/DRS/drsread.lib"
File Type = "Library"
Disk Date = 3596087344
In Projects = "1,"
 
[Tab Order]
Tab 0001 = "/c/home/CVI/instr/DRS/drs4.uir"
Tab 0002 = "/c/home/CVI/instr/DRS/drsread.h"
Tab 0003 = "/c/home/CVI/instr/DRS/drs4.c"
Tab 0004 = "/c/home/CVI/instr/HISTO/H1D.c"
Tab 0005 = "/c/home/CVI/instr/HISTO/H1D.h"
Tab 0006 = "/c/home/CVI/instr/K6517/K6517.c"
Tab 0007 = "/c/home/CVI/instr/K6517/K6517-ctrl.uir"
Tab 0008 = "/c/home/CVI/instr/HISTO/H2D.c"
Tab 0009 = "/c/home/CVI/instr/HISTO/H2D.h"
Tab 0010 = "/c/home/CVI/apps/TempCtrl/TempCtrl.c"
Tab 0011 = "/c/home/CVI/instr/pw18-1.8aq/pw18-1.8aq.c"
Tab 0012 = "/c/home/CVI/instr/pw18-1.8aq/TMI_Api.h"
Tab 0013 = "/c/home/CVI/apps/TempCtrl/TempCtrl.uir"
Tab 0014 = "/c/home/CVI/instr/DRS/scaler.c"
Tab 0015 = "/c/home/CVI/instr/DRS/scaler.uir"
Tab 0001 = "/c/home/rok/DRS/drs4.c"
Tab 0002 = "/c/home/rok/DRS/drs4.uir"
Tab 0003 = "/c/home/rok/DRS/drsread.h"
 
[Default Build Config 0001 Debug]
Generate Browse Info = True
356,91 → 193,3
Working Directory = ""
Environment Options = ""
 
[Default Build Config 0002 Debug]
Generate Browse Info = True
Enable Uninitialized Locals Runtime Warning = True
Batch Build = False
Profile = "Disabled"
Debugging Level = "Standard"
Execution Trace = "Disabled"
Command Line Args = ""
Working Directory = ""
Environment Options = ""
External Process Path = ""
 
[Default Build Config 0002 Release]
Generate Browse Info = True
Enable Uninitialized Locals Runtime Warning = True
Batch Build = False
Profile = "Disabled"
Debugging Level = "Standard"
Execution Trace = "Disabled"
Command Line Args = ""
Working Directory = ""
Environment Options = ""
External Process Path = ""
 
[Default Build Config 0002 Debug64]
Generate Browse Info = True
Enable Uninitialized Locals Runtime Warning = True
Batch Build = False
Profile = "Disabled"
Debugging Level = "Standard"
Execution Trace = "Disabled"
Command Line Args = ""
Working Directory = ""
Environment Options = ""
External Process Path = ""
 
[Default Build Config 0002 Release64]
Generate Browse Info = True
Enable Uninitialized Locals Runtime Warning = True
Batch Build = False
Profile = "Disabled"
Debugging Level = "Standard"
Execution Trace = "Disabled"
Command Line Args = ""
Working Directory = ""
Environment Options = ""
External Process Path = ""
 
[Build Dependencies 0002]
Number of Dependencies = 0
 
[Build Options 0002]
Generate Browse Info = True
Enable Uninitialized Locals Runtime Warning = True
Execution Trace = "Disabled"
Profile = "Disabled"
Debugging Level = "Standard"
Break On Library Errors = True
Break On First Chance Exceptions = False
 
[Execution Target 0002]
Execution Target Address = "Local desktop computer"
Execution Target Port = 0
Execution Target Type = 0
 
[SCC Options 0002]
Use global settings = True
SCC Provider = ""
SCC Project = ""
Local Path = ""
Auxiliary Path = ""
Perform Same Action For .h File As For .uir File = "Ask"
Perform Same Action For .cds File As For .prj File = "Ask"
Username = ""
Comment = ""
Use Default Username = False
Use Default Comment = False
Suppress CVI Error Messages = False
Always show confirmation dialog = True
 
[DLL Debugging Support 0002]
External Process Path = ""
 
[Command Line Args 0002]
Command Line Args = ""
Working Directory = ""
Environment Options = ""
 
/cvi/instr/DRS/drs4.h
14,93 → 14,36
/* Panels and Controls: */
 
#define PANEL 1
#define PANEL_OPENGUI_2 2 /* control type: command, callback function: OpenQdcCB */
#define PANEL_OPENGUI 3 /* control type: command, callback function: OpenGuiCB */
#define PANEL_EXIT 4 /* control type: command, callback function: ExitCB */
#define PANEL_STOP 5 /* control type: command, callback function: StopCB */
#define PANEL_ACQUIRE 6 /* control type: command, callback function: StartCB */
#define PANEL_TEMPTABLE 7 /* control type: command, callback function: TempTableCB */
#define PANEL_ANA 8 /* control type: command, callback function: ExecRootCB */
#define PANEL_CALIBRATE 9 /* control type: command, callback function: CalibrateCB */
#define PANEL_SETVOLTAGE 10 /* control type: command, callback function: SetVoltageCB */
#define PANEL_START 11 /* control type: command, callback function: StartCB */
#define PANEL_PATH 12 /* control type: string, callback function: (none) */
#define PANEL_FILENAME 13 /* control type: string, callback function: (none) */
#define PANEL_TIMER 14 /* control type: timer, callback function: (none) */
#define PANEL_SCALE_4 15 /* control type: numeric, callback function: ScaleCB */
#define PANEL_DISCONNECT 16 /* control type: command, callback function: DisconnectCB */
#define PANEL_ONOFF 17 /* control type: binary, callback function: SwitchOnOffCB */
#define PANEL_TSCAN 18 /* control type: command, callback function: TScanCB */
#define PANEL_CONNECT 19 /* control type: command, callback function: ConnectCB */
#define PANEL_SCALE_3 20 /* control type: numeric, callback function: ScaleCB */
#define PANEL_SCALE_2 21 /* control type: numeric, callback function: ScaleCB */
#define PANEL_SCALE_1 22 /* control type: numeric, callback function: ScaleCB */
#define PANEL_TRGLEVEL 23 /* control type: numeric, callback function: (none) */
#define PANEL_TRGDELAY 24 /* control type: numeric, callback function: (none) */
#define PANEL_RANGE 25 /* control type: numeric, callback function: (none) */
#define PANEL_TRGCHANNEL 26 /* control type: numeric, callback function: (none) */
#define PANEL_PFREQ 27 /* control type: numeric, callback function: (none) */
#define PANEL_FREQUENCY 28 /* control type: numeric, callback function: (none) */
#define PANEL_VBR 29 /* control type: numeric, callback function: (none) */
#define PANEL_NEVE 30 /* control type: numeric, callback function: (none) */
#define PANEL_CEVE 31 /* control type: numeric, callback function: (none) */
#define PANEL_TRGTYPE 32 /* control type: ring, callback function: (none) */
#define PANEL_ENABLEDOUTPUT 33 /* control type: radioButton, callback function: (none) */
#define PANEL_DEBUG 34 /* control type: radioButton, callback function: (none) */
#define PANEL_CH3 35 /* control type: radioButton, callback function: (none) */
#define PANEL_CH2 36 /* control type: radioButton, callback function: (none) */
#define PANEL_CH1 37 /* control type: radioButton, callback function: (none) */
#define PANEL_GRAPH 38 /* control type: graph, callback function: (none) */
#define PANEL_TIME 39 /* control type: string, callback function: (none) */
#define PANEL_CH0 40 /* control type: radioButton, callback function: (none) */
#define PANEL_TRGPOLARITY 41 /* control type: binary, callback function: (none) */
#define PANEL_TEXTMSG 42 /* control type: textMsg, callback function: (none) */
#define PANEL_STDIO 43 /* control type: textBox, callback function: (none) */
#define PANEL_LED 44 /* control type: LED, callback function: (none) */
#define PANEL_TMON 45 /* control type: numeric, callback function: (none) */
#define PANEL_HUMIDITY 46 /* control type: numeric, callback function: (none) */
#define PANEL_VTABLE 47 /* control type: table, callback function: (none) */
#define PANEL_TABLE 48 /* control type: table, callback function: (none) */
#define PANEL_OPENGUI 2 /* control type: command, callback function: OpenGuiCB */
#define PANEL_EXIT 3 /* control type: command, callback function: ExitCB */
#define PANEL_STOP 4 /* control type: command, callback function: StopCB */
#define PANEL_CALIBRATE 5 /* control type: command, callback function: CalibrateCB */
#define PANEL_START 6 /* control type: command, callback function: StartCB */
#define PANEL_FILENAME 7 /* control type: string, callback function: (none) */
#define PANEL_TIMER 8 /* control type: timer, callback function: (none) */
#define PANEL_TWIN1 9 /* control type: numeric, callback function: (none) */
#define PANEL_TWIN0 10 /* control type: numeric, callback function: (none) */
#define PANEL_TRGLEVEL 11 /* control type: numeric, callback function: (none) */
#define PANEL_TRGDELAY 12 /* control type: numeric, callback function: (none) */
#define PANEL_RANGE 13 /* control type: numeric, callback function: (none) */
#define PANEL_TRGCHANNEL 14 /* control type: numeric, callback function: (none) */
#define PANEL_PFREQ 15 /* control type: numeric, callback function: (none) */
#define PANEL_FREQUENCY 16 /* control type: numeric, callback function: (none) */
#define PANEL_NEVE 17 /* control type: numeric, callback function: (none) */
#define PANEL_CEVE 18 /* control type: numeric, callback function: (none) */
#define PANEL_TRGTYPE 19 /* control type: ring, callback function: (none) */
#define PANEL_ENABLEDOUTPUT 20 /* control type: radioButton, callback function: (none) */
#define PANEL_DEBUG 21 /* control type: radioButton, callback function: (none) */
#define PANEL_CH3 22 /* control type: radioButton, callback function: (none) */
#define PANEL_CH2 23 /* control type: radioButton, callback function: (none) */
#define PANEL_CH1 24 /* control type: radioButton, callback function: (none) */
#define PANEL_GRAPH 25 /* control type: graph, callback function: (none) */
#define PANEL_CH0 26 /* control type: radioButton, callback function: (none) */
#define PANEL_TRGPOLARITY 27 /* control type: binary, callback function: (none) */
#define PANEL_TEXTMSG 28 /* control type: textMsg, callback function: (none) */
#define PANEL_STDIO 29 /* control type: textBox, callback function: (none) */
 
#define QDC 2
#define QDC_REDRAW 2 /* control type: command, callback function: PlotQdcHistogramCB */
#define QDC_OPENGUI_2 3 /* control type: command, callback function: OpenQdcCB */
#define QDC_GRAPH_4 4 /* control type: graph, callback function: (none) */
#define QDC_GRAPH_3 5 /* control type: graph, callback function: (none) */
#define QDC_GRAPH_2 6 /* control type: graph, callback function: (none) */
#define QDC_GRAPH_1 7 /* control type: graph, callback function: (none) */
#define QDC_INIT_4 8 /* control type: command, callback function: InitQdcHistogramCB */
#define QDC_INIT_3 9 /* control type: command, callback function: InitQdcHistogramCB */
#define QDC_INIT_2 10 /* control type: command, callback function: InitQdcHistogramCB */
#define QDC_INIT_1 11 /* control type: command, callback function: InitQdcHistogramCB */
#define QDC_TWIN0_4 12 /* control type: numeric, callback function: (none) */
#define QDC_TWIN1_4 13 /* control type: numeric, callback function: (none) */
#define QDC_TWIN0_3 14 /* control type: numeric, callback function: (none) */
#define QDC_TWIN1_3 15 /* control type: numeric, callback function: (none) */
#define QDC_TWIN0_2 16 /* control type: numeric, callback function: (none) */
#define QDC_TWIN1_2 17 /* control type: numeric, callback function: (none) */
#define QDC_NBIN_4 18 /* control type: numeric, callback function: (none) */
#define QDC_MAX_4 19 /* control type: numeric, callback function: (none) */
#define QDC_MIN_4 20 /* control type: numeric, callback function: (none) */
#define QDC_NBIN_3 21 /* control type: numeric, callback function: (none) */
#define QDC_ACTIVE_4 22 /* control type: radioButton, callback function: SetActiveCB */
#define QDC_ACTIVE_3 23 /* control type: radioButton, callback function: SetActiveCB */
#define QDC_ACTIVE_2 24 /* control type: radioButton, callback function: SetActiveCB */
#define QDC_LOGY 25 /* control type: radioButton, callback function: LogScaleCB */
#define QDC_WFM 26 /* control type: radioButton, callback function: (none) */
#define QDC_ACTIVE_1 27 /* control type: radioButton, callback function: SetActiveCB */
#define QDC_MAX_3 28 /* control type: numeric, callback function: (none) */
#define QDC_MIN_3 29 /* control type: numeric, callback function: (none) */
#define QDC_NBIN_2 30 /* control type: numeric, callback function: (none) */
#define QDC_MAX_2 31 /* control type: numeric, callback function: (none) */
#define QDC_MIN_2 32 /* control type: numeric, callback function: (none) */
#define QDC_NBIN_1 33 /* control type: numeric, callback function: (none) */
#define QDC_MAX_1 34 /* control type: numeric, callback function: (none) */
#define QDC_MIN_1 35 /* control type: numeric, callback function: (none) */
#define QDC_TWIN0_1 36 /* control type: numeric, callback function: (none) */
#define QDC_TWIN1_1 37 /* control type: numeric, callback function: (none) */
 
#define SCAN 3
#define SCAN 2
#define SCAN_OPENGUI 2 /* control type: command, callback function: OpenGuiCB */
#define SCAN_BD 3 /* control type: command, callback function: MoveStageCB */
#define SCAN_BR 4 /* control type: command, callback function: MoveStageCB */
142,29 → 85,16
/* Callback Prototypes: */
 
int CVICALLBACK CalibrateCB(int panel, int control, int event, void *callbackData, int eventData1, int eventData2);
int CVICALLBACK ConnectCB(int panel, int control, int event, void *callbackData, int eventData1, int eventData2);
int CVICALLBACK DisconnectCB(int panel, int control, int event, void *callbackData, int eventData1, int eventData2);
int CVICALLBACK ExecRootCB(int panel, int control, int event, void *callbackData, int eventData1, int eventData2);
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 InitQdcHistogramCB(int panel, int control, int event, void *callbackData, int eventData1, int eventData2);
int CVICALLBACK LogScaleCB(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 OpenGuiCB(int panel, int control, int event, void *callbackData, int eventData1, int eventData2);
int CVICALLBACK OpenQdcCB(int panel, int control, int event, void *callbackData, int eventData1, int eventData2);
int CVICALLBACK PlotQdcHistogramCB(int panel, int control, int event, void *callbackData, int eventData1, int eventData2);
int CVICALLBACK PlotScanHistogramCB(int panel, int control, int event, void *callbackData, int eventData1, int eventData2);
int CVICALLBACK ScaleCB(int panel, int control, int event, void *callbackData, int eventData1, int eventData2);
int CVICALLBACK SetActiveCB(int panel, int control, int event, void *callbackData, int eventData1, int eventData2);
int CVICALLBACK SetVoltageCB(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);
int CVICALLBACK SwitchOnOffCB(int panel, int control, int event, void *callbackData, int eventData1, int eventData2);
int CVICALLBACK TempTableCB(int panel, int control, int event, void *callbackData, int eventData1, int eventData2);
int CVICALLBACK TScanCB(int panel, int control, int event, void *callbackData, int eventData1, int eventData2);
 
 
#ifdef __cplusplus
/cvi/instr/DRS/drs4.uir
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/cvi/instr/DRS/drs4.prj
1,6 → 1,6
[Project Header]
Version = 1302
Pathname = "/c/home/CVI/instr/DRS/drs4.prj"
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"
9,7 → 9,7
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 = 10
Number of Files = 6
Target Type = "Executable"
Flags = 2064
Copied From Locked InstrDrv Directory = False
34,7 → 34,7
Path Is Rel = True
Path Rel To = "Project"
Path Rel Path = "drs4.uir"
Path = "/c/home/CVI/instr/DRS/drs4.uir"
Path = "/c/home/rok/DRS/drs4.uir"
Exclude = False
Project Flags = 0
Folder = "User Interface Files"
41,24 → 41,12
Folder Id = 0
 
[File 0002]
File Type = "User Interface Resource"
File Type = "CSource"
Res Id = 2
Path Is Rel = True
Path Rel To = "Project"
Path Rel Path = "scaler.uir"
Path = "/c/home/CVI/instr/DRS/scaler.uir"
Exclude = False
Project Flags = 0
Folder = "User Interface Files"
Folder Id = 0
 
[File 0003]
File Type = "CSource"
Res Id = 3
Path Is Rel = True
Path Rel To = "Project"
Path Rel Path = "drs4.c"
Path = "/c/home/CVI/instr/DRS/drs4.c"
Path = "/c/home/rok/DRS/drs4.c"
Exclude = False
Compile Into Object File = False
Project Flags = 0
65,91 → 53,54
Folder = "Source Files"
Folder Id = 1
 
[File 0004]
File Type = "CSource"
Res Id = 4
Path Is Rel = True
Path Rel To = "Project"
Path Rel Path = "scaler.c"
Path = "/c/home/CVI/instr/DRS/scaler.c"
Exclude = False
Compile Into Object File = False
Project Flags = 0
Folder = "Source Files"
Folder Id = 1
 
[File 0005]
[File 0003]
File Type = "Library"
Res Id = 5
Res Id = 3
Path Is Rel = True
Path Rel To = "Project"
Path Rel Path = "drsread.lib"
Path = "/c/home/CVI/instr/DRS/drsread.lib"
Path = "/c/home/rok/DRS/drsread.lib"
Exclude = False
Project Flags = 0
Folder = "Library Files"
Folder Id = 2
 
[File 0006]
[File 0004]
File Type = "Function Panel"
Res Id = 6
Res Id = 4
Path Is Rel = True
Path Rel To = "Project"
Path Rel Path = "../HISTO/H1D.fp"
Path = "/c/home/CVI/instr/HISTO/H1D.fp"
Path Rel Path = "../../cvi/instr/HISTO/H1D.fp"
Path = "/c/home/cvi/instr/HISTO/H1D.fp"
Exclude = False
Project Flags = 0
Folder = "Instrument Files"
Folder Id = 3
 
[File 0007]
[File 0005]
File Type = "Function Panel"
Res Id = 7
Res Id = 5
Path Is Rel = True
Path Rel To = "Project"
Path Rel Path = "../HISTO/H2D.fp"
Path = "/c/home/CVI/instr/HISTO/H2D.fp"
Path Rel Path = "../../cvi/instr/HISTO/H2D.fp"
Path = "/c/home/cvi/instr/HISTO/H2D.fp"
Exclude = False
Project Flags = 0
Folder = "Instrument Files"
Folder Id = 3
 
[File 0008]
[File 0006]
File Type = "Function Panel"
Res Id = 8
Res Id = 6
Path Is Rel = True
Path Rel To = "Project"
Path Rel Path = "../K6517/K6517.fp"
Path = "/c/home/CVI/instr/K6517/K6517.fp"
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
 
[File 0009]
File Type = "Function Panel"
Res Id = 9
Path Is Rel = True
Path Rel To = "Project"
Path Rel Path = "../MIKRO/MIKRO.fp"
Path = "/c/home/CVI/instr/MIKRO/MIKRO.fp"
Exclude = False
Project Flags = 0
Folder = "Instrument Files"
Folder Id = 3
 
[File 0010]
File Type = "Function Panel"
Res Id = 10
Path Is Rel = True
Path Rel To = "Project"
Path Rel Path = "../PROLOGIX/prologix.fp"
Path = "/c/home/CVI/instr/PROLOGIX/prologix.fp"
Exclude = False
Project Flags = 0
Folder = "Instrument Files"
Folder Id = 3
 
[Custom Build Configs]
Num Custom Build Configs = 0
 
218,7 → 169,7
File Version Ex = "%f1.%f2"
Internal Name = "drs4"
Internal Name Ex = "%basename"
Legal Copyright = "Copyright © 2018"
Legal Copyright = "Copyright © 2017"
Legal Copyright Ex = "Copyright © %company %Y"
Legal Trademarks = ""
Legal Trademarks Ex = ""
438,33 → 389,23
[Compiler Defines]
Compiler Defines = "/DWIN32_LEAN_AND_MEAN"
 
[Include Paths]
Include Path 1 Is Rel = True
Include Path 1 Rel To = "Project"
Include Path 1 Rel Path = "../PROLOGIX"
Include Path 1 = "/c/home/CVI/instr/PROLOGIX"
Include Path 2 Is Rel = True
Include Path 2 Rel To = "Project"
Include Path 2 Rel Path = ""
Include Path 2 = "/c/home/CVI/instr/DRS"
 
[Create Executable]
Executable File_Debug Is Rel = True
Executable File_Debug Rel To = "Project"
Executable File_Debug Rel Path = "drs4.exe"
Executable File_Debug = "/c/home/CVI/instr/DRS/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/home/CVI/instr/DRS/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/home/CVI/instr/DRS/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/home/CVI/instr/DRS/drs4.exe"
Executable File_Release64 = "/c/home/rok/DRS/drs4.exe"
Icon File Is Rel = False
Icon File = ""
Application Title = ""