LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Re: Save & Recall setup

Yes, if you initialize, then recall a setup, then execute a configure VI it will change the channel parameters as you specify.

 

Craig

0 Kudos
Message 21 of 33
(1,009 Views)

Good morning Craig, sorry for the delayed reply. Yes, I realised that the timescale will change in my oscilloscope from the original 100ms to 10ms. I will try working on the timescale first.
But I have a few questions on a new program that I just recently created, with the intention of saving waveforms and exporting them into excel form programmatically.  Firstly, I would like to know why that there is still an output, even though errors may have occurred. What may be the possible reason that the error could have occurred? * For reference, please refer to Error- Report Generation. *And another question relating to the use of "Rename Excel Sheet VI", I would like to know how I can utilize it to programmatically rename the excel file using "Worksheet". I have tried finding it online, but I am still unable to use it to rename the excel file! *Please refer to Rename excel sheet image*
And also, is there any way I can get an example of the ideal results *Please refer to Ideal results format image for reference*, instead of the current set of results that I am getting now? * Please refer to Report Generation Excel image*.
The two VI examples I have written are attached as below. If anyone has any comments or feedback that I can improvise on my program, do feel free to mention. Any form of help or advice is greatly appreciated. 
Thank you!

0 Kudos
Message 22 of 33
(986 Views)

@Lynn1965 wrote:

\Firstly, I would like to know why that there is still an output, even though errors may have occurred. What may be the possible reason that the error could have occurred?

Thank you for the picture, which is very difficult to see (because the wires are all crowded together and an Error Message is sitting on top of them).  The Error Message is clear -- there is a File Open error, probably suggesting that there is no valid Report File Path input to Excel Save Report to File.

*And another question relating to the use of "Rename Excel Sheet VI", I would like to know how I can utilize it to programmatically rename the excel file using "Worksheet". I have tried finding it online, but I am still unable to use it to rename the excel file!  

Excel Rename Excel Sheet is supposed to rename an Excel WorkSheet (by default, the WorkSheet when Excel opens is called "Sheet1", and you can rename it to "WorkSheet" if you want).  It does not rename any files.

And also, is there any way I can get an example of the ideal results *Please refer to Ideal results format image for reference*, instead of the current set of results that I am getting now? * Please refer to Report Generation Excel image*.

I don't understand this request at all!  The attached Image showed a WorkSheet with 3 numbers in Cells A1, B1, and C2.  There's nothing "special" about the image.
The two VI examples I have written are attached as below. If anyone has any comments or feedback that I can improvise on my program, do feel free to mention. Any form of help or advice is greatly appreciated. 

Try to write more readable VIs.  Keep your wires as straight as possible, with minimal kinks.  Make sure that Inputs and Outputs are labeled and spaced so that all the wires and labels are visible.  Make sure input wires go in on the left and output wires go out on the right (I think you have some mixed up in your VIs).


Bob Schor

0 Kudos
Message 23 of 33
(973 Views)

Hi Lynn,

 

Not sure I fully understand your questions but I took a stab at the code.

 

So do you really want an Excel report or just a CSV file that can be opened in Excel?  From the looks of your code you are trying to do both at once; creating a CSV file using "Write Delimited Spreadsheet.vi" then using the name generated there as a template in the RGT "New Report.vi".  That won't work as you intend!   

 

A template is an Excel file you've specially prepared and saved.  It doesn't contain your data, just the formatting you want to re-use so that your report has a standardized look and feel.  You should use the "Help\Find Examples" menu item to search for "reports" then look for the RGT Excel examples for how to use templates.  

 

Also of note in your code is that you wire waveform data straight into the "write delimited Spreadsheet.vi" and you probably need to be separated each waveform into its own arrays before either spreadsheet or excel will accept it (though I don't work with waveform data often and I could be wrong).  I doubt either of those methods will rebuild the time base (X=dt*i) from your waveforms automatically for you.   Your waveform data from the scope is a 1D array of waveforms, so you can use a FOR loop to separate out each trace into a 2D array and feed that to either spreadsheet or Excel.  When debugging you may want to add indicators so you can inspect the data.

 

I've tidied up your code, separated the waveform data, saved it as a CSV and also took a stab at RGT with renaming the sheet.

 

Craig

 

PS - What version of LabVIEW, RGT and Excel are you using?  I've save the VI as both 2018 and 2015.  It seems like you are using a very old version of RGT or just found an old RGT:Create Report that LabVIEW 2018 tells me is deprecated.

0 Kudos
Message 24 of 33
(965 Views)

@cstorey wrote:

A template is an Excel file you've specially prepared and saved.  It doesn't contain your data ...


It's an "undocumented feature" that the Template input is a means to get Excel to read your data!  Anything that is in the Template will be imported into Excel when it opens, and you can use functions in the RGT to obtain the values of the data contained in that file.  It can get a little hairy, however -- Excel is probably not the Data Format of Choice for "pure LabVIEW" processing.  However, if the data are going to investigators who "don't do LabVIEW" but know/like Excel, and/or if the data lend themselves especially well to a SpreadSheet formulation, this lets you write code to give them their Cake and let them Eat It, Too.

 

Bob Schor

Message 25 of 33
(956 Views)

Hi Bob, thank you for the feedback! Yes, I have cleared up my diagram. It was much better after clearing up!

0 Kudos
Message 26 of 33
(939 Views)

Hi Craig,
Sorry for the much delayed reply! I am using version 2017! But I would just want to confirm that the VI used in the 2016 version for "Create Report" is the same as the 2017 version of "New Report"?
Thank you!

0 Kudos
Message 27 of 33
(938 Views)

NI made internal changes and gave the VI a new name to reflect those changes.  I think that some of the report types may have changed.

 

Bob Schor

0 Kudos
Message 28 of 33
(925 Views)

I think you are fine with either for Excel reports.  As Bob mentions, there were changes, but I think it was to the "Standard Report" format (changed to HTML?) and not to the M$ Office formats.

0 Kudos
Message 29 of 33
(922 Views)

Hi Craig,
Yes, the formats for MS Office did not change! I have managed to settle that part so thanks alot! Smiley Happy

But, I have another issue. Sometimes, I face the issue of program being able to run fully, and sometimes it is unable to run fully as it always stops at the part when it comes to the laser. Is it possible that something is wrong with my code, or could it be there is something wrong with the connection between the laser and the port?

Thank you!

 

Download All
0 Kudos
Message 30 of 33
(907 Views)