C VI=C+VI
BY:AE刘晓松,Xiaosong.Liu-AE@https://www.doczj.com/doc/826619622.html, 快捷键
F1 类似MSDN,打开函数帮助文档
Ctrl+I 插入面板对应函数到C文档中鼠标所在位置
Ctrl+F 快速查询
Ctrl+Shift+P 快速查询函数面板选择对话框
Crtl+P 快速打开鼠标所在位置函数对应的面板
Ctrl+D 打开函数面板上对应参数的声明对话框
右键单击函数面板空白位置----自动弹出该函数的说明信息;
右键单击函数面板中对应的参数对话框----自动弹出该参数的说明信息Shift+F2 在鼠标所在行快速添加一个标签
F2 切换到下一个标签所在位置
Ctrl+F2 切换到上一个标签所在位置
Ctrl+E 快速注释一行代码(变灰)
F9 添加-删除断点
备注:函数返回值为负的一般是错误的!
----常用调试快捷键----
Continue
Go to Cursor
Set Next Statement
Step Into
Step Over
Finish Function
Terminate Execution
User Interface Library
Panels
Load Panel LoadPanel
Load Panel (Extended) LoadPanelEx
Display Panel DisplayPanel
Hide Panel HidePanel---Clears a panel from the screen but leaves it in the memory
Set PanelAttribute SetPanelAttribute
Get PanelAttribute GetPanelAttribute
Pop-up Panels?Message/Prompt Popups
Message Popup MessagePopup
Controls/Graphs/Strip Charts?General Functions
Set Control Value SetCtrlVal
Get Control Value GetCtrlVal
Set Control Attribute SetCtrlAttribute
Get Control Attribute GetCtrlAttribute
User Interface Management
Run User Interface RunUserInterface
Quit User Interface QuitUserInterface
Controls/Graphs/Strip Charts?Graphs and Strip Charts?Graph Plotting and Deleting
Plot Y PlotY
Delete Graph Plot DeleteGraphPlot
Controls/Graphs/Strip Charts?Graphs and Strip Charts?Strip Chart Traces Plot Strip Chart PlotStripChart
Clear Strip Chart ClearStripChart
在调用一个用户界面时候按照以下操作流程:
LoadPanel -> DisplayPanel -> RunUserInterface
QuitUserInterface -> DiscardPanel
首先用户界面时候,在Load时候就是将资源加载,并返回该Panel对应的一个编号(int Panel = LoadPanel(*,*,));在后续DisplayPanel、RunUserInterface、QuitUserInterface与DiscardPanel时候就是使用Panel作为访问接口。
LoadPanel说明
int LoadPanel (int parentPanelHandle, char filename[], int panelResourceID);
Loads a panel into memory from a user interface resource (.uir) file or text user interface (.tui) file you created in the User Interface Editor.
parentPanelHandle -- Handle of the panel into which to load the panel as a child panel. Pass 0 to load the panel as a top-level window.
CVI运行元素
Panel:程序运行面板
Control:控件
Event:事件,也就是对应“*.C”中的Callback函数
Data:Data可以是用户定义或者系统函数参数返回给我们的,可以拿来用与判断、传值、触发响应等。
CVI GUI Events
Control and Menu events
EVENT_COMMIT
Control Event
EVENT_VAL_CHANGED
Control and Panel Event
EVENT_LEFT_CLICK
EVENT_LEFT_DOUBLE_CLICK
EVENT_RIGHT_CLICK
EVENT_RIGHT_DOUBLE_CLICK
EVENT_KEYPRESS
EVENT_GOT_FOCUS
EVENT_LOST_FOCUS
Panel Event
EVENT_CLOSE
EVENT_PANEL_SIZE
EVENT_PANEL_MOVE
Continuous Event
EVENT_TIMER_TICK
Processing Events
EventsHandler functions
RunUserInterface
QuitUserInterface
ProcessDrawEvents
ProcessSystemEvents
Pop-Up Panels
MessagePopup ("LabWindows/CVI“, "CVI Rocks");
ConfirmPopup ("This is a ConfirmPopup", "Press Yes or No");
PromptPopup ("Prompt Me", "Please Enter Your Login Name Below", login, 10); Timer
EVENT_TIMER_CLICK
CVI数据采集
DAQmxCreateTask();
DAQmxCreateAIVoltageChan();
DAQmxStartTask();
DAQmxReadAnalogScalarF64();
DAQmxStopTask();
DAQmxClearTask();
模拟采集
模拟输出
数字端口输入
数字端口输出