LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

file opening error

Hello everyone,
 
I know this is a very simple question but will like to know why do i keep on getting the error message that the file is already opened ? and close the previous file.
 
Kindly, see the description about the rror and the block diagram in the attached sheet.
 
Thanks
0 Kudos
Message 1 of 11
(3,622 Views)
If you've already opened the file in Excel, Excel puts a lock on the file preventing another program from opening it.
 
But this looks like and excel error message.  And it looks like you already have the spreadsheet open in the background.  So are you trying to open the same file twice?
 
Perhaps you can list the steps you are doing to get the error message as it relates to running the LV programing and opening the Excel file?
0 Kudos
Message 2 of 11
(3,605 Views)
step 1.
I make sure no other excel file is opened. Close all MS word/excel sheets

step2.
save and run the vi

step3
after a while it asks where to save the data and the name of the file. I give it as data.xls and then it says a file already exits by that name , do you want to over write it. I will say , yes.

step4.
VI finishes runnin the code and then i go back to the location where the file was saved. I double click it and i can see the data behind the pop up screen of the error. So far there is no  excel sheet opened other than the one called data.xls.

step5.
This is the same flow even if i try to save the file under a diffenet name. Instead of data.xls , if i say data123.xls i will still get the same error as shown in the attached document above.

0 Kudos
Message 3 of 11
(3,599 Views)
I tried duplicating your code in LV 8.5, but I'm not seeing the error.  Which version of LV are you running?
 
Try putting a file close function after your file write.  Make sure you wire up the file refnum between the two.  See what happens.
0 Kudos
Message 4 of 11
(3,592 Views)
Hello there,
 
let me go one step  back and explain the flow of interface usingthe attached document.
 
a) do i have to select any tihng from the drop down menu as indicated on the attached sheet.
 
b) i am reading analog signal from the transducer at the interval of 30sec. so the transducer gives voltage in 30sec and then 60 sec and then 90sec.... in between 30th and 60th sec there is noise introduced by the external circuitary and will like to know if there is any option to reduce that noise.
0 Kudos
Message 5 of 11
(3,546 Views)
Could you post your vi so that we can try to reproduce the error?

And to answer your questions:
a. The value will be passed from the main VI that calls this subVI so no, you dont have to enter anything.
b. Is this noise expected? If so, it depends on the type of noise but you can try to filter the signal using the filters within LabVIEW.

Vikas
0 Kudos
Message 6 of 11
(3,538 Views)
Thanks for your prompt reply. I am using Labview ver 8. And the objective over here is to make an excel sheet for the analog samples from a transducer. So the transducer outputs voltage values after every 30sec and then i am using USB DAQ to see the results in graphical format and then also to record them in an excel sheet.
 
Let me know if there is another way to proceed instead of using the FOR LOOP for faster data acquisitions.
 
Also, this noise should not be present and removed. About the filter in labview. Is it recommended to use hardware filter before the signal enters the DAQ or in labview after it has entered the DAQ board.
 
Once again many thanks and i look forward to your reply.
 
 
Download All
0 Kudos
Message 7 of 11
(3,515 Views)
This error message is not the same one that you mentioned when you started this thread.
 
Error 43 is a normal error that occurs when you hit the cancel button on the file button dialog.  If you don't want to write to the file and have the program continue, you will have to clear error 43.  There are functions on the Errors palette  that will handle it.
 
You don't have any file path control or constant set up in your VI.  So it will ask you for a filename each and everytime that the write to file occurs.  That would be 50 times!.  I don't think that is what you want.  Have a file open dialog before the start of the loop to get the file name.
 
For the noise, the easiest method would be to sample at a higher rate and use the filter VI's to reduce the noise or average the data together.  You can use a hardware filter, but that would likely be more trouble than its worth to create in a simple application.
0 Kudos
Message 8 of 11
(3,504 Views)
I agree with Ravens Fan about using a software filter as opposed to hardware ones.
 
What are your voltage levels? I have had a similar issue while trying to acquire low voltage output from a thermocouple using the USB6009 DAQ card and the only way I could get smooth readings was by doing a moving average.  None of the LPFs in LabVIEW could do the job!
 
About the write to file and an efficient way to program data acquisition routine, see the attached pic.  I hope this helps.
 
 
0 Kudos
Message 9 of 11
(3,483 Views)
Thanks ... its working. i will interface with sensor and keep you posted. Once again many thanks for your advice
0 Kudos
Message 10 of 11
(3,432 Views)