Subversion Repositories f9daq

Compare Revisions

Ignore whitespace Rev 312 → Rev 313

/cvi/instr/K6517/K6517-ctrl.h
37,50 → 37,52
#define P2_EXIT 3 /* control type: command, callback function: ExitCB */
#define P2_EXIT_2 4 /* control type: command, callback function: Exit2CB */
#define P2_STOP 5 /* control type: command, callback function: StopCB */
#define P2_HUMIDITY 6 /* control type: numeric, callback function: (none) */
#define P2_TMON 7 /* control type: numeric, callback function: (none) */
#define P2_GRAPHIV 8 /* control type: graph, callback function: (none) */
#define P2_SETVOLT 9 /* control type: command, callback function: SETVOLTCB */
#define P2_DISCONNECT 10 /* control type: command, callback function: DisconnectCB */
#define P2_CONNECT 11 /* control type: command, callback function: ConnectCB */
#define P2_TSCAN 12 /* control type: command, callback function: TScanCB */
#define P2_IVSCAN 13 /* control type: command, callback function: IVSCANCB */
#define P2_UMAX_4 14 /* control type: numeric, callback function: (none) */
#define P2_UMIN_4 15 /* control type: numeric, callback function: (none) */
#define P2_NSTEPS_4 16 /* control type: numeric, callback function: (none) */
#define P2_UMAX_3 17 /* control type: numeric, callback function: (none) */
#define P2_UMIN_3 18 /* control type: numeric, callback function: (none) */
#define P2_NSTEPS_3 19 /* control type: numeric, callback function: (none) */
#define P2_RANGE_4 20 /* control type: ring, callback function: (none) */
#define P2_SLCT_4 21 /* control type: radioButton, callback function: (none) */
#define P2_UMAX_2 22 /* control type: numeric, callback function: (none) */
#define P2_UMIN_2 23 /* control type: numeric, callback function: (none) */
#define P2_NSTEPS_2 24 /* control type: numeric, callback function: (none) */
#define P2_RANGE_3 25 /* control type: ring, callback function: (none) */
#define P2_SLCT_3 26 /* control type: radioButton, callback function: (none) */
#define P2_UMAX_1 27 /* control type: numeric, callback function: (none) */
#define P2_UMIN_1 28 /* control type: numeric, callback function: (none) */
#define P2_NSTEPS_1 29 /* control type: numeric, callback function: (none) */
#define P2_RANGE_2 30 /* control type: ring, callback function: (none) */
#define P2_SLCT_2 31 /* control type: radioButton, callback function: (none) */
#define P2_TIME 32 /* control type: string, callback function: (none) */
#define P2_FILENAME 33 /* control type: string, callback function: (none) */
#define P2_PATH 34 /* control type: string, callback function: (none) */
#define P2_RANGE_1 35 /* control type: ring, callback function: (none) */
#define P2_SLCT_1 36 /* control type: radioButton, callback function: (none) */
#define P2_DEBUG 37 /* control type: radioButton, callback function: DebugCB */
#define P2_REPEAT 38 /* control type: radioButton, callback function: (none) */
#define P2_LOGSCALE 39 /* control type: radioButton, callback function: LogScaleCB */
#define P2_PRINTX 40 /* control type: command, callback function: Print */
#define P2_NEXTSCAN 41 /* control type: numeric, callback function: (none) */
#define P2_VCUR 42 /* control type: numeric, callback function: (none) */
#define P2_VMON 43 /* control type: numeric, callback function: (none) */
#define P2_VOLT 44 /* control type: numeric, callback function: (none) */
#define P2_DELAY2 45 /* control type: numeric, callback function: (none) */
#define P2_PERIOD 46 /* control type: numeric, callback function: (none) */
#define P2_DELAY 47 /* control type: numeric, callback function: (none) */
#define P2_TABLE 48 /* control type: table, callback function: (none) */
#define P2_LED 49 /* control type: LED, callback function: (none) */
#define P2_STATUS 6 /* control type: numeric, callback function: (none) */
#define P2_HUMIDITY 7 /* control type: numeric, callback function: (none) */
#define P2_TMON 8 /* control type: numeric, callback function: (none) */
#define P2_GRAPHIV 9 /* control type: graph, callback function: (none) */
#define P2_SETVOLT 10 /* control type: command, callback function: SETVOLTCB */
#define P2_DISCONNECT 11 /* control type: command, callback function: DisconnectCB */
#define P2_CONNECT 12 /* control type: command, callback function: ConnectCB */
#define P2_TSCAN 13 /* control type: command, callback function: TScanCB */
#define P2_IVSCAN 14 /* control type: command, callback function: IVSCANCB */
#define P2_UMAX_4 15 /* control type: numeric, callback function: (none) */
#define P2_UMIN_4 16 /* control type: numeric, callback function: (none) */
#define P2_NSTEPS_4 17 /* control type: numeric, callback function: (none) */
#define P2_UMAX_3 18 /* control type: numeric, callback function: (none) */
#define P2_UMIN_3 19 /* control type: numeric, callback function: (none) */
#define P2_NSTEPS_3 20 /* control type: numeric, callback function: (none) */
#define P2_RANGE_4 21 /* control type: ring, callback function: (none) */
#define P2_SLCT_4 22 /* control type: radioButton, callback function: (none) */
#define P2_UMAX_2 23 /* control type: numeric, callback function: (none) */
#define P2_UMIN_2 24 /* control type: numeric, callback function: (none) */
#define P2_NSTEPS_2 25 /* control type: numeric, callback function: (none) */
#define P2_RANGE_3 26 /* control type: ring, callback function: (none) */
#define P2_SLCT_3 27 /* control type: radioButton, callback function: (none) */
#define P2_UMAX_1 28 /* control type: numeric, callback function: (none) */
#define P2_UMIN_1 29 /* control type: numeric, callback function: (none) */
#define P2_NSTEPS_1 30 /* control type: numeric, callback function: (none) */
#define P2_RANGE_2 31 /* control type: ring, callback function: (none) */
#define P2_SLCT_2 32 /* control type: radioButton, callback function: (none) */
#define P2_TIME 33 /* control type: string, callback function: (none) */
#define P2_FILENAME 34 /* control type: string, callback function: (none) */
#define P2_PATH 35 /* control type: string, callback function: (none) */
#define P2_RANGE_1 36 /* control type: ring, callback function: (none) */
#define P2_SLCT_1 37 /* control type: radioButton, callback function: (none) */
#define P2_DEBUG 38 /* control type: radioButton, callback function: DebugCB */
#define P2_REPEAT 39 /* control type: radioButton, callback function: (none) */
#define P2_LOGSCALE 40 /* control type: radioButton, callback function: LogScaleCB */
#define P2_PRINTX 41 /* control type: command, callback function: Print */
#define P2_NEXTSCAN 42 /* control type: numeric, callback function: (none) */
#define P2_VCUR 43 /* control type: numeric, callback function: (none) */
#define P2_VMON 44 /* control type: numeric, callback function: (none) */
#define P2_VOLT 45 /* control type: numeric, callback function: (none) */
#define P2_DELAY2 46 /* control type: numeric, callback function: (none) */
#define P2_PERIOD 47 /* control type: numeric, callback function: (none) */
#define P2_DELAY 48 /* control type: numeric, callback function: (none) */
#define P2_TABLE 49 /* control type: table, callback function: (none) */
#define P2_OVERFLOW 50 /* control type: LED, callback function: (none) */
#define P2_LED 51 /* control type: LED, callback function: (none) */
 
 
/* Control Arrays: */
/cvi/instr/K6517/K6517-ctrl.uir
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/cvi/instr/K6517/K6517.c
183,6 → 183,17
return;
}
 
int _VI_FUNC K6517_EventStatus ()
{
K6517_send (":STATUS:MEAS:EVEN?",0);
char cres[100];
cres[0]= 0;
int len = K6517_receive (cres, 50);
if (len>0)
return atoi(cres);
else
return -1;
}
double _VI_FUNC K6517_get (char *prefix, int *loc)
{
 
457,6 → 468,7
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
506,7 → 518,7
sscanf(receiveBuf, "%d%f%f%f%f", &t0,&humidity,&temp, &tdiff, &dt);
SetCtrlVal(pn2,P2_TMON, temp);
SetCtrlVal(pn2,P2_HUMIDITY, humidity);
if (fabs(tdiff)<0.5 && fabs(dt) < 0.2) SetCtrlVal(pn2,P2_LED, 1);
if (fabs(tdiff)<0.2 && fabs(dt) < 0.05) SetCtrlVal(pn2,P2_LED, 1);
else SetCtrlVal(pn2,P2_LED, 0);
}
break;
544,20 → 556,30
int n=0;
int led;
GetNumTableRows (pn2, P2_TABLE, &n );
stop = 0;
for(int i=0; i<n; i++) {
if (stop) break;
GetTableCellVal (pn2, P2_TABLE, MakePoint (1,i+1), &temp);
if (temp>100) break;
char transmitBuf[512]= {0};
sprintf(transmitBuf, "1 %f\n", temp);
SetCtrlVal(pn2,P2_LED, 0);
if (g_hconversation)
if ( ClientTCPWrite (g_hconversation, transmitBuf, strlen (transmitBuf), 1000) < 0) printf("Transmit Error\n");
if (g_connected)
if ( ClientTCPWrite (g_hconversation, transmitBuf, strlen (transmitBuf), 1000) < 0) printf("Transmit Error\n"); else printf("%s\n", transmitBuf);
SetCtrlVal(pn2,P2_LED, 0);
do {
time_t t0 = time(NULL);
SetCtrlVal(pn2,P2_TIME, ctime(&t0));
Delay(1);
GetCtrlVal(pn2,P2_LED, &led);
if (led) {
for (int k=0;k<10;k++){
Delay(1);
if (stop) break;
}
GetCtrlVal(pn2,P2_LED, &led);
}
if (stop) break;
} while (!led);
if (stop) break;
973,8 → 995,20
Delay(t2);
// voltage =K6517_vsource_get();
current =K6517_get(cres,&k);
int status = K6517_EventStatus();
SetCtrlVal(pn2,P2_STATUS, status);
SetCtrlVal(pn2,P2_OVERFLOW, status & 0x1);
// if (current > range) printf("Overflow +\n");
// if (current < -range) printf("Overflow -\n");
if (status & 0x1){
if (range>0) range*=10;
K6517_current_mode (range);
Delay(1);
current =K6517_get(cres,&k);
status = K6517_EventStatus();
SetCtrlVal(pn2,P2_STATUS, status);
SetCtrlVal(pn2,P2_OVERFLOW, status & 0x1);
}
voltage = u;
xpoints[tockaK]= voltage;
ypoints[tockaK]= current;
984,7 → 1018,7
double humidity=0;
GetCtrlVal(pn2, P2_TMON, &temperature);
GetCtrlVal(pn2, P2_HUMIDITY, &humidity);
if (fp) fprintf(fp, "%d %g %g %g %g %g\n",tockaK, u, voltage,current, humidity, temperature);
if (fp) fprintf(fp, "%d %g %g %g %g %g %d\n",tockaK, u, voltage,current, humidity, temperature, status);
if (debugCode) printf("n=%d u=%g voltage=%g current=%g\n",tockaK, u, voltage,current);
if (plivhandle) DeleteGraphPlot (pn2, P2_GRAPHIV, plivhandle, VAL_IMMEDIATE_DRAW);
plivhandle = PlotXY (pn2, P2_GRAPHIV, xpoints, ypoints, tockaK+1, VAL_DOUBLE, VAL_DOUBLE, VAL_CONNECTED_POINTS, VAL_BOLD_X, VAL_SOLID, 1, VAL_RED);
/cvi/instr/K6517/K6517.cws
9,16 → 9,20
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 = 3
Active Project = 1
Number of Projects = 4
Active Project = 4
Project 0001 = "K6517.prj"
Project 0002 = "/c/home/CVI/apps/TempCtrl/TempCtrl.prj"
Project 0002 Folder Source Files Collapsed = True
Project 0002 FolderId 0 Collapsed = True
Project 0003 = "/c/home/CVI/instr/arduino_serial/arduino_serial.prj"
Project 0003 Collapsed = True
Project 0004 = "/c/home/CVI/apps/TempCtrl/TempCtrl_K2231A.prj"
Drag Bar Left = 245
Window Top = 31
Window Left = 122
Window Bottom = 852
Window Right = 1592
Window Top = 267
Window Left = 361
Window Bottom = 1088
Window Right = 1788
Maximized = False
Maximized Children = True
Max32 Number Of Errors = 20
32,7 → 36,7
Hide Windows = False
Break At First Statement = False
Sort Type = "File Name"
Number of Opened Files = 6
Number of Opened Files = 7
Window Confinement Region Enabled = True
MainColumnWidth = 228
FileDateColumnWidth = 70
65,6 → 69,15
Batch Build Release = False
Batch Build Debug = False
 
[Project Header 0004]
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/K6517/K6517.fp"
File Type = "Function Panel"
88,46 → 101,73
In Projects = "2,"
 
[File 0004]
Path = "/c/home/CVI/instr/arduino_serial/arduino_monitor.uir"
File Type = "User Interface Resource"
Disk Date = 3610007003
In Projects = "3,"
Window Top = 33
Window Left = 10
Window Height = 349
Window Width = 619
Path = "/c/home/CVI/instr/K2231A/K2231A.fp"
File Type = "Function Panel"
Disk Date = 3615287792
In Projects = "4,"
 
[File 0005]
Path = "/c/home/CVI/instr/K6517/K6517.c"
File Type = "CSource"
Disk Date = 3614705145
Disk Date = 3614844809
In Projects = "1,"
Window Top = 95
Window Left = 42
Window Z-Order = 1
Source Window State = "1,556,556,556,30,47,47,0,0,148,0,3,0,3,0,36,534,0,552,42,219,683,1,0,"
Window Z-Order = 6
Source Window State = "1,999,1000,1000,0,0,0,0,0,80,0,167,0,3,0,15,984,0,990,28,219,683,1,20,"
 
[File 0006]
Path = "/c/home/CVI/instr/K6517/K6517.h"
File Type = "Include"
Disk Date = 3603694414
In Projects = "1,"
Window Top = 64
Window Left = 26
Source Window State = "1,26,26,26,58,63,63,0,0,80,0,0,0,0,0,15,21,0,26,49,219,683,1,0,"
 
[File 0007]
Path = "/c/home/CVI/instr/K6517/K6517-ctrl.uir"
File Type = "User Interface Resource"
Disk Date = 3614704747
Disk Date = 3615265289
In Projects = "1,"
Window Top = 126
Window Left = 58
Window Height = 219
Window Width = 683
Window Z-Order = 7
 
[File 0007]
Path = "/c/home/CVI/apps/TempCtrl/TempCtrl.c"
File Type = "CSource"
Disk Date = 3615187074
In Projects = "2,"
Window Top = 157
Window Left = 74
Window Z-Order = 4
Source Window State = "1,391,391,391,88,94,88,0,0,80,0,181,0,1,0,23,233,0,275,122,323,683,1,0,"
 
[File 0008]
Path = "/c/home/CVI/apps/TempCtrl/TempCtrl.uir"
File Type = "User Interface Resource"
Disk Date = 3614830800
In Projects = "2,4,"
Window Top = 33
Window Left = 10
Window Height = 323
Window Width = 683
Window Z-Order = 2
 
[File 0009]
Path = "/c/home/CVI/instr/K6517/K6517.h"
File Type = "Include"
Disk Date = 3603694414
In Projects = "1,"
Window Top = 64
Window Left = 26
Source Window State = "1,26,26,26,58,63,63,0,0,0,0,0,0,0,0,0,21,0,26,49,219,683,1,0,"
 
[File 0010]
Path = "/c/home/CVI/instr/arduino_serial/arduino_monitor.uir"
File Type = "User Interface Resource"
Disk Date = 3610007003
In Projects = "3,"
Window Top = 33
Window Left = 10
Window Height = 349
Window Width = 619
 
[File 0011]
Path = "/c/home/CVI/instr/arduino_serial/arduino_monitor.c"
File Type = "CSource"
Disk Date = 3610007125
134,28 → 174,37
In Projects = "3,"
Window Top = 250
Window Left = 122
Source Window State = "1,171,171,171,2,20,20,0,0,80,0,4,0,4,0,25,133,0,154,52,349,683,1,0,"
Source Window State = "1,171,171,171,2,20,20,0,0,0,0,4,0,4,0,0,133,0,154,52,349,683,1,0,"
 
[File 0009]
Path = "/c/home/CVI/apps/TempCtrl/TempCtrl.c"
[File 0012]
Path = "/c/home/CVI/apps/TempCtrl/TempCtrl_K2231A.c"
File Type = "CSource"
Disk Date = 3614665909
In Projects = "2,"
Window Top = 157
Window Left = 74
Window Z-Order = 2
Source Window State = "1,356,359,356,6,119,6,0,0,80,0,181,0,1,0,23,341,0,356,42,323,683,1,0,"
Disk Date = 3615290546
In Projects = "4,"
Window Top = 95
Window Left = 42
Window Z-Order = 1
Source Window State = "1,357,357,357,2,29,29,0,0,143,0,0,0,0,0,25,351,0,364,58,219,683,1,0,"
 
[File 0010]
Path = "/c/home/CVI/apps/TempCtrl/TempCtrl.uir"
File Type = "User Interface Resource"
Disk Date = 3614665758
In Projects = "2,"
[File 0013]
Path = "/c/home/CVI/instr/K2231A/K2231A.c"
File Type = "CSource"
Disk Date = 3615289210
In Projects = ""
Window Top = 126
Window Left = 58
Window Z-Order = 3
Source Window State = "1,224,224,224,16,19,19,0,0,80,0,0,0,0,0,15,2,0,14,11,219,683,1,0,"
 
[File 0014]
Path = "/c/home/CVI/instr/K2231A/K2231A.h"
File Type = "Include"
Disk Date = 3615288659
In Projects = ""
Window Top = 33
Window Left = 10
Window Height = 323
Window Width = 683
Window Z-Order = 6
Window Z-Order = 5
Source Window State = "1,0,0,0,0,0,0,0,0,80,0,0,0,0,0,15,0,0,21,101,219,683,1,0,"
 
[Tab Order]
Tab 0001 = "/c/home/CVI/apps/TempCtrl/TempCtrl.c"
162,6 → 211,9
Tab 0002 = "/c/home/CVI/apps/TempCtrl/TempCtrl.uir"
Tab 0003 = "/c/home/CVI/instr/K6517/K6517.c"
Tab 0004 = "/c/home/CVI/instr/K6517/K6517-ctrl.uir"
Tab 0005 = "/c/home/CVI/apps/TempCtrl/TempCtrl_K2231A.c"
Tab 0006 = "/c/home/CVI/instr/K2231A/K2231A.c"
Tab 0007 = "/c/home/CVI/instr/K2231A/K2231A.h"
 
[Default Build Config 0001 Debug]
Generate Browse Info = True
427,3 → 479,91
Working Directory = ""
Environment Options = ""
 
[Default Build Config 0004 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 0004 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 0004 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 0004 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 0004]
Number of Dependencies = 0
 
[Build Options 0004]
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 0004]
Execution Target Address = "Local desktop computer"
Execution Target Port = 0
Execution Target Type = 0
 
[SCC Options 0004]
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 0004]
External Process Path = ""
 
[Command Line Args 0004]
Command Line Args = ""
Working Directory = ""
Environment Options = ""