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

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

请问调用CIN时为何程序直接崩溃了?

已解决!
转到解答

大家好:

 

我的labview程序中调用了CIN,但是每当运行到CIN时,程序就会直接崩溃,Labview也关闭了。

但是有的时候又可以通过CIN,请问这是怎么回事?谢谢了!

 

还有如果我单独把CIN的那段代码截取出来单独运行,则崩溃的概率就会小很多。

 

帮忙指点一下,谢谢!

0 项奖励
1 条消息(共 12 条)
6,216 次查看

信息不够。CIN崩溃的可能较多。

你是否用了String或Array输出?有没有allocate enough memory space?

George Zou
2 条消息(共 12 条)
6,191 次查看

你好,非常感谢你的帮助,在程序中的确使用了array输入输出,请问你说的allocate enough memory space是指在c代码中吗?

下面是程序和程序需要输入的数据

希望能得到进一步的帮助

帖子被ylongwu在 04-19-2010 08:52 PM
时编辑过了
下载全部
0 项奖励
3 条消息(共 12 条)
6,182 次查看
抱歉 上面的数据传错了,原数据很大,有100多M
0 项奖励
4 条消息(共 12 条)
6,169 次查看

zip 打不开。memory.png

allocate enough memory 可以在 LabVIEW 中,

也可以在 C 中。

在 LabVIEW 中容易。见右图。

 

George Zou
5 条消息(共 12 条)
6,166 次查看

再次感谢!

 

还有一些问题,由于我的cin里面的lsb是其他人完成的,请问如果我按上面的修改之后,是不是对应的c程序也需要修改?

另外开辟的数组大小是跟CIN的输入数据相关还是跟输出数据相关?输入数据有100M,一维数组。输出数据是一个400*800的二维数组

我把开辟的数组大小设为1000*1000时,程序还是会崩溃,如果设为10000*10000则提示内存不够。

0 项奖励
6 条消息(共 12 条)
6,160 次查看

If you modified the 1D array size in C, then YES, you need modified C program to allocate enough memory.

The new 2D array is for out.  Only output array size matters.

 

You got 2 CINs in your VI.

 

Message Edited by zou on 04-19-2010 09:56 PM
George Zou
7 条消息(共 12 条)
6,156 次查看

Hi,as you say I got 2 CINs in my  VI, and the CIN inside the event case structure also have the same problem.

 

I have changed the labview program based on your tips but it crashed again with any hint.

 

when the data got into the first CINs then after about 10 seconds the labview crashed,some times it just  dead there and I even can not move the front pannel.

 

I only can close it through Task Manager.

 

 

 

 

0 项奖励
8 条消息(共 12 条)
6,144 次查看

when the data got into the first CINs then after about 10 seconds the labview crashed,some times it just  dead there and I even can not move the front pannel.

 

I only can close it through Task Manager.


That's normal when you mess up with memory.  Without look into C code, not much you can do.

I'm sorry.

 

George Zou
9 条消息(共 12 条)
6,136 次查看

Hi,晚上好!

  

    我忽然想到了一件事,当我将含有CINs的那一部分移植到一个新的程序时,新的程序将能很好的给出正确的结果。

 

也就是将程序的其他部分去除,只剩下CINs的输入和输出,则程序能正常的运行,但是当加入后端的数据处理部分时,则运行到CINs那儿就会崩溃。

 

能不能帮忙解释一下这个现象呢,谢谢了!

 

 

0 项奖励
10 条消息(共 12 条)
6,101 次查看