LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

TDMS and Report Generation

Hello,

 

   I'm writing a test routine that requires a report being generated at the end of the sequence. Do I need to write my data to say a TDMS file before generating the report? Or can I write the report as the data is collected? I'll probably go with an HTML report.

 

I'm also curious what the best way to extract data from an array would be? Is their typically a best way to organize an array to assist with efficient data extraction? Or is it just as easy to organize the data post extraction? For reference, I will have multiple loop cycles that will collect a series of data that will be grouped together in the report by which cycle in the loop they originated. 

 

I appreciate the help!

0 Kudos
Message 1 of 10
(1,300 Views)

You don't have to save a TDMS file prior to writing a report, but it is a good idea to save your data off to a file before writing a report. There is not really enough information to provide a good recommendation as to whether you should write report as the data is collected. The same holds true regarding your question about accessing data in arrays. Help us help you by posting the section of code in question. 

Doug
NI Sound and Vibration
0 Kudos
Message 2 of 10
(1,262 Views)

So I've got a couple of different while loops that run one after the other. Each loop runs several times and collects six different elements that need to be organized into a spreadsheet row together based on time. Should I be conscience of how I'm initially wiring the data to an array so that it comes out in the desired order in a spreadsheet? Or is there a way to pick and choose how the array data elements go into each row of the spreadsheet? 

 

I'm taking measurements of a specified frequency band. For example, say the device operates from 5kHz to 20kHz. I'm starting my measurements somewhere in the middle of the band and working my way to the high end of the spec, then going back to the middle starting point and working down towards the low end. I'm doing it this way so I can observe how the high and low out-of-band frequencies act.

 

So once all the data is collected, I need to insert the six different data point from the high and low loops into a report that reads from the lowest frequency to the highest.

 

Below is the high loop.

 

(Sorry for the excessive back-story)

 

JayWW_0-1630600306221.png

 

0 Kudos
Message 3 of 10
(1,214 Views)

Hi Jay,

 


@JayWW wrote:

So once all the data is collected, I need to insert the six different data point from the high and low loops into a report that reads from the lowest frequency to the highest.

 

Below is the high loop.


That loop is not executable as shown. And it has nothing to do with "inserting data into a report"…

 

What's your problem? Don't you know how to create your report? Or is the problem with sorting 6 datapoints?

(It would help to see real code and not just images of parts of code…)

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 10
(1,184 Views)

I showed the screenshot of the while loop to illustrate how I'm inserting the six data elements into the array. If you recall, one of my questions was regarding if there was a more efficient way to initially insert the data into the array so that retrieval was easier when recalling the data. I apologize if that was unclear. 

 

The image I posted is in mid-development and I agree it wouldn't run as-is. I am interested in hearing your feedback as to why it won't run. I am fairly new to LabVIEW so any help is appreciated. 

 

Thanks,

Jay

0 Kudos
Message 5 of 10
(1,179 Views)

Hi Jay,

 


@JayWW wrote:

I am interested in hearing your feedback as to why it won't run. I am fairly new to LabVIEW so any help is appreciated. 


There's an unwired IndexArray in the middle of the image…

 


@JayWW wrote:

I showed the screenshot of the while loop to illustrate how I'm inserting the six data elements into the array. 


Where should that happen? I cannot see where you "insert 6 elements into the array"…

 

All I see is

  • a While loop set to stop at the 6th iteration or earlier, based on some conditions. You should use a FOR loop instead, with conditional terminal enabled! (You know the max number of iterations before starting the loop!)
  • a BuildArray with 5 inputs
  • several bended wires: cleanup! (When code is easier to read then less errors can hide within!)
  • wires with unneeded splits (why do you need two output tunnels to output the very same array?)
  • missing documentation, like subdiagram labels, pinned comments, wire labels, …
Best regards,
GerdW


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

Hi GerdW,

 

Yes, I was hoping it was the unwired IndexArray you were referring to when you mentioned it wouldn't run. 

 

You mentioned using a For loop, are you recommending that replacing the While loop? Or running inside the While loop? 

 

Yes, I agree I have a bit of a mess with the wiring. I think my lack of understanding on the proper way to utilize arrays will improve my wiring.

 

Below is what I was calling an "array" with five data elements. (There's an additional array further downstream that adds the sixth element) Is this incorrect? Do I need to add additional array related functionality in order for it to be an array?

 

JayWW_0-1630676973774.png

Thanks,

Jay

0 Kudos
Message 7 of 10
(1,173 Views)

Hi Jay,

 


@JayWW wrote:
I showed the screenshot of the while loop to illustrate how I'm inserting the six data elements into the array.

(There's an additional array further downstream that adds the sixth element)

Ok so you did not show the code you described in your image and you want us to guess what you are doing the part of the code you did not show?

Come on…

 


@JayWW wrote:

You mentioned using a For loop, are you recommending that replacing the While loop? Or running inside the While loop? 

 

Below is what I was calling an "array" with five data elements. … Do I need to add additional array related functionality in order for it to be an array?


You should replace the While loop by a FOR loop.

And you don't need any other array function to build your array…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 10
(1,170 Views)

Hi Gerd,

 

   I apologize for my misleading and erroneous image with the incorrect number of array inputs. I had 'six' in my head and I should have double checked before posting. 

 

I'm curious as to what difference in functionality I would get by switching from the While loop to a FOR loop? With the iteration and conditional input wired the same, wouldn't they both behave the same?

 

Thanks,

Jay

0 Kudos
Message 9 of 10
(1,167 Views)

Before any of us can really answer your questions, we need you to upload your VI(s). That way, all of us can see what is going on upstream and downstream of that while loop you showed us in an earlier message.

 

If you have multiple VIs, zip them up and send them to us along with your project file.

 

 

Message 10 of 10
(1,145 Views)