LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error 7 with Report Generation Toolkit

Solved!
Go to solution

Hello Everyone,

 

I'm trying to generate an Excel sheet report for some readings using "Report Generation toolkit" But when trying to generate the report, the report generation part of code is executed and gives Error(7) and there is no report is generated.

 

The Code I use is atached in the following Link:

https://www.dropbox.com/s/9n4brimucsd0xts/Report%20Generation.rar

 

Can I get help please?

 

Thanks in advance 🙂

0 Kudos
Message 1 of 17
(4,732 Views)

The downloaded rar is 30k in size and corrupt. 

Is it just me?

0 Kudos
Message 2 of 17
(4,707 Views)

No It works !

 

Please Try again 🙂

0 Kudos
Message 3 of 17
(4,696 Views)

@ahmelsayed wrote:

No It works !

 

Please Try again 🙂


Same result: corrupt file is again 30k in size.  I give up.

0 Kudos
Message 4 of 17
(4,690 Views)
Don't use .rar and don't use some third party site. Directly attach a zip.
0 Kudos
Message 5 of 17
(4,683 Views)
Solution
Accepted by topic author ahmelsayed

I was able to download and open your compressed file.  I unpacked it into a folder.

 

There are numerous peculiarities that lead me to ask "Are you trying to learn LabVIEW on your own, without a mentor and without training and guidance"?  Here are some of the things that I noticed:

  • Although a Report Generation .lvproj, .aliases, and .lvlps file, the Project, when opened, was empty!  Since Projects were added to LabVIEW, almost all development should take place in a Project, but you do not appear to be doing so.
  • You have an Event Loop (good) to handle pressing Start, Stop, and Report buttons.  But instead of using Boolean controls with a Latch property and using a "Value Changed" event, you use Switch Until Released (which, so far, I've never used) and a Mouse Down Event.  I suppose this could work, but I've never seen this pattern.
  • You are writing an Excel Report, but are not using the Excel-specific VIs (such as Excel Easy Table).  Why (or Why Not)?  The basic idea of an Excel Report is that you create the 2D text data you want to write into Excel, then with a few simple VIs, you open Excel, write the Table, and save the Report.  In particular, you don't write out something that resembles the columns of the first few rows of a Spreadsheet (Date, Time, Test, etc.).

Now to your specific question, Error 7.  Do you know what this error means?  If you click on Help, choose Explain Error, and put in 7, you will see this means "File Not Found".  Well, there is an obvious place where a File is used, right when your program starts.  I recommend that you put a Probe (do you know about Probes?) or an Indicator on the path going into the main For loop and see what File you are trying to open (hint -- there's an error in the way you build the path, but you should be able to figure out how to fix it).

 

Good luck.  Hope these suggestions get you on a Better Path.

0 Kudos
Message 6 of 17
(4,678 Views)

@Bob_Schor wrote:

Good luck.  Hope these suggestions get you on a Better Path.


Great points, Bob.

 

In addition, the use of Stop ("abort VI"), is ill advised. The VI will stop in its track, even if the consumer loop is still in the middle of doing something.

Also the General Error Handler after the lower loop will never show anything useful because (1) the code never gets there (remember you abort everything in the upper loop!) and (2) even if it gets there, the stop case does not output any error ever.

The VI will stop automatically once both loops have completed, and that's all you need. Remove the stop function.

It is not clear why you are reading "test/humidity/pressure/operator" from value property nodes in the report case while the actual controls sit disconnected in the "start" case. Why not place the controls in the report case and eliminate the property nodes entirely. Keep it simple.

0 Kudos
Message 7 of 17
(4,672 Views)

 

0 Kudos
Message 8 of 17
(4,621 Views)

 

In addition, the use of Stop ("abort VI"), is ill advised. The VI will stop in its track, even if the consumer loop is still in the middle of doing something.

Also the General Error Handler after the lower loop will never show anything useful because (1) the code never gets there (remember you abort everything in the upper loop!) and (2) even if it gets there, the stop case does not output any error ever.

The VI will stop automatically once both loops have completed, and that's all you need. Remove the stop function.

Thank altenbach for your advice, I removed the stop function and It works fine and OK I'll always try to Keep it Simple 🙂
0 Kudos
Message 9 of 17
(4,620 Views)


I'm happy to help, but puzzled by your comment about the dependency "problem".  First question:  What Version of LabVIEW are you using?  Second question:  What do you want to write to Excel?  Third question:  Are you writing to a new (unique) Excel file, or adding to an existing one?

 

My guess to the answer to Question 2 is that your data can be described as an array of clusters, each cluster being a data point with fields like "Temperature", "Weight", "Operator", "Date", and "Time", and that you can have 1 to several thousand of these to be written to Excel.  My guess to the answer to Question 3 is "Write to a new file that I will name at Run Time".

 

Assuming that you are using a fairly recent version of LabVIEW, accomplishing these aims is not difficult.  The basic idea is to use normal LabVIEW tools to create the data array, then use a few VIs from the Report Generation Toolkit to write the data into Excel.

 

If you can provide some answers to my questions, I'll try to work up a simple example for you.

 

BS

0 Kudos
Message 10 of 17
(4,601 Views)