退出cvi时,如何将程序中的输入控件当前数值保存为默认值
退出cvi时,如何将程序中的输入控件当前数值保存为默认值???困扰中 一是可以读写文件。另一种是在labwindows/cvi中有一个函数,能保存当前界面的所有控件的值的!具体一下忘了名字!还可以载入的! Saves the current values of all controls on a panel.This function also saves the following control attributes:
Label/value pairs of the list-type controls, and their indices
Minimum, maximum, and increment values for numerics
List box checkmark state values
If you want to retain the data for plots in a graph control, your original array must still be in memory when you call RecallPanelState. Alternatively, you can configure the graph to make a copy of your plot data. You can do this in the User Interface Editor or by calling SetCtrlAttribute with the ATTR_COPY_ORIGINAL_DATA attribute.
Prototype
int SavePanelState (int Panel_Handle, char Filename[], int State_Index);
上面是保存的,下面是读取的!
Reads a panel state from a file you previously created with SavePanelState. If the panel is currently visible, all controls are updated to reflect their new states.
Note If you have modified the panel in the User Interface Editor or programmatically since you saved the panel state, recalling the panel state can fail or erroneously change the current state of the panel.
If one of the controls in the panel is an ActiveX control, any CAObjHandle that you had previously obtained for that control is no longer valid. After calling this function, you must use GetObjHandleFromActiveXCtrl to obtain a new handle.
Prototype
int RecallPanelState (int Panel_Handle, char Filename[], int State_Index);
回复 1# fanzhenjun 的帖子
右击输入控件——数据操作——当前值设置为默认值,然后将VI保存,下次再打开的时候就是默认值了 回复fanzhenjun 的帖子
右击输入控件——数据操作——当前值设置为默认值,然后将VI保存,下次再 ...
wangchao685 发表于 2010-7-16 11:38 http://www.cpubbs.com/bbs/static/image/common/back.gif
哥们搞错了。CVI中没有这个。你说的VI是LABVIEW 回复 cvifan 的帖子
不好意思啊 回复 wangchao685 的帖子
谢谢老兄,我没看懂,能详细点吗?用二楼的可以实现. 请问问题解决了没有 lvhu1987 发表于 2016-6-20 18:41
请问问题解决了没有
3,4楼不是有答案么哥们
这个问题解决了没,savepanelstate这个函数我怎么不会用啊
cpubbs 发表于 2010-7-15 23:48
一是可以读写文件。另一种是在labwindows/cvi中有一个函数,能保存当前界面的所有控件的值的!具体一下忘了 ...
求指教
int SavePanelState (int Panel_Handle, char Filename[], int State_Index);
第一个是面板的handle这个你肯定有了,第二个是路径,第三个是索引号,保存的这状态的索引,你定义一个变量存一个值,到时候要重新载入的时候,也要输入相同的值!
页:
[1]