?? caiji.c
字號(hào):
#include <cvirte.h>
#include <userint.h>
#include "caiji.h"
#include "pci1780.h"
static int panelHandle;
static int DriverHandle ;
static int ccc ;
static int ddd ;
static double eee ;
static struct PT_CounterConfig nConfig;
static struct PT_CounterEventStart nStart;
static struct PT_CounterEventRead nEventRead;
int main (int argc, char *argv[])
{
if (InitCVIRTE (0, argv, 0) == 0)
return -1; /* out of memory */
if ((panelHandle = LoadPanel (0, "caiji.uir", PANEL)) < 0)
return -1;
DRV_DeviceOpen (0,&DriverHandle);
SetCtrlAttribute (panelHandle, PANEL_TIMER, ATTR_ENABLED, 0);
DisplayPanel (panelHandle);
RunUserInterface ();
DiscardPanel (panelHandle);
DRV_CounterReset (DriverHandle,2);
DRV_DeviceClose (DriverHandle);
return 0;
}
int CVICALLBACK timcb (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{
switch (event)
{
case EVENT_TIMER_TICK:
DRV_CounterEventStart(DriverHandle,&nStart);
DRV_CounterEventRead (DriverHandle,&nEventRead) ;
eee=(double)ddd;
SetCtrlVal (panelHandle, PANEL_NUMERIC, eee);
break;
}
return 0;
}
int CVICALLBACK okcb (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{
switch (event)
{
case EVENT_COMMIT:
nConfig.usCounter=2;
nConfig.usInitValue=1;
nConfig.usCountMode=0;
nConfig.usCountDirect=1;
nConfig.usCountEdge=0;
nConfig.usOutputEnable=1;
nConfig.usOutputMode=0;
nConfig.usClkSrc=1;
nConfig.usGateSrc=0;
nConfig.usGatePolarity=0;
DRV_CounterConfig (DriverHandle,&nConfig);
nStart.counter=2;
nStart.GateMode=0;
SetCtrlAttribute (panelHandle, PANEL_TIMER, ATTR_ENABLED, 1);
nEventRead.counter=2;
nEventRead.overflow=&ccc;
nEventRead.Count=&ddd;
break;
}
return 0;
}
int CVICALLBACK quitcb (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{
switch (event)
{
case EVENT_COMMIT:
QuitUserInterface (0);
break;
}
return 0;
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -