NI LabVIEW,CVI,数据采集等产品讨论区

取消
显示结果 
搜索替代 
您的意思是: 

请教panel的问题! 如何区分panel/panelHandle等?

恳请各位xdjm解答,谢谢!



sample.uir包括两个panel,Constant Name分别为PANEL和TESTPANEL.
在PANEL上有个string,用
int GetCtrlVal (int Panel_Handle, int Control_ID, void *Value);
函数来取string的值时,书上写的是
GetCtrVal(panel,PANEL_STRING,string);
我不明白的是参数里的panel这个参数.它代表什么?为什么不是panelHandle呢?
generate all code时,Select panels to load....里的Panel Variable Name选项里的参数是什么意思?什么时候该用这个参数呢?
另外如果有几个panel的话,每个panel的Panel Variable Name参数在什么地方能够编辑呢?
我做过试验,好像上面函数里的那个panel用panelHandle也可以阿,为什么?


这个地方我实在是不明白,如果有什么资料的话,更加感激了,谢谢

0 项奖励
1 条消息(共 2 条)
3,992 次查看
关于cvi的函数,可以参看labwindows CVI Help这个帮助文档,是chm格式的,再装了软件之后都会有的。
 
参考这个:

GetCtrlVal

int GetCtrlVal (int panelHandle, int controlID, void *value);

Purpose

Obtains the current value of a control.

When the control ID is for a list box or ring control, GetCtrlVal returns the value of the currently selected list item. To obtain the index of the selected list item, use GetCtrlIndex.

Note   This function is not valid for graph and strip chart controls.

Parameters

Input
Name Type Description
panelHandle integer Specifier for a particular panel that is currently in memory. You obtain this handle from LoadPanel, NewPanel, or DuplicatePanel.
controlID integer The defined constant, located in the .uir header file, that you assigned to the control in the User Interface Editor, or the ID returned by NewCtrl or DuplicateCtrl.
Output
Name Type Description
value void * The control value. The data type of value must match the data type of the control.

Return Value

Name Type Description
status integer Return value indicating whether the function was successful. A negative number indicates that an error occurred.

Code Error Message String
xx

Success

0 项奖励
2 条消息(共 2 条)
3,989 次查看