LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

change header in dynamic data

Hi,
I have a 2d array converted in a dynamic data and I want to change the default header before saving in the VI_Express "save to file"
How can I do ?
Thanks.
0 Kudos
Message 1 of 8
(3,418 Views)

Can you provide more information?

What does this 2D array consist of (numerics, strings,etc)?  Although I suspect it is strings.

What is the default header and what do you want it to change to before saving it to file?

If it is a 2D array, you may also want to use the Write Spreadsheet to File function.  You can wire the 2D arraay directly.  You'll also need the path. 😉

RayR

0 Kudos
Message 2 of 8
(3,408 Views)

Hi RayR,

It is a numeric array and it is saved in a LVM file type with the option "one header per segment".

Once saved and opened, you can see different lines in the header which I suppose they are default lines because I've never wrought them.

And I want to change them.

0 Kudos
Message 3 of 8
(3,398 Views)

Is the header also numeric?  I guess so if it is part of a numeric array 😄

The header that you want to change to, will it also be numeric?

RayR

0 Kudos
Message 4 of 8
(3,395 Views)
The LVM file saves a lot of information in the header to help you later when you read the file.  You can find out all the information which is stored or can be stored in an LVM file by checking out the spec.  If you want a different header, you can write it yourself, then turn off the header in the LVM Express VI (under the Segment Headers section, select No Headers).
0 Kudos
Message 5 of 8
(3,394 Views)

Hi DFGray,

I've found in the spec page a solution to my problem.

But I did not find how to change directly the header of .lvm file before save.

Thank you.

0 Kudos
Message 6 of 8
(3,388 Views)
The LVM Express VI does not have a way to change the header, since it was designed for speed of implementation and ease-of-use, not flexibility.  However, you can change it to a normal VI and modify the existing code (make sure you save all VIs to a new location so you do not overwrite the vi.lib versions).  Right-click on the Express VI and select Open Front Panel.  Be warned - this is a complex VI, since it handles a lot of options.  You will need to open several layers of VIs to get to the LVM write section.  There is a single VI which writes the header that you can modify.

Another option is to use the subVIs used by the Express VI to create your own VI.  Be aware that using unpublished VIs in this fashion can result in broken code when you upgrade to newer versions of LabVIEW.  These are unpublished and unsupported interfaces and can change, if needed, at every LabVIEW version.  These particular interfaces tend to change about every two or three LabVIEW versions.

It may be easier to write your own header, then use the Write to Spreadsheet File VI to write your data.
0 Kudos
Message 7 of 8
(3,385 Views)
Perfect, thank you for all !
0 Kudos
Message 8 of 8
(3,381 Views)