LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Write to Measurement File with a For Loop using Set Dynamic Data Attributes

Solved!
Go to solution

I've looked and looked but could not find a solution to this.  

 

I currently have 15 different data points that I'm trying to write to an Excel file.  I have combined all of them into an array and linked them with the "Write to Measurement File" function.  However, the column names are always "Untitled," "Untitled 1," etc.  I then used the "Set Dynamic Data Attributes" function; however to do this I have to make 15 different "Set Dynamic Data Attributes" functions.  It was suggested to use a for loop with the "Set Dynamic Data Attributes" function inside of it, but I'm having trouble figuring out how to do this.  

 

I have multiple arrays consisting of 15 different values each for "Signal Index," "Signal Name," and "Unit" as well as a single "Get Date/Time In Seconds" linked to "Timestamp."  The problem is that the error that when I try to link the output with the Write to Measurement File Input I get:

 

The type of source is 1-D array of dynamic data.  The type of sink is Dynamic Data.  

 

How do I fix this?  I've attached a picture of my setup; sorry if it's crude (I'm new to this!).  Thanks! 

0 Kudos
Message 1 of 8
(6,824 Views)

HI Kaaji1359,

 

To solve this error, right click on the signal node coming out side for loop and select disable indexing. That should get rid of the error.

 

Tip:

To generate excel report, there are specific VIs made in LabVIEW. Try using the report generation VIs, it would be easy and specific.

See the attached image.

 

---------------- Be Good. Do Good. ---------------------
Message 2 of 8
(6,811 Views)
Solution
Accepted by topic author Kaaji1359

It will get rid of the error but it is not completely correct. What you need to do after that is to click on either the exit or entrance tunnel and select 'Replace with Shift Register'. Also, the array of values you have wired to the Signal Index is wrong. Arrays are 0 based. Just wire the iteration terminal to here. And, finally, taking the array size and wiring it to the N terminal is silly. Don't wire anything to this.

Message 3 of 8
(6,800 Views)

Awesome, got it to work; thanks both of you!!  The "Units" input isn't working when I try to input a "C" type unit, but I've finally gotten most of it to work so I'm happy!  

 

Just out of curiosity, what is "Replace with Shift Register" and "Disable Shift Indexing" actually doing and how come those generated errors?  

 

Lastly, there is no "Excel Specific" addon under Report Generation unfortunately.  Is this an addon?  

 

Thanks again!

0 Kudos
Message 4 of 8
(6,789 Views)

Both shift registers and auto-indexing with a for loop are basic elements in LabVIEW. Take the LabVIEW 101 tutorial or at least refer to the LabVIEW help.

0 Kudos
Message 5 of 8
(6,782 Views)

I know this is an older post, but can you send a screen shot of the correct vi?  I am only getting one of the channels (the last one) to rename.

0 Kudos
Message 6 of 8
(6,659 Views)

Your Signals In needs to be wired to the input shift register - the one on the left side. Having nothing wired to it defeats the whole purpose of a shift register.

Message 7 of 8
(6,637 Views)

Thanks! (Fairly rookie of me...sorry to bother on something simple)

0 Kudos
Message 8 of 8
(6,633 Views)