LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Open EXCEL at Runtime

Hello all,

 

Please help me if anyone have any idea about my issue.

 

In my application, I’m saving some information continuously in Excel with LabVIEW Report Generation Tool Kit.

When data is writing into Excel, I want to open/close the same Excel at Runtime. When I’m Trying to open/Close, Some data is missing.

I think may be “Refnum” is missing for next data Iteration. I tried to control Error Messages but still I’m not getting Correct results.

 

Could you please tell me if anyone knows about this.

 

Best Regards,
Munna

Munna
0 Kudos
Message 1 of 22
(2,022 Views)

Why are you trying to open the report when it is being generated. Anyway you can keep the Window state to "Maximized" to see the report generated. Will that be suffucient?

-----

The best solution is the one you find it by yourself
0 Kudos
Message 2 of 22
(1,988 Views)

I’m Running my application for Longtime ( Around 10Days )..So, I want to Check those Results in between That’s I want to Open and See............

 

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

Why are you trying to open the report when it is being generated. Anyway you can keep the Window state to "Maximized" to see the report generated. Will that be suffucient?

-----

The best solution is the one you find it by yourself

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

 

Maximize or minimize will works fine But, Suppose , If user closes this Report (by mistake)  at Runtime then data is missing 😞

 

So, I want to open/Close at Anytime during Testing is Goinig On...............

Munna
0 Kudos
Message 3 of 22
(1,983 Views)

If you say you are running for 10 days, are you keeping the reference open for that many days? Are you continously writing data to the report? I would say open the file only when you are writing data to it other time you can close the report. Please don't use the report generation to store the data.

-----

The best solution is the one you find it by yourself
0 Kudos
Message 4 of 22
(1,980 Views)

Yes.. We want to test for 10days (it means we need open Reference).

 

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

I would say open the file only when you are writing data to it other time you can close the report.Please don't use the report generation to store the data.

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

 

When I'm closing the File for Next time, even though data is missing.

Can you please give me any other Idea to store the data?

At first I used CSV for data storing but Client requested for better report Format & Sometimes he wants read file with LabVIEW (Particular Row/Column data) for Offline Analysis.

Munna
0 Kudos
Message 5 of 22
(1,977 Views)

You should be doing this way. 

 

  • Write the data to the .csv file and check for the size and create a new file when it exceeds certain limit ( lets say 25MB)
  • Create a small tool which takes the data and calculate the data that is required for report (Like averaging, plotting graph and other stuffs)

When you do it this way, whenever you want to see the data, open the tool and generate the report and check it. As simple as it is.

 

Do not log the data to the report. You have the .tdms format also which will help you to see the data, plot graphs. Check which one will be feasible.

-----

The best solution is the one you find it by yourself
0 Kudos
Message 6 of 22
(1,968 Views)

Thanks for your help.

 

Sorry. My problem was not about .csv/.tdms.

 

Because I want to place data into particular Cells in Excel ( Cell values will change at Runtime).

For your Information my Report will not exceed more than 60,000 rows so, no need to Split the File.

So, I want to know, why LabVIEW is losing ActiveX Reference when we are doing Excel Open/Close at Runtime.

Because I’m not deleting this file(just Closing). I think it should not loose.

 

BR,

Munna

 

Munna
0 Kudos
Message 7 of 22
(1,954 Views)

I would say the best solution here would be to write the data to an array structure and then periodically (i.e. once a day/hour) or at the end of your sample time write to excel as you already are. If you have a reasonably frequent update of the excel document (i.e. hourly) then you should be able to view the data while it is running without corrupting anything or worrying about losing your reference.

0 Kudos
Message 8 of 22
(1,938 Views)

@Munna232 wrote:

Thanks for your help.

 

Sorry. My problem was not about .csv/.tdms.

 

Because I want to place data into particular Cells in Excel ( Cell values will change at Runtime).

For your Information my Report will not exceed more than 60,000 rows so, no need to Split the File.

So, I want to know, why LabVIEW is losing ActiveX Reference when we are doing Excel Open/Close at Runtime.

Because I’m not deleting this file(just Closing). I think it should not loose.

 

BR,

Munna

 


Eventhough I am not good with ActiveX reference and how its used in RGT, let me guess what is happening. 

 

When you use the report generation toolkit and initialize the report, actually you are opening the file but keeping the window state "Normal". So you don't see that the file is opened and when you actually open it manually there will not be any problem, but when you close the file then the reference becomes invalid. This is very similar to the case when you keep the window "Maximized" and the reference becomes invalid when you close the file. Please correct me if I am wrong.

-----

The best solution is the one you find it by yourself
0 Kudos
Message 9 of 22
(1,927 Views)

Yes. Correct . When we are closing the File then Loosing it’s reference.

 

May be, we can control RGT error Codes (like my 1st VI). If we know Errors codes (about File open/close) then again we have to reopen same file.

But I don’t know all possible Errors about this operation.

Munna
0 Kudos
Message 10 of 22
(1,918 Views)