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

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

labview中循环运算的时间占用

因为需要对40M无符号16位数据逐点计数,我在LabVIEW下做了一个1000*20000的循环,也就是循环1000次里嵌套20000循环,空循环运行速度很快,但是只要在循环内加一点点运算,比如,+1运算,速度一下就慢了。完成整个运算大概需要几十秒。
两个图显示程序运行时间差别很大。我用C完成类似运算,大概需要几秒的时间。想问问我的LV程序是不是有问题或者是其他原因。

谢谢!!

下载全部
0 项奖励
1 条消息(共 6 条)
5,763 次查看

接楼上补充一下:

 

我用的是LabVIEW 7.1版本

0 项奖励
2 条消息(共 6 条)
5,758 次查看

Just a quick one... (without understanding what you wished to achieve)

 

Try replace the "adding" using shift-register, instead of reading from its property node.

If allowed, do not update the indicator as well.

 

 

Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010, 2014
依恩与LabVIEW
LVVILIB.blogspot.com
0 项奖励
3 条消息(共 6 条)
5,751 次查看
不要用节点属性,那东西太占CPU时间片了。
0 项奖励
4 条消息(共 6 条)
5,721 次查看

Attached one of ways of adding --- using shift-register

 

e1.GIF

Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010, 2014
依恩与LabVIEW
LVVILIB.blogspot.com
0 项奖励
5 条消息(共 6 条)
5,719 次查看

 

谢谢两位的回答。

已经修改程序,并应用到我的程序里,速度提高很多。

除了利用LabVIEW完成功能外,还要注意优化方法,提高效率。

 

 

0 项奖励
6 条消息(共 6 条)
5,707 次查看