Subversion Repositories f9daq

Compare Revisions

Ignore whitespace Rev 235 → Rev 236

/cvi/instr/socket/testcli/testcli.prj
0,0 → 1,393
[Project Header]
Version = 1302
Pathname = "/c/home/CVI/RedPitaya/testcli/testcli.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"
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 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 = 2
Target Type = "Executable"
Flags = 2064
Copied From Locked InstrDrv Directory = False
Copied from VXIPNP Directory = False
Locked InstrDrv Name = ""
Don't Display Deploy InstrDrv Dialog = False
 
[Folders]
Include Files Folder Not Added Yet = True
Instrument Files Folder Not Added Yet = True
Library Files Folder Not Added Yet = True
Folder 0 = "User Interface Files"
FolderEx 0 = "User Interface Files"
Folder 1 = "Source Files"
FolderEx 1 = "Source Files"
 
[File 0001]
File Type = "User Interface Resource"
Res Id = 1
Path Is Rel = True
Path Rel To = "Project"
Path Rel Path = "testcli_ui.uir"
Path = "/c/home/CVI/RedPitaya/testcli/testcli_ui.uir"
Exclude = False
Project Flags = 0
Folder = "User Interface Files"
Folder Id = 0
 
[File 0002]
File Type = "CSource"
Res Id = 2
Path Is Rel = True
Path Rel To = "Project"
Path Rel Path = "testcli_ui.c"
Path = "/c/home/CVI/RedPitaya/testcli/testcli_ui.c"
Exclude = False
Compile Into Object File = False
Project Flags = 0
Folder = "Source Files"
Folder Id = 1
 
[Custom Build Configs]
Num Custom Build Configs = 0
 
[Default Build Config Debug]
Config Name = "Debug"
Is 64-Bit = False
Is Release = False
Default Calling Convention = "cdecl"
Optimization Level = "Optimize for speed (level 2)"
Require Prototypes = True
Show Warning IDs in Build Output = False
Selected Warning Level = "Common"
Warning List None = ""
Warning List Common = ""
Warning List Extended = ""
Warning List All = ""
Warning Mode = 0
Enable Unreferenced Identifiers Warning = True
Enable Pointer Mismatch Warning = True
Enable Unreachable Code Warning = True
Enable Assignment In Conditional Warning = True
Uninitialized Locals Compile Warning = "Aggressive"
Require Return Values = True
Enable C99 Extensions = True
Enable OpenMP Extensions = False
Stack Size = 250000
Stack Reserve = 1048576
Stack Commit = 4096
Image Base Address = 4194304
Image Base Address x64 = 4194304
Compiler Defines = "/DWIN32_LEAN_AND_MEAN"
Sign = False
Sign Store = ""
Sign Certificate = ""
Sign Timestamp URL = ""
Sign URL = ""
Manifest Embed = False
Icon File Is Rel = False
Icon File = ""
Application Title = ""
Use IVI Subdirectories for Import Libraries = False
Use VXIPNP Subdirectories for Import Libraries = False
Use Dflt Import Lib Base Name = True
Where to Copy DLL = "Do not copy"
Custom Directory to Copy DLL Is Rel = False
Custom Directory to Copy DLL = ""
Generate Source Documentation = "None"
Runtime Support = "Full Runtime Support"
Runtime Binding = "Shared"
Embed Project .UIRs = False
Generate Map File = False
Embed Timestamp = True
Create Console Application = False
Using LoadExternalModule = False
DLL Exports = "Include File Symbols"
Register ActiveX Server = False
Add Type Lib To DLL = False
Include Type Lib Help Links = False
TLB Help Style = "HLP"
Type Lib FP File Is Rel = False
Type Lib FP File = ""
 
[Default Build Config Release]
Config Name = "Release"
Is 64-Bit = False
Is Release = True
Default Calling Convention = "cdecl"
Optimization Level = "Optimize for speed (level 2)"
Require Prototypes = True
Show Warning IDs in Build Output = False
Selected Warning Level = "Common"
Warning List None = ""
Warning List Common = ""
Warning List Extended = ""
Warning List All = ""
Warning Mode = 0
Enable Unreferenced Identifiers Warning = True
Enable Pointer Mismatch Warning = True
Enable Unreachable Code Warning = True
Enable Assignment In Conditional Warning = True
Uninitialized Locals Compile Warning = "Aggressive"
Require Return Values = True
Enable C99 Extensions = True
Enable OpenMP Extensions = False
Stack Size = 250000
Stack Reserve = 1048576
Stack Commit = 4096
Image Base Address = 4194304
Image Base Address x64 = 4194304
Compiler Defines = "/DWIN32_LEAN_AND_MEAN"
Sign = False
Sign Store = ""
Sign Certificate = ""
Sign Timestamp URL = ""
Sign URL = ""
Manifest Embed = False
Icon File Is Rel = False
Icon File = ""
Application Title = ""
Use IVI Subdirectories for Import Libraries = False
Use VXIPNP Subdirectories for Import Libraries = False
Use Dflt Import Lib Base Name = True
Where to Copy DLL = "Do not copy"
Custom Directory to Copy DLL Is Rel = False
Custom Directory to Copy DLL = ""
Generate Source Documentation = "None"
Runtime Support = "Full Runtime Support"
Runtime Binding = "Shared"
Embed Project .UIRs = False
Generate Map File = False
Embed Timestamp = True
Create Console Application = False
Using LoadExternalModule = False
DLL Exports = "Include File Symbols"
Register ActiveX Server = False
Add Type Lib To DLL = False
Include Type Lib Help Links = False
TLB Help Style = "HLP"
Type Lib FP File Is Rel = False
Type Lib FP File = ""
 
[Default Build Config Debug64]
Config Name = "Debug64"
Is 64-Bit = True
Is Release = False
Default Calling Convention = "cdecl"
Optimization Level = "Optimize for speed (level 2)"
Require Prototypes = True
Show Warning IDs in Build Output = False
Selected Warning Level = "Common"
Warning List None = ""
Warning List Common = ""
Warning List Extended = ""
Warning List All = ""
Warning Mode = 0
Enable Unreferenced Identifiers Warning = True
Enable Pointer Mismatch Warning = True
Enable Unreachable Code Warning = True
Enable Assignment In Conditional Warning = True
Uninitialized Locals Compile Warning = "Aggressive"
Require Return Values = True
Enable C99 Extensions = True
Enable OpenMP Extensions = False
Stack Size = 250000
Stack Reserve = 1048576
Stack Commit = 4096
Image Base Address = 4194304
Image Base Address x64 = 4194304
Compiler Defines = "/DWIN32_LEAN_AND_MEAN"
Sign = False
Sign Store = ""
Sign Certificate = ""
Sign Timestamp URL = ""
Sign URL = ""
Manifest Embed = False
Icon File Is Rel = False
Icon File = ""
Application Title = ""
Use IVI Subdirectories for Import Libraries = False
Use VXIPNP Subdirectories for Import Libraries = False
Use Dflt Import Lib Base Name = True
Where to Copy DLL = "Do not copy"
Custom Directory to Copy DLL Is Rel = False
Custom Directory to Copy DLL = ""
Generate Source Documentation = "None"
Runtime Support = "Full Runtime Support"
Runtime Binding = "Shared"
Embed Project .UIRs = False
Generate Map File = False
Embed Timestamp = True
Create Console Application = False
Using LoadExternalModule = False
DLL Exports = "Include File Symbols"
Register ActiveX Server = False
Add Type Lib To DLL = False
Include Type Lib Help Links = False
TLB Help Style = "HLP"
Type Lib FP File Is Rel = False
Type Lib FP File = ""
 
[Default Build Config Release64]
Config Name = "Release64"
Is 64-Bit = True
Is Release = True
Default Calling Convention = "cdecl"
Optimization Level = "Optimize for speed (level 2)"
Require Prototypes = True
Show Warning IDs in Build Output = False
Selected Warning Level = "Common"
Warning List None = ""
Warning List Common = ""
Warning List Extended = ""
Warning List All = ""
Warning Mode = 0
Enable Unreferenced Identifiers Warning = True
Enable Pointer Mismatch Warning = True
Enable Unreachable Code Warning = True
Enable Assignment In Conditional Warning = True
Uninitialized Locals Compile Warning = "Aggressive"
Require Return Values = True
Enable C99 Extensions = True
Enable OpenMP Extensions = False
Stack Size = 250000
Stack Reserve = 1048576
Stack Commit = 4096
Image Base Address = 4194304
Image Base Address x64 = 4194304
Compiler Defines = "/DWIN32_LEAN_AND_MEAN"
Sign = False
Sign Store = ""
Sign Certificate = ""
Sign Timestamp URL = ""
Sign URL = ""
Manifest Embed = False
Icon File Is Rel = False
Icon File = ""
Application Title = ""
Use IVI Subdirectories for Import Libraries = False
Use VXIPNP Subdirectories for Import Libraries = False
Use Dflt Import Lib Base Name = True
Where to Copy DLL = "Do not copy"
Custom Directory to Copy DLL Is Rel = False
Custom Directory to Copy DLL = ""
Generate Source Documentation = "None"
Runtime Support = "Full Runtime Support"
Runtime Binding = "Shared"
Embed Project .UIRs = False
Generate Map File = False
Embed Timestamp = True
Create Console Application = False
Using LoadExternalModule = False
DLL Exports = "Include File Symbols"
Register ActiveX Server = False
Add Type Lib To DLL = False
Include Type Lib Help Links = False
TLB Help Style = "HLP"
Type Lib FP File Is Rel = False
Type Lib FP File = ""
 
[Compiler Options]
Default Calling Convention = "cdecl"
Require Prototypes = True
Require Return Values = True
Enable Pointer Mismatch Warning = True
Enable Unreachable Code Warning = True
Enable Unreferenced Identifiers Warning = True
Enable Assignment In Conditional Warning = True
O Option Compatible With 5.0 = False
Enable C99 Extensions = True
Uninitialized Locals Compile Warning = "Aggressive"
Precompile Prefix Header = False
Prefix Header File = ""
 
[Run Options]
Stack Size = 250000
Stack Commit = 4096
Image Base Address = 4194304
Image Base Address x64 = 4194304
 
[Compiler Defines]
Compiler Defines = "/DWIN32_LEAN_AND_MEAN"
 
[Create Executable]
Executable File_Debug Is Rel = True
Executable File_Debug Rel To = "Project"
Executable File_Debug Rel Path = "testcli.exe"
Executable File_Debug = "/c/home/CVI/RedPitaya/testcli/testcli.exe"
Executable File_Release Is Rel = True
Executable File_Release Rel To = "Project"
Executable File_Release Rel Path = "testcli.exe"
Executable File_Release = "/c/home/CVI/RedPitaya/testcli/testcli.exe"
Executable File_Debug64 Is Rel = True
Executable File_Debug64 Rel To = "Project"
Executable File_Debug64 Rel Path = "testcli.exe"
Executable File_Debug64 = "/c/home/CVI/RedPitaya/testcli/testcli.exe"
Executable File_Release64 Is Rel = True
Executable File_Release64 Rel To = "Project"
Executable File_Release64 Rel Path = "testcli.exe"
Executable File_Release64 = "/c/home/CVI/RedPitaya/testcli/testcli.exe"
Icon File Is Rel = False
Icon File = ""
Application Title = ""
DLL Exports = "Include File Symbols"
Use IVI Subdirectories for Import Libraries = False
Use VXIPNP Subdirectories for Import Libraries = False
Use Dflt Import Lib Base Name = True
Where to Copy DLL = "Do not copy"
Custom Directory to Copy DLL Is Rel = False
Custom Directory to Copy DLL = ""
Generate Source Documentation = "None"
Add Type Lib To DLL = False
Include Type Lib Help Links = False
TLB Help Style = "HLP"
Type Lib FP File Is Rel = False
Type Lib FP File = ""
Type Lib Guid = ""
Runtime Support = "Full Runtime Support"
Instrument Driver Support Only = False
Embed Project .UIRs = False
Generate Map File = False
 
[External Compiler Support]
UIR Callbacks File Option = 0
Using LoadExternalModule = False
Create Project Symbols File = True
UIR Callbacks Obj File Is Rel = False
UIR Callbacks Obj File = ""
Project Symbols H File Is Rel = False
Project Symbols H File = ""
Project Symbols Obj File Is Rel = False
Project Symbols Obj File = ""
 
[ActiveX Server Options]
Specification File Is Rel = False
Specification File = ""
Source File Is Rel = False
Source File = ""
Include File Is Rel = False
Include File = ""
IDL File Is Rel = False
IDL File = ""
Register ActiveX Server = False
 
[Signing Info]
Sign = False
Sign Debug Build = False
Store = ""
Certificate = ""
Timestamp URL = ""
URL = ""
 
[Manifest Info]
Embed = False
 
[tpcSection]
tpcEnabled = 0
tpcOverrideEnvironment = 0
tpcEnabled x64 = 0
tpcOverrideEnvironment x64 = 0
 
/cvi/instr/socket/testcli/testcli_ui.c
0,0 → 1,104
#include <utility.h>
#include <ansi_c.h>
#include <tcpsupp.h>
#include <cvirte.h>
#include <userint.h>
#include "testcli_ui.h"
 
static int panelHandle;
static CmtThreadPoolHandle poolHandle = 0;
#define MAX_THREADS 10
 
static unsigned int chandle = 0;
static int tfID;
 
int main (int argc, char *argv[]) {
if (InitCVIRTE (0, argv, 0) == 0)
return -1; /* out of memory */
SetStdioPort (CVI_STDIO_WINDOW);
SetSleepPolicy(VAL_SLEEP_MORE);
CmtNewThreadPool (MAX_THREADS, &poolHandle);
if ((panelHandle = LoadPanel (0, "testcli_ui.uir", PANEL)) < 0)
return -1;
DisplayPanel (panelHandle);
RunUserInterface ();
DiscardPanel (panelHandle);
return 0;
}
 
 
int CVICALLBACK SocketCB (unsigned handle, int xType, int errCode, void *callbackData) {
 
int nb = 0 ;
 
const int maxlen=0xFF;
char msg[maxlen];
for (int i=0;i<maxlen; i++) msg[i]=0;
switch (xType) {
case TCP_DISCONNECT:
printf("TCP_DISCONNECT ErrorString %s\n",GetTCPErrorString(errCode));
printf("TCP_DISCONNECT SystemErrorString %s\n",GetTCPSystemErrorString());
//DisconnectFromTCPServer (&chandle);
chandle = 0;
break;
case TCP_DATAREADY: {
int hdr[2]={0,0};
nb = ClientTCPRead(handle,&hdr[0],8,1000);
int size = hdr[1] - 8;
if (size>maxlen) size=maxlen;
nb = 0;
while (nb < size) {
int retval = ClientTCPRead(handle,&msg[nb],size-nb,1000);
if (retval<1) break;
nb += retval;
}
printf("Received RECID %d LEN %d: %s\n", hdr[0], hdr[1],msg);
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;
}
 
int CVICALLBACK SendCB (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2) {
char data[0xFF];
char *msg = &data[8];
int *hdr = data;
static int ncount=0;
switch (event) {
case EVENT_COMMIT:
GetCtrlVal(panel,PANEL_TXT , msg);
sprintf(msg,"%s %d\n", msg, ncount++);
hdr[0]=ncount%4;
hdr[1]=strlen(msg) + 8;
ClientTCPWrite(chandle,data,hdr[1],1000); // init
break;
}
return 0;
}
 
int CVICALLBACK ConnectCB (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2) {
switch (event) {
case EVENT_COMMIT:
ConnectToTCPServerEx (&chandle, 3210, "192.168.1.254", SocketCB, NULL, 0, TCP_ANY_LOCAL_PORT);
break;
}
return 0;
}
/cvi/instr/socket/testcli/testcli_ui.h
0,0 → 1,42
/**************************************************************************/
/* LabWindows/CVI User Interface Resource (UIR) Include File */
/* */
/* WARNING: Do not add to, delete from, or otherwise modify the contents */
/* of this include file. */
/**************************************************************************/
 
#include <userint.h>
 
#ifdef __cplusplus
extern "C" {
#endif
 
/* Panels and Controls: */
 
#define PANEL 1
#define PANEL_CONNECT 2 /* control type: command, callback function: ConnectCB */
#define PANEL_EXIT 3 /* control type: command, callback function: ExitCB */
#define PANEL_SEND 4 /* control type: command, callback function: SendCB */
#define PANEL_TXT 5 /* control type: string, callback function: (none) */
 
 
/* Control Arrays: */
 
/* (no control arrays in the resource file) */
 
 
/* Menu Bars, Menus, and Menu Items: */
 
/* (no menu bars in the resource file) */
 
 
/* Callback Prototypes: */
 
int CVICALLBACK ConnectCB(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 SendCB(int panel, int control, int event, void *callbackData, int eventData1, int eventData2);
 
 
#ifdef __cplusplus
}
#endif
/cvi/instr/socket/testcli/testcli_ui.uir
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property