LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to put header in write to put measurement file VI

I want to create my own header for the file. Although the header can be created from the setting of write to measurement VI, I cannot create my own header file. How can I make my own header on file? 

 

 

I have attached my VI

 

Thank you

 

0 Kudos
Message 1 of 21
(2,414 Views)

Hi prabesh,

 


@prabesh99 wrote:

I want to create my own header for the file. Although the header can be created from the setting of write to measurement VI, I cannot create my own header file. How can I make my own header on file?


You already create a file path: what's the problem to write your header into the file before the while loop?

 

When calling the WriteMeasurementFile ExpressVI you should re-check its settings: it's maybe a problem when the ExpressVI will overwrite already existing data instead of appending to the file.

You also have the option to get rid of ExpressVIs and use "plain" file functions to write your data into the file…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 21
(2,375 Views)
  1. Stop using Express VI's
  2. Use the write to file primitive to write your headers to your file
  3. Enter your acquisition loop
  4. Use write to file primitive or Write to Delimited Spreadsheet VI to write lines of data to your file
  5. Don't forget to close the file when you are done.
========================
=== Engineer Ambiguously ===
========================
Message 3 of 21
(2,357 Views)

Dear  

 

 

0 Kudos
Message 4 of 21
(2,330 Views)

Dear 

 

 

 

 

0 Kudos
Message 5 of 21
(2,320 Views)

Hi prabesh,

 

wh


@prabesh99 wrote:

Dear 


Why do you open the file inside the loop inside the case structure? We told you to create very different code!

Why do you close the file inside the loop?

Why is there a "default if unwired" tunnel holding a file reference?

Why is there no error handling with your file functions?

 

Again:

  1. Open the file before the loop.
  2. Write the header line(s) before the loop.
  3. Inside the loop you can write new data to the file (in appending mode).
  4. Close the file after the loop.

 

Have you examind any of all those example VIs coming with LabVIEW?

 

Why do you write two answers with attaching a VI using the very same filename, but with different filesize? That is very irritating (and annoying)!

Best regards,
GerdW


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

@prabesh99 wrote:

Dear  

 

 

 


I guess I was not clear enough...

 

  1. Open a file
  2. Write your headers to your file
  3. Enter your acquisition loop
  4. Acquire data
  5. Write data to your file
  6. Goto  4 until done
  7. Close the file
  8. Exit program
========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 7 of 21
(2,299 Views)

Hi 

 

0 Kudos
Message 8 of 21
(2,270 Views)

Hi prabesh,

 


@prabesh99 wrote:


Read the help on format strings. Right now you use "%f", but there are a lot of other format codes…

 


@prabesh99 wrote:


Are you talking about "no. of data point for power"?

Place the terminal of this control before the case structure, then you can use its data for header generation…

(This is basic THINK DATAFLOW!)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 21
(2,265 Views)

Hi 

 

 

 

 

 

 

 

 

0 Kudos
Message 10 of 21
(2,262 Views)