LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to make a measurement file

Hi everyone,

I am trying to make a part of the code that is going to write a measurement file in Excel and save it on the desktop or somewhere. I would like to use "Write to measurement file" function, but the time column and names of signals aren´t right (look at the photo).

You can find a problem in "Release data" state.

Does anyone has an idea how to fix it?

Best regards!

Download All
0 Kudos
Message 1 of 7
(3,180 Views)

Hi vlado,

 

have you ever worked with Excel?

Why don't you set the column width of Column A to something like 30 chars? MAKE THE COLUMN WIDER!

 

You can find a problem in "Release data" state. Does anyone has an idea how to fix it?

I found "a problem" in your VI: there is NOTHING wired to the WriteMeasurementFile function!

To fix this problem you need to wire their inputs!!! 😄

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 7
(3,170 Views)

This appears to be an elementary Excel "thing".  If you ask Excel to format something that requires 20mm of space, but your column is only 17mm wide, Excel "suggests you adjust the size of the column" by filling the space with "########".  Simply right-clicking the vertical border of the column will make the column Autosize and fix this problem.

 

Note that it is almost always an exercise in frustration for Forum readers (such as myself) who would like to help you if you attach static pictures of your problem instead of live VIs or Excel Files.  I would have returned your Excel file "fixed" so you could see the difference.

 

Bob Schor

0 Kudos
Message 3 of 7
(3,167 Views)

Hi guys,

i have never noticed a problem with to small column. Now i fixed it.

 

And the state that i called a problem, ist the one that i dont know how to connect, i tried some of solutions, but none of them gave me the signal names in each column top.
How should i do that?

0 Kudos
Message 4 of 7
(3,162 Views)

Hi Vladimir,

 

i tried some of solutions, but none of them gave me the signal names in each column top.

What have you tried?


How should i do that?

A simple solution is: When an ExpressVI does not allow the settings you like to have then you should create your VI without using that ExpressVI!

Background: ExpressVIs are made for special purposes. They sometimes allow you to set certain parameters. But when you need other parameters or more versatile usage then you need to program your own solution (aka subVI)!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 7
(3,141 Views)

Here is some advice...

  1. Forget about Express VI's, they were designed for those 4 hour LabVIEW seminars sales pitches, to show how fast you can just "throw something together", but are too inflexible for any real use.
  2. An Excel compatible file needs to be nothing more than a TAB delimited text file.  
  3. Use the "Write Delimited Spreadsheet. vi or the "Open, Write Text File, and Close" file primitives
  4. Write the column headers to the file ONCE at the beginning of your program.
  5. Write the rows of data as they are taken. 
  6. Don't forget to close the file at the end if you are using the file primitives
========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 6 of 7
(3,123 Views)

I forgot to add that I prefer using the "Open File, Write to Text File, and Close File" primitives as the Open File also locks the file so if you try to open the file while LabVIEW is running Windows will throw a sharing violation and programs like Excel will offer to either open the file read only or open a copy of the file.

 

This allows you view the data file while your LabVIEW is still running and writing to the file.

 

Using the Express VI or Write Delimited Spreadsheet.vi does not lock the file, so you can open it fine while your LabVIEW program is still running but if your LabVIEW program tries to write to the file when you have it open, your LabVIEW program will crash because the file is open in another program.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 7 of 7
(3,115 Views)