From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Interrogation about the Generation From Template

Solved!
Go to solution

Hi everyone,

 

I'm working on a project where I take lot's of measures in real time (I have to display during the test -> 0,6s   every data like the position 0 or 1 of a sensor, speed, etc. )

And I have to display these data every 0,01s. 

 

The objective is to have an array in Excel which contains every data : 0 or 1 if it's about sensor and a real number if it's a measure. 

 

I already tried different solution but without success, and this morning I found an example include in LabVIEW, called generation from template. 

According to the example, if we got several data write in the front panel, it's easy to display them in an Excel code thanks to a little code. So I created this file like a template excel file, but now there is my problem ! 

 

 

 In the example, all datas were write in a board, that wasn't automatic, everything was write, lane by lane. But this is not my goal ! 

I have to save my data after the test into a board, and then link them with Excel in order to have every data every 0,01s to follow the test in real time and doing a good report. 

 

I got several VIs obviously, my code works, I suppose that I can input my assistantDAQ into the board, it will be in real time, but how can I save in the board every data each 0,01 s ? :s 

My board have to got 15 columns, so it's a really big board finally. and when the test is doing again, this data will change and will be replace by new data. And then, If this things works, it will be easy to create my file how I want 🙂

 

Here is a picture to show you the board which is in exemple. 

 

 

Capture.PNG

 

 

So can you help me to find a way to complete this table as I wish ? :s

 

Thank you in advance for your answers, I hope that I was clear (sorry for my probably really bad english :s ). If you need more precision, or if you missunderstanded a point, don't hesitate and ask me what's wrong :3

 

Regards.

 

Maxime L

 

 

0 Kudos
Message 1 of 3
(2,581 Views)

Maxime,

 

     It should almost certainly be possible to do something like you are proposing, but there are several questions that govern what and how you do it.  Here are some:

 

  • When you say "Excel", do you mean that you want to write a .xls or .xlsx file that is (typically) only processed by Excel, i.e. you don't open it in NotePad to look at the data?  The alternative is a "Spreadsheet File", a text file with commas (.csv) or tabs being commonly-used separators between columns, with rows written as separate lines.
  • Are you looking to use this file as a way to store the data for later analysis?  That is, do you want to open an empty file, write a line at a time while you are taking the data (but not otherwise interact with the file), and save and close it when you are done?  Or do you have some other scenario in mind?

     If you have access to the Report Generation Toolkit (you have it if in the Functions Palette at Report Generation, you see sub-Palettes for Office, Word, and Excel in the bottom row), then you can easily write .xls and .xlsx files.  Otherwise, you can use the Write Spreadsheet functions in the File I/O Palette to write the text Spreadsheet files I described above.

 

     The code for either method is similar.  You open the File/Report, have a loop where the rows of data are generated and written a row-at-a-time, then save/close the File/Report when you exit the writing loop.  There are numerous examples, both in LabVIEW (Examples) and on the Forum.

 

Bob Schor

Message 2 of 3
(2,563 Views)
Solution
Accepted by topic author XFly

Hi Bob,

 

Indeed, it's a sample file .xls, I just have to save these data in order to be link with a code in VBA. 

 

I know about the report generation toolkit (thanks to you), but after some research It wasn't the good solution for me. 

I found an other, easier in my opinion, and this is sufficient to do what I need. 

 

Capture.PNG

 

You can see here my solution, I'll just put my different data like that (it's an example, I'll put assistant DAQ in input and not a simulation). It works, but the problem is that I can't put 2 different assistantDAQ in the same program, so i'll search in this way). 

 

The report generation toolkit was interesting, but I didn't understand how should i use it to solve my problem. 

 

Thank you anyway ! 

 

Regards. 

0 Kudos
Message 3 of 3
(2,541 Views)