LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DATA to EXCEL Particular cells.

Solved!
Go to solution

Hi all,

 

I don't know it is correct Subject or not,

I have a Vi, Which Will read some readings or data from some instrument. I want this to be logged in an Excel sheet at F9:H12. Other cells have some data I can't post here.

 

Also is it the best way to convert numerical value into string.

 

Just want to improve my Vi design.

 

Thank you.

0 Kudos
Message 1 of 7
(294 Views)
Solution
Accepted by topic author Basavaraj093

Hi Basavaraj,

 


@Basavaraj093 wrote:

I have a Vi, Which Will read some readings or data from some instrument. I want this to be logged in an Excel sheet at F9:H12. Other cells have some data I can't post here.


Are you talking about

  1. a CSV file?
  2. a XLS(X) file?
  3. some "live" worksheets in Excel?

 

  • For 1 and 2: read the file, change the "cell" content and save the file. Use either Read/WriteDelimitedFile or RGT functions.
  • For 3 you can employ ActiveX nodes…

@Basavaraj093 wrote:

Just want to improve my Vi design.


  • Don't maximize windows to full screen.
  • Use AutoCleanup on your frontpanel…
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 7
(289 Views)

Thanks for the reply,

 


@GerdW wrote:


Are you talking about

  1. a CSV file?
  2. a XLS(X) file?
  3. some "live" worksheets in Excel?

 

  • For 1 and 2: read the file, change the "cell" content and save the file. Use either Read/WriteDelimitedFile or RGT functions.
  • For 3 you can employ ActiveX nodes…



Actually, it is xlsx file.

The 3rd one I don't Understand What is it.  

About That ActiveX I don't Know more about it.

You have any tutorial or material to understand it, I have heard it many times want to learn it. 

 


@GerdW wrote:
  • Don't maximize windows to full screen.
  • Use AutoCleanup on your frontpanel…

Thanks for this suggestion, also I just want to know I have done some conversion in the Vi. That is good or not? I try to have the DATA 3 different columns.

Basavaraj093_0-1736332169316.png

 

  

0 Kudos
Message 3 of 7
(277 Views)

Hi Basavaraj,

 


@Basavaraj093 wrote:

Actually, it is xlsx file.


Use the RGT functions to open/edit/save/close the XLSX file.

 


@Basavaraj093 wrote:

I have done some conversion in the Vi. That is good or not? I try to have the DATA 3 different columns.


When you write strings to your worksheet (using RGT functions) then those data will appear as strings in Excel.

When you need numeric data in Excel then you need to write numeric data using the RGT functions…

 

RGT uses ActiveX under the hood, so you can learn from those RGT functions…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 7
(273 Views)

Thank you for your suggestions,

 

Here is the final Vi,

 

Basavaraj093_0-1736336643799.png

 

0 Kudos
Message 5 of 7
(262 Views)

Hi Basavaraj,

 


@Basavaraj093 wrote:

Here is the final Vi,


No, this is just an ordinary image…

 

Btw. you don't need a sequence frame and you could go with just one error cluster indicator!

I would also use FormatIntoString (with just one string constant to define the format code) to create the "file string" instead of the ConcatString/FormatDateTimeString functions using 3 string constants…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 7
(230 Views)

If you search in the Forums for "Revised Generate Excel Report", you will find a small Demo I wrote a decade ago that shows you how to put specific data (including headers) in specific cells in Excel.  It shows saving String and Dbl data, including an Array of data, and even creates a Graph of that array.

 

Bob Schor

 

P.S. -- The only change you might want to make is to correct the name of the RGT function that creates the Report.  Right off the top of my head, I can'r remember if it is "New Report" or "Create Report" (I think it is now the latter) -- it will work with either, but you might as well "fix" my old code so it doesn't "complain" when you open the Block Diagram.  [Both versions, I think, work, for now ...].

0 Kudos
Message 7 of 7
(190 Views)