From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
01-13-2010 03:12 PM
To read LVM files acquired in LabView, I have been using lvm_import (http://www.mathworks.com/matlabcentral/fileexchange/19913-lvm-file-import) in MATLAB. However, I am attempting to now make use of MathScript so that all data can be acquired and analyzed in LabView, without third party software.
I am trying to modify lvm_import to account for all of the functions that MathScript does not support (structures, cell arrays, even try statements), but have run into an issue finding a replacement or workaround for textscan (http://www.mathworks.com/access/helpdesk/help/techdoc/ref/textscan.html).
Anyone with thoughts, or know of the equivalent function in MathScript? lvm_import uses fgetl to get each line in an LVM file, but I can't think of anything other than textscan to parse it the way I want. For the record, textscan is used in lvm_import by the original author.
Cheers.
01-13-2010 03:20 PM
01-13-2010 08:04 PM
01-13-2010 09:54 PM - edited 01-13-2010 09:55 PM
Maybe I know the reason why jktang do not use the vi to read the text.
For example, the text has the data just like below
12 34
54 , 34
52 456
243,32
35 5756
how to read it in LabVIEW very conveniently ? The format is so complex, because the separate will be a blank space or more.
For MATLAB,just use the function "importdata" and the data will be read quickly and accurately.
Does LabVIEW have the same function like "importdata"?
01-13-2010 10:07 PM
The lvm file was created with the Write to Measurement File and the Read From Measurement File can read it back.The file is just tab delimited text if I recall correctly and of course there are functions in LabVIEW for that. The main one being Read From Measurement File.
Of course, I don't quite understand the use of Express VIs in the first place.
01-13-2010 11:51 PM
Hi all, thanks for the responses. I suppose I wasn't too clear -- I need to analyze the raw data in the LVM file, not just display it. Read From Measurement File is an Express VI that I use to display the data, but in order to analyze it I need some actual algorithms.
Even if I port the output from the RFMF VI to a MathScript node, I still need to scan each line in the LVM file, delimit the contents, and analyze. I am looking more for the LabView functions to help me perform this task. While it seems simple to use any number of functions that read delimited text, further exploration into the MathScript version of them shows that NI has greatly reduced the parameterization of these functions, and there aren't any functions that parse strings with a delimiter like textscan does.
For example, textread would do the trick, except the MathScript version of it doesn't let you add parameters (i.e. a delimiter). dlmread will read from a file, but not if it contains strings (just numbers). fscanf scans it as a single string...etc.
Thank you for the responses thus far!
01-14-2010 01:19 AM
01-15-2010 01:43 AM - edited 01-15-2010 01:43 AM
01-15-2010 01:58 PM
01-15-2010 04:26 PM
Nick,
You can put whatever words you want in my mouth. They were much more polite than the words I wanted to use.