LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error 8 occurred at Read File+ (string): Read File

Solved!
Go to solution


Hello, I am trying to access aspen dynamic simulation data through excel into labview.

The issues I am facing is that the excel file I have to save in csv which I get but due to that the excel file has to be manually saved. when I save the file labview brings up the following error:
"Error 8 occurred at Read File+ (string): Read File"
"LabVIEW: (Hex 0x8) File permission error. You do not have the correct permissions for the file."

If there is anyway I would like to automate excel so that the labview file auto saves and reads the excel file forgoing the csv error and save dialog. I would like this to happen real time.
Please help I am really stuck.
I have attached both error screenshots.
I have attached the screenshots of both the excel dialog and labview error.

0 Kudos
Message 1 of 19
(2,764 Views)

Are you trying to open it in LabVIEW when it is already open in Excel?

0 Kudos
Message 2 of 19
(2,727 Views)

Yes, I want to be able to access the excel file that is being written on dynamically by aspen dynamic and read that data to visualize on labview.
I have attached my current code image, I tried opening the file as csv which I have indeed managed to retrieve data from but the data only refreshes in labview when I save the excel file which I do not want to keep doing manually.

0 Kudos
Message 3 of 19
(2,722 Views)

Well you can't because Excel puts a lock on that file!

 

One thing you could try to do is when you open the file in LabVIEW using the Read-Only input on the Open File.  But I see you are using the Read Delimited file which means no easy way to do that.  You would need to use the more basic file functions, to open the file, read the whole thing, Spreadsheet String to Array functions, then close the file.

 

Why are you transferring data via an Excel file?  What does "aspen dynamic" mean?

 

You might be better off setting up a TCP/IP communication scheme between Excel and LabVIEW to transfer data since it sounds like you want to independent programs functioning at the same time without stepping on each other, but to transfer data between them.

0 Kudos
Message 4 of 19
(2,719 Views)

Aspen dynamic is a dynamic reaction simulation program and I have been able to access the data by using an excel vba script to auto save the excel file ever 0.5 minutes.
The issue is that I want to be able to read and write on specific cells while the aspen software writes on the specific cells.
I have attached the excel and labview files.

Download All
0 Kudos
Message 5 of 19
(2,695 Views)

You have no timing in that loop.  It is trying to read that file as fast as it can, even if nothing has changed.

 

Does the Aspen program close the file when it is done writing to it?  Would it throw an error if it tried to open it to write to it if LabVIEW has it open at that moment?

 

Read my previously comments about not using Read Delimited Files, but rawer file open, read, spreadsheet string to array, and close.  They could help you here.

 

What you need to do is not try to read the file millions of times per second.  Use a File Properties function to check the last modified date every couple seconds.  If the modified date has changed since you last checked it, then you know the file has changed.  So then File Open, read the file, Close it.  Convert the string you read to an array.  If by change you get an error 8 while opening it, wait a little bit and try again.

Message 6 of 19
(2,689 Views)

Hello,

I understand what you meant but cannot find the blocks if you can share a sample VI that would be great.

sorry for the very late reply I was busy and didn't see the forum.

Thanks.

0 Kudos
Message 7 of 19
(2,662 Views)

The excel file is getting modified every second so I do not think that using the modified time part is required because when ever labview accesses the file it will be modified.
I tried doing that based on my understanding but now the file only display static values and do not update as they should when file gets modified.
Please see attachments maybe I made a mistake due to my understanding.

Download All
0 Kudos
Message 8 of 19
(2,653 Views)

Hello,

I need help in accessing labview with excel, I have a process running in the background which dumps data on specific cells and I need to just read the data into labview in real time.

I have been successful in reading the data and displaying it through the normal read delimted function and open >read > close files functions but after every excel save labview values go to zero and then displays actual values.
I would really appreciate it if anyone can help as my dissertation is dependent on this labview excel transfer.

Thanks,

I have attached both excel and lab view files plus the vba script I am using to save the excel every second.

0 Kudos
Message 9 of 19
(2,638 Views)

Hi nsaeed,

 

keep related problems in one thread!

 

but after every excel save labview values go to zero and then displays actual values.

Because you don't handle errors in your VI!

Implement some error handling to avoid displaying "zero" values…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 19
(2,627 Views)