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

Lag Issues When Stopping LabVIEW Code Execution

已解决!
转到解答

Hello, I am a student studying LabVIEW.
I would like to ask about an issue where the system lags when stopping LabVIEW code after execution.

 

To explain in detail, after running LabVIEW code that collects data and pressing the stop button, the code does not stop immediately, and the screen freezes. The longer the code runs, the longer the screen remains frozen.

 

At this time, as shown in the first picture, the hard disk usage reaches 94%, and the write speed becomes abnormally slow (around a few hundred KB/s).


Since the hard disk is new, I don't think it's a hardware failure.
Is this a common issue? Do others experience this problem as well?

Thank you for reading.

下载全部
0 项奖励
1 条消息(共 12 条)
1,861 次查看
解答
接受人 wlsrb2048

It looks like you're writing a lot of data to disk, and it takes time proportional to the data size, so when you stop the LV code, the code and OS are still busy writing the data to disk and, hence, it feels like it stalled and then closes.

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution
2 条消息(共 12 条)
1,849 次查看

Thank you for your response.
As you mentioned, I am indeed storing large amounts of data.
I was worried about the disk speed degradation and the disk usage reaching 100%, but it seems like everything is functioning normally.
Thank you!

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

You can add Flush File Function to your code, call it time to time to avoid "freezing" at App's close.

4 条消息(共 12 条)
1,805 次查看
解答
接受人 wlsrb2048

The low write speed suggests lots of small and random writes, probably also including opening and closing the file refrence. Is that the case?

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 项奖励
5 条消息(共 12 条)
1,793 次查看

Your description and pictures are not really useful to troubleshoot the problem.

 

Does pressing the stop button trigger the file saving? (i.e. part of the shutdown code after the main loop?)

What format is the data saved?

How big are the resulting file(s)?

 

Who wrote the program? What is the overall architecture? We probably would need to see your LabVIEW code to offer improved suggestions.  For example you could stream the data to disk as simple binary data.

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

It seems that the case you mentioned is also having an impact. Thank you!

 

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

The files are saved in TDMS format with a size of 700KB, and 120 files are saved over 12 seconds.

I suspect the issue arises due to the large number of files.

I will contact you if further assistance is needed. Thank you for your response!

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

@wlsrb2048 wrote:

The files are saved in TDMS format with a size of 700KB, and 120 files are saved over 12 seconds.

I suspect the issue arises due to the large number of files.

I will contact you if further assistance is needed. Thank you for your response!


TDMS is an effective format, just open the file ref. at start and write them all to the same file. If needed, there are defragmentation tools that can be used afterwards.

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 项奖励
9 条消息(共 12 条)
1,754 次查看

@wlsrb2048 wrote:

It seems that the case you mentioned is also having an impact. Thank you!


This is a long thread with many replies and It is impossible to tell what "case" you are referring to.

Make sure to always quote relevant parts of the earlier post (as I just did here).

 

We still don't know if these 120 files are only beginning to be saved when you stop the program

 

We can also tell that this is a conventional HDD, not a SSD, so don't expect blazing speeds. The maxed out write speed is less than 1MB/s as shown in your image!

 

altenbach_1-1729004253425.png

 

 

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