LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

使用“写入电子表格文​件”把测试数据写入文​件,每点击一下按钮就​写一次,添加方式,遇​到的问题是:.

问题:如果要写入的csv文件已经打开,这时候,程序无法写入,就会报错,如何解决这个问题?比如可不可以​,程序先判断文件是否打开,如果打开的话就先关闭,然后再写数据进去。

0 Kudos
Message 1 of 4
(2,545 Views)

English Translation (thanks to Google)

 

Use the "Write To Spreadsheet file" to write the test data file, click the button to write each one, add the method to the problem encountered

 

 

Question: If you want to write to a  csv file that is already open, the program cannot write to it.  It generates an  error.

 How to solve this problem?

 

For example, can the program first determine whether the file is open?  If so, it would closed the file, and then write the data into it.

 

 


===============================================

 

Answer:

 

I do not have problems writing to the file although it is already opened by other applications, such as Notepad or TextPad.

I even opened the file using the Open File vi, read the file and left the reference open.

 

Can you post your code?

 

我没有问题写入文件,尽管它已经被其他应用程序,如记事本或TextPad开幕。

我什至打开文件使用打开文件六,阅读文件,离开了参考开放。

你可以发布您的代码?

 

 

 

0 Kudos
Message 2 of 4
(2,538 Views)

你有没有收到任何错误讯息?我相信这是一个文件的权限问题。文件的权限设置是什么你可以考虑制定该文件的副本在副本上修改

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
0 Kudos
Message 3 of 4
(2,532 Views)

English Translation:

Did you receive any error messages? I believe this is a file permissions problem. File permissions settings? You may consider making a copy of the file, and modify the copy


What Jyang suggested makes sense..  Do you get the following error?

 

 

Let us know if you must open the same file or if saving a copy with write and read permissions is acceptable.  Please explain what you are trying to do.

 

什么Jyang建议是有道理的..你明白了下面的错误

让我们知道,如果你必须打开相同的文件或者保存一个具有写入和读取权限是可以接受的副本。解释一下你正在尝试做的

0 Kudos
Message 4 of 4
(2,527 Views)