07-28-2006 03:49 PM
I would like help compiling a header to attach to a data log file. I am using the express measurement to file VI. I have merged 4 different signals into one input for this VI. I would like to know how to add a header that includes labels like channel, coupling, trigger type, trigger source, horizontal scale, acquisition mode. These labels have appropriate values obtained from an oscilloscope. These values are changing with each acquisition and I would like to have them recorded along with a description of what they are, in the header. I would like to know how to convert the dbl numbers into strings so i can concatanate them with their header labels and then make list which is two columns wide including all of the labels.
How would I do this? I have attached my VI.
Thanks,
Adi
07-31-2006 03:32 AM - edited 07-31-2006 03:32 AM

Message Edited by David Crawford on 07-31-2006 09:33 AM
08-01-2006 02:36 PM
08-02-2006 03:30 AM
Adi
I can see what you mean. The Comment field is encoded by the write lvm express vi so that the read lvm knows how to format it. So if I replaced the = with a tab seperator it looks like this in the excel cell.
Channel\091\0ACoupling\09AC\0ATrigger TypeEdgeTrigger Source\091\0AHorizontal Scale\090.010000\0AAcquisition Mode\09Single\0A
The \09 is the encoding for <tab> and \0A is <LF>. I don't think there is anyway around this as the lvm read alogorithm needs the file to be in a specific format. If you intend to view this file in excel then you could either create a modified version of your LVM or use your own format. This new format could be a 2D array of strings (table) which you would populate with your data and convert this using the Array to Spreadsheet String function and write this to file using the normal file functions.
If you need more help give me a shout.
David
08-02-2006
08:06 AM
- last edited on
11-10-2025
06:40 PM
by
Content Cleaner
The NI-SCOPE Soft Front Panel does something similar to what you want to do. The LVM file format has a "special block" format that allows you to embed just about anything you want into the file, and still have it readable by normal readers. You can find the format of this "special block", and the formats of the already-defined blocks here. Unfortunately, there is nothing quite what you want, so you will need to create your own "special block". To write the rest of the LVM file with minimum fuss, you will want to use the subcomponents of the LVM express VI. To get them, drop an LVM write block and convert to a regular VI. Then extract what you need. There will be three main parts - the main header, the section header, and the data. The last two are in the write all data VI. As long as you get those three sections written, you file will be good.
One note of caution if you do this, the subcomponents are subject to change between LabVIEW versions. This has only happened once that I know of, but since they are not on the palette, they are fair game. This would mean changes, usually minor, to your code if you upgraded. You can avoid this by making your own copies of the LVM code stack (and renaming it before using to avoid cross-linking).
Good luck. Let us know if you need more help.
08-02-2006 12:42 PM
I managed to work around the comment field by entering into the express VI and going thourgh various sub
08-02-2006 12:50 PM
This is my input string for the comments field:
channel=%d
\t\t coupling=%s
\t\t trigger source=%s
\t\t trigger type=%s
And it looks like this in the file:
****End_of_header***
X_value "blank cell" Comment
0 .38 channel=1
"blank cell" "blank cell" coupling = DC
"blank cell" "blank cell" trigger type = EXT
1 .64 "blank cell"
2 .94 etc. "blank cell"
Do you think there is an easy way of bringing the values back up or even bringing the zero value down. maybe insert a blank extra row into my data? If this is possible how could I do that?
08-03-2006 07:45 AM