Subversion Repositories f9daq

Compare Revisions

Regard whitespace Rev 341 → Rev 342

/Samo/l2d/camac.h
2,6 → 2,9
#define NAF(N,A,F) 0x810002+(N)*0x800+(A)*0x80+(F)*0x4
#define BRF(F) 0x80E802+(F)*0x4
 
#define VME_A24D16_R(VME,DATA) WIENVME_VME_A24D16_R((VME),(DATA))
#define VME_A24D16_W(VME,DATA) WIENVME_VME_A24D16_W((VME),(DATA))
 
#define CSSA_R(N,A,F,DATA) VME_A24D16_R((NAF((N),(A),(F))),(DATA))
#define CSSA_W(N,A,F,DATA) VME_A24D16_W((NAF((N),(A),(F))),(DATA))
 
/Samo/l2d/l2d.c
6,20 → 6,23
-
*/
 
//#define USE_DAQ
//#define USE_MIKRO
#define USE_DAQ
#define USE_MIKRO
 
// Izberi ustrezni interface v meniju projektnega okna
// Options->CompilerDefines (dodaj /DSISVME ali /DWIENVME)
 
#ifdef USE_DAQ
# define USE_CAMAC
# include "camac.h"
# ifdef SISVME
# include "sisvme_dll.h"
# endif
//# ifdef SISVME
//# include "sisvme_dll.h"
//# endif
# ifdef WIENVME
# include "wienvme_dll.h"
# endif
# define VME_START(NODE) WIENVME_VME_START((NODE))
# define VME_STOP() WIENVME_VME_STOP()
# include "CAENV965.h"
#endif
 
36,12 → 39,12
 
#ifdef USE_DAQ
//# define VTDC_ADDR 0x330000
# define VADC_ADDR 0x340000
# define VADC_ADDR 0x350000
//# define VTDC 0
# define VADC 1
//# define IO1_ADDR 0x100200
//# define NTDCP 20
# define NTDCJ 18
# define NTDCJ 20
# define NGL 23
#endif
 
52,9 → 55,9
#define MAXCH 0x1000
#define MAX_THREADS 10
 
#define IWAIT 200
#define IWAIT 2000
 
# define NCH 8
# define NCH 2
static int p1h, pID, rID, tfID;
static int ph_tdc, ph_adc;
static int dtdc[NCH][2][MAXCH];
78,14 → 81,12
}
 
int CVICALLBACK cb_timer (int panel, int control, int event, void *callbackData,
int eventData1, int eventData2)
{
int eventData1, int eventData2) {
QueueUserEvent (9000, p1h, P1_TIMER);
return (0);
}
 
int update_plots (void)
{
int update_plots (void) {
int irange, ch;
GetCtrlVal (p1h, P1_PLCH, &ch);
102,8 → 103,7
return (0);
}
 
int CVICALLBACK daq_run(void *functionData)
{
int CVICALLBACK daq_run(void *functionData) {
int i,j;
int ndat,dtype,ch,rg,adc,cres;
unsigned long a,b,ec1,ec2;
116,7 → 116,7
float frac;
double fracg;
 
FILE *fp;
FILE *fp=NULL;
#define RUNREC_ID 1
#define ENDREC_ID 2
#define POSREC_ID 3
222,11 → 222,11
fp = fopen (dfile, "wb");
time (&runrec.time);
status = fwrite (&runrec, 1, runrec.len, fp);
}
if (supr0) {
fseed = runrec.time & 0x7fffffff;
Uniform (1, fseed, &fracg);
}
}
 
for (posrec.ix=0;posrec.ix<runrec.nx;posrec.ix++) {
posrec.xset=runrec.x0+posrec.ix*runrec.dx;
298,8 → 298,28
if (ntics>=2) {
ndat=V965_read (VADC, &data[0]);
continue;
} else {
# ifdef USE_CAMAC
# ifdef NTDCJ
wait_loop(20000);
// ntics=0;
// do {
// wait_loop(IWAIT);
CSSA_R(NTDCJ,0,8,&cres);
// if (!(cres&0x8000)) printf("CSSA_R(NTDCJ,0,8,&cres)=0x%0x\n", cres) ;
// } while ((!(cres&0x8000))&&(ntics<2)&&daq_on);
// if (!daq_on) break;
// if (ntics>=2) {
if (!(cres&0x8000)) {
CSSA_R(NGL,0,25,&cres);
ndat=V965_read (VADC, &data[0]);
CSSA_R(NTDCJ,0,9,&cres);
CSSA_R(NTDCJ,0,26,&cres);
continue;
}
wait_loop(2000);
# endif
# endif
}
/*
ndat=V965_read (VTDC, &data[0]);
for (i=0; i<ndat; i++) {
326,7 → 346,8
# endif
# endif
// printf("TDC=0x%04X\n",adc);
adc=adc&0xfff;
// adc=adc&0xfff;
if (adc&0x1000) adc=0xfff; else adc&=0xfff;
aa[i][0]=adc;
dtdc[i][0][adc]+=1;
}
415,8 → 436,7
}
 
int __stdcall WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpszCmdLine, int nCmdShow)
{
LPSTR lpszCmdLine, int nCmdShow) {
int i,j,status,refon;
long int zpos;
char dfile[300];
/Samo/l2d/l2d.cws
1,22 → 1,22
[Workspace Header]
Version = 1700
Pathname = "/c/SAMO/Programi/NI/cvi/l2d/l2d.cws"
CVI Dir = "/c/program files (x86)/national instruments/cvi2017"
CVI Shared Dir = "/C/Program Files (x86)/National Instruments/Shared/CVI"
Pathname = "/c/home/samo/l2d/l2d.cws"
CVI Dir = "/c/program files/national instruments/cvi2017"
CVI Shared Dir = "/C/Program Files/National Instruments/Shared/CVI"
CVI Pub Local Dir = "/C/ProgramData/National Instruments/CVI2017"
CVI Pub Global Dir = "/C/ProgramData/National Instruments/CVI"
IVI Standard Root Dir = "/C/Program Files (x86)/IVI Foundation/IVI"
IVI Standard Root Dir = "/C/Program Files/IVI Foundation/IVI"
IVI Standard Root 64-bit Dir = "/C/Program Files/IVI Foundation/IVI"
VXIplug&play Framework Dir = "/C/Program Files (x86)/IVI Foundation/VISA/winnt"
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 = 1
Active Project = 1
Project 0001 = "l2d.prj"
Drag Bar Left = 250
Window Top = 149
Window Left = -1599
Window Bottom = 1007
Window Right = -196
Drag Bar Left = 201
Window Top = 31
Window Left = 291
Window Bottom = 1079
Window Right = 1811
Maximized = False
Maximized Children = True
Max32 Number Of Errors = 20
30,9 → 30,9
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 = 233
MainColumnWidth = 184
FileDateColumnWidth = 70
FileSizeColumnWidth = 70
 
46,68 → 46,129
Batch Build Debug = False
 
[File 0001]
Path = "/c/SAMO/Programi/NI/cvi/instr/CAENV965/CAENV965.fp"
Path = "/c/home/cvi/instr/CAENV965/CAENV965.fp"
File Type = "Function Panel"
Disk Date = 3657094434
Disk Date = 3568264729
In Projects = "1,"
 
[File 0002]
Path = "/c/SAMO/Programi/NI/cvi/instr/MIKRO/MIKRO.fp"
Path = "/c/home/cvi/instr/MIKRO/MIKRO.fp"
File Type = "Function Panel"
Disk Date = 3336986594
Disk Date = 3555480934
In Projects = "1,"
 
[File 0003]
Path = "/c/SAMO/Programi/NI/cvi/instr/WIENVME_DLL/wienvme_dll.fp"
Path = "/c/home/cvi/instr/WIENVME_DLL/wienvme_dll.fp"
File Type = "Function Panel"
Disk Date = 3509989482
Disk Date = 3555480934
In Projects = "1,"
 
[File 0004]
Path = "/c/SAMO/Programi/NI/cvi/l2d/l2d.c"
Path = "/c/home/samo/l2d/l2d.c"
File Type = "CSource"
Disk Date = 3557037737
Disk Date = 3657462591
In Projects = "1,"
Window Top = 64
Window Left = 26
Window Height = -16281
Window Z-Order = 3
Source Window State = "1,184,184,184,29,34,34,0,0,80,0,0,0,0,0,20,0,0,441,195,349,683,1,0,"
Window Z-Order = 1
Source Window State = "1,404,404,404,90,91,90,0,0,160,0,0,0,0,0,51,318,0,349,36,349,683,1,0,"
 
[File 0005]
Path = "/c/SAMO/Programi/NI/cvi/l2d/l2d_ui.uir"
Path = "/c/home/samo/l2d/l2d_ui.uir"
File Type = "User Interface Resource"
Disk Date = 3279851198
Disk Date = 3657102569
In Projects = "1,"
Window Top = 33
Window Left = 10
Window Height = 297
Window Width = 683
Window Z-Order = 1
Window Z-Order = 6
 
[File 0006]
Path = "/c/SAMO/Programi/NI/cvi/l2d/camac.h"
Path = "/c/home/samo/l2d/camac.h"
File Type = "Include"
Disk Date = 3279845963
Disk Date = 3657109961
In Projects = "1,"
Window Top = 95
Window Left = 42
Window Z-Order = 2
Source Window State = "1,0,0,0,0,0,0,0,0,80,0,0,0,0,0,20,0,0,0,0,349,683,1,0,"
Window Z-Order = 4
Source Window State = "1,4,5,4,0,0,0,0,0,80,0,0,0,0,0,25,0,0,5,51,349,683,1,0,"
 
[File 0007]
Path = "/c/SAMO/Programi/NI/cvi/l2d/l2d_ui.h"
Path = "/c/home/cvi/instr/CAENV965/CAENV965.c"
File Type = "CSource"
Disk Date = 3657107165
In Projects = ""
Window Top = 188
Window Left = 90
Window Z-Order = 7
Source Window State = "1,4,4,4,22,26,22,0,0,80,0,0,0,0,0,25,0,0,7,24,349,683,1,0,"
 
[File 0008]
Path = "/c/home/cvi/instr/CAENV965/CAENV965.h"
File Type = "Include"
Disk Date = 3279851198
Disk Date = 3568264729
In Projects = ""
Window Top = 219
Window Left = 106
Window Z-Order = 8
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 0009]
Path = "/c/home/cvi/instr/CAENV965/CAENV965_DEF.h"
File Type = "Include"
Disk Date = 3568264729
In Projects = ""
Window Top = 250
Window Left = 122
Window Z-Order = 5
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 0010]
Path = "/c/home/cvi/instr/WIENVME_DLL/wienvme_dll.h"
File Type = "Include"
Disk Date = 3568264730
In Projects = ""
Window Top = 312
Window Left = 154
Window Z-Order = 3
Source Window State = "1,31,31,31,32,53,32,0,0,80,0,0,0,0,0,25,23,0,59,24,349,683,1,0,"
 
[File 0011]
Path = "/c/home/samo/l2d/l2d_ui.h"
File Type = "Include"
Disk Date = 3657102569
In Projects = "1,"
Window Top = 126
Window Left = 58
Source Window State = "1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,349,683,1,0,"
 
[File 0012]
Path = "/c/home/cvi/instr/WIENVME_DLL/wienvme_dll.c"
File Type = "CSource"
Disk Date = 3657111603
In Projects = ""
Window Top = 343
Window Left = 170
Window Z-Order = 2
Source Window State = "1,87,87,87,12,33,33,0,0,80,0,0,0,0,0,25,25,0,63,58,349,683,1,0,"
 
[File 0013]
Path = "/c/home/cvi/instr/WIENVME_DLL/pcivme_ni.lib"
File Type = "Library"
Disk Date = 3556788687
In Projects = "1,"
 
[Tab Order]
Tab 0001 = "/c/SAMO/Programi/NI/cvi/l2d/l2d_ui.uir"
Tab 0002 = "/c/SAMO/Programi/NI/cvi/l2d/l2d.c"
Tab 0003 = "/c/SAMO/Programi/NI/cvi/l2d/camac.h"
Tab 0001 = "/c/home/samo/l2d/l2d.c"
Tab 0002 = "/c/home/samo/l2d/l2d_ui.uir"
Tab 0003 = "/c/home/cvi/instr/CAENV965/CAENV965.c"
Tab 0004 = "/c/home/cvi/instr/CAENV965/CAENV965.h"
Tab 0005 = "/c/home/cvi/instr/CAENV965/CAENV965_DEF.h"
Tab 0006 = "/c/home/cvi/instr/WIENVME_DLL/wienvme_dll.h"
Tab 0007 = "/c/home/cvi/instr/WIENVME_DLL/wienvme_dll.c"
Tab 0008 = "/c/home/samo/l2d/camac.h"
 
[Default Build Config 0001 Debug]
Generate Browse Info = True
/Samo/l2d/l2d.prj
1,15 → 1,15
[Project Header]
Version = 1302
Pathname = "/c/SAMO/Programi/NI/cvi/l2d/l2d.prj"
CVI Dir = "/c/program files (x86)/national instruments/cvi2013"
CVI Shared Dir = "/C/Program Files (x86)/National Instruments/Shared/CVI"
CVI Pub Local Dir = "/C/ProgramData/National Instruments/CVI2013"
Version = 1700
Pathname = "/c/home/samo/l2d/l2d.prj"
CVI Dir = "/c/program files/national instruments/cvi2017"
CVI Shared Dir = "/C/Program Files/National Instruments/Shared/CVI"
CVI Pub Local Dir = "/C/ProgramData/National Instruments/CVI2017"
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 = 7
Number of Files = 8
Target Type = "Executable"
Flags = 16
Copied From Locked InstrDrv Directory = False
18,7 → 18,6
Don't Display Deploy InstrDrv Dialog = False
 
[Folders]
Library Files Folder Not Added Yet = True
Folder 0 = "Source Files"
FolderEx 0 = "Source Files"
Folder 1 = "User Interface Files"
27,6 → 26,8
FolderEx 2 = "Include Files"
Folder 3 = "Instrument Files"
FolderEx 3 = "Instrument Files"
Folder 4 = "Library Files"
FolderEx 4 = "Library Files"
 
[File 0001]
File Type = "CSource"
34,7 → 35,7
Path Is Rel = True
Path Rel To = "Project"
Path Rel Path = "l2d.c"
Path = "/c/SAMO/Programi/NI/cvi/l2d/l2d.c"
Path = "/c/home/samo/l2d/l2d.c"
Exclude = False
Compile Into Object File = False
Project Flags = 0
47,7 → 48,7
Path Is Rel = True
Path Rel To = "Project"
Path Rel Path = "l2d_ui.uir"
Path = "/c/SAMO/Programi/NI/cvi/l2d/l2d_ui.uir"
Path = "/c/home/samo/l2d/l2d_ui.uir"
Exclude = False
Project Flags = 0
Folder = "User Interface Files"
59,7 → 60,7
Path Is Rel = True
Path Rel To = "Project"
Path Rel Path = "camac.h"
Path = "/c/SAMO/Programi/NI/cvi/l2d/camac.h"
Path = "/c/home/samo/l2d/camac.h"
Exclude = False
Project Flags = 0
Folder = "Include Files"
71,7 → 72,7
Path Is Rel = True
Path Rel To = "Project"
Path Rel Path = "l2d_ui.h"
Path = "/c/SAMO/Programi/NI/cvi/l2d/l2d_ui.h"
Path = "/c/home/samo/l2d/l2d_ui.h"
Exclude = False
Project Flags = 0
Folder = "Include Files"
82,8 → 83,8
Res Id = 5
Path Is Rel = True
Path Rel To = "Project"
Path Rel Path = "../instr/CAENV965/CAENV965.fp"
Path = "/c/SAMO/Programi/NI/cvi/instr/CAENV965/CAENV965.fp"
Path Rel Path = "../../cvi/instr/CAENV965/CAENV965.fp"
Path = "/c/home/cvi/instr/CAENV965/CAENV965.fp"
Exclude = False
Project Flags = 0
Folder = "Instrument Files"
94,8 → 95,8
Res Id = 6
Path Is Rel = True
Path Rel To = "Project"
Path Rel Path = "../instr/MIKRO/MIKRO.fp"
Path = "/c/SAMO/Programi/NI/cvi/instr/MIKRO/MIKRO.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"
106,13 → 107,25
Res Id = 7
Path Is Rel = True
Path Rel To = "Project"
Path Rel Path = "../instr/WIENVME_DLL/wienvme_dll.fp"
Path = "/c/SAMO/Programi/NI/cvi/instr/WIENVME_DLL/wienvme_dll.fp"
Path Rel Path = "../../cvi/instr/WIENVME_DLL/wienvme_dll.fp"
Path = "/c/home/cvi/instr/WIENVME_DLL/wienvme_dll.fp"
Exclude = False
Project Flags = 0
Folder = "Instrument Files"
Folder Id = 3
 
[File 0008]
File Type = "Library"
Res Id = 8
Path Is Rel = True
Path Rel To = "Project"
Path Rel Path = "../../cvi/instr/WIENVME_DLL/pcivme_ni.lib"
Path = "/c/home/cvi/instr/WIENVME_DLL/pcivme_ni.lib"
Exclude = False
Project Flags = 0
Folder = "Library Files"
Folder Id = 4
 
[Custom Build Configs]
Num Custom Build Configs = 0
 
169,6 → 182,32
Using LoadExternalModule = True
DLL Exports = "Include File Symbols"
Register ActiveX Server = False
Numeric File Version = "1,0,0,0"
Numeric Prod Version = "1,0,0,0"
Comments = ""
Comments Ex = ""
Company Name = ""
Company Name Ex = "%company"
File Description = "l2d_dbg (Debug x86)"
File Description Ex = "%application (%rel_dbg %arch)"
File Version = "1.0"
File Version Ex = "%f1.%f2"
Internal Name = "l2d_dbg"
Internal Name Ex = "%basename"
Legal Copyright = "Copyright 2019"
Legal Copyright Ex = "Copyright %company %Y"
Legal Trademarks = ""
Legal Trademarks Ex = ""
Original Filename = "l2d_dbg.exe"
Original Filename Ex = "%filename"
Private Build = ""
Private Build Ex = ""
Product Name = " l2d_dbg"
Product Name Ex = "%company %application"
Product Version = "1.0"
Product Version Ex = "%p1.%p2"
Special Build = ""
Special Build Ex = ""
Add Type Lib To DLL = False
Include Type Lib Help Links = False
TLB Help Style = "HLP"
360,9 → 399,8
Enable Unreachable Code Warning = False
Enable Unreferenced Identifiers Warning = False
Enable Assignment In Conditional Warning = False
O Option Compatible With 5.0 = False
Enable C99 Extensions = False
Uninitialized Locals Compile Warning = "Conservative"
Uninitialized Locals Compile Warning = "Aggressive"
Precompile Prefix Header = False
Prefix Header File = ""
 
380,25 → 418,25
Include Path 1 Rel To = "CVI"
Include Path 1 Rel To Override = "CVI"
Include Path 1 Rel Path = "instr/PCIVME_DLL"
Include Path 1 = "/c/Program Files (x86)/National Instruments/CVI2013/instr/PCIVME_DLL"
Include Path 1 = "/c/program files/national instruments/cvi2017/instr/PCIVME_DLL"
 
[Create Executable]
Executable File_Debug Is Rel = True
Executable File_Debug Rel To = "Project"
Executable File_Debug Rel Path = "l2d_dbg.exe"
Executable File_Debug = "/c/SAMO/Programi/NI/cvi/l2d/l2d_dbg.exe"
Executable File_Debug = "/c/home/samo/l2d/l2d_dbg.exe"
Executable File_Release Is Rel = True
Executable File_Release Rel To = "Project"
Executable File_Release Rel Path = "l2d.exe"
Executable File_Release = "/c/SAMO/Programi/NI/cvi/l2d/l2d.exe"
Executable File_Release = "/c/home/samo/l2d/l2d.exe"
Executable File_Debug64 Is Rel = True
Executable File_Debug64 Rel To = "Project"
Executable File_Debug64 Rel Path = "l2d.exe"
Executable File_Debug64 = "/c/SAMO/Programi/NI/cvi/l2d/l2d.exe"
Executable File_Debug64 = "/c/home/samo/l2d/l2d.exe"
Executable File_Release64 Is Rel = True
Executable File_Release64 Rel To = "Project"
Executable File_Release64 Rel Path = "l2d.exe"
Executable File_Release64 = "/c/SAMO/Programi/NI/cvi/l2d/l2d.exe"
Executable File_Release64 = "/c/home/samo/l2d/l2d.exe"
Icon File Is Rel = False
Icon File = ""
Application Title = ""