LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

write to spreadsheet always writing header


alex99202 wrote:

Sorry I dont know how to compile the whole project and upload that so some of the other sub VIs called on will be missing mainly the averaging ones.


Just zip up your entire project and post the zip file.  No compiling needed.

 

Now, as far as your code, try to avoid the use of local variables and property nodes just to set a flag.  Use a shift register instead.  You can initialize the shift register to TRUE and set it to FALSE after you write your header data.  You can also set it back to TRUE when you decide to change files.

 

You can get a waveform data type from the DAQ Assistant.  The waveform data type includes a timestamp for when the data was actually taken.  Use that for your queue data instead of the cluster.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 11 of 15
(1,405 Views)

Instead of all that dance with booleans, locals, and value properties, you should simply  write the header if the file size is zero

 

Overall, you are doing many things way too complicated. For example why do you output a cluster from the "Save Cluster" subVI if you are converting it to an array a nanosecond later? Just output an array! The entire subVI could could look as follows and would take 5% of the time to wire up from scratch.

 

 

0 Kudos
Message 12 of 15
(1,397 Views)

Hey crossrulz

 

Sorry for the late reply,

 

I understand the need to limit the use of local variables i was just the only way I could think to get this code to work correctly with writing the header data. 

To do this using a **bleep** would i literally wire a true to the register outside of the consumer loop then wire a false to i inside and have it has a seperate case?

 

Also would there be a recommended way to tidy up my use of shift registers as im feeling they ae a bit out of control?

 

As a side note I am now experiencing an issue where data that is saved as multiple arrays in one cluster wont unbundle more than once showing ful names?;

The data cluster which contains 3 arrays - 1 thermocouple array 1 pressue array and 1 RTD array will unbundle into 

Thermocouples

Pressures

RTDs but when i use an array to cluster and try and unbundle by name again Labview cuts of the names?

 

0 Kudos
Message 13 of 15
(1,369 Views)

Altenbach

 

Write header if file size is zero sounds like a great idea! how would I go about checking the file size with code?

 

The Save Cluster edits you propose seem far easier than the way I was doing it and dreduces the code complexity its just my inexperience coding that didnt lead me to this solution,

 

Thanks

 

Alex

0 Kudos
Message 14 of 15
(1,366 Views)

alex99202 wrote:

Write header if file size is zero sounds like a great idea! how would I go about checking the file size with code?


Get File Size Function

0 Kudos
Message 15 of 15
(1,354 Views)