Need to read data files originally created in LabVIEW in C++

I have originally created binary files in LabVIEW. These files are made by flattening labview data to a string, then converting the string to a U8 byte array which is then saved to a binary data file. A separate file is used to keep track of the variables written to the data file. (FAT) a 2D-String array (first element = variable name, 2nd element = staring byte location in .dat file, 3rd element = byte length of variable) is flattened to U32 and then written to a binary file.
Opening the files in LabVIEW follows the inverse proceedure. The FAT file is read as a U32 binary data, converted to a byte array, converted to a string, and then unflattened from the string into a LabVIEW 2D-string data type. From this the starting location and length of the variable is extracted. These are used to read the data file, in U8, which is then converted bu a string and then unflattened to LabVIEW data according to the LabVIEW data type.
I now need to now open these files in a Linux environment using C++. I am at a loss at how to emulate all of this data-type conversion, flattening, and unflattening in C++. Does anyone have any ideas?

Faraclas wrote:
> Thanks rolfk, I will do the reading. But just to make sure you don't misunderstand
> me, everything works beautifully in LabVIEW.
I gathered that. But reading through the description gave me the
impression that a few conversions/typecasts may actually be superfluous
without any change to the actual data.
> The problem I am having is trying to open up these files in C++. This system has
> been around for a couple of years now, so I cannot change the data structure in
> the LabVIEW programs (well I could but I don't want to because it is really a very
> flexible system that works well).
Well, it really isn't that difficult, it just won't be a one hour job
for sure. A few guidelines:
1) LabVIEW flattened data contains the actual data as is for all fixed
size elements (scalars and clusters of scalars). Any variable sized data
(strings, arrays) is prepended with an int32 for each dimension
containing the number of elements for that dimension.
2) LabVIEW flattened data is always in Big Endian (Most significant Byte
first) format. This means for normal C(++) programs developed on an x86
system you will have to byteswap every single 16 bit and 32 bit integer.
3) LabVIEW Typecast really is similar to Flattened data but no
prepending of the number of elements is done for variable sized data.
And Typecast can't convert any type containing variable sized data, but
any arbitrary complex datatype only containing fixed size data, or a
simple array or string can be typecasted.
Rolf Kalbermatter
Rolf Kalbermatter
CIT Engineering Netherlands
a division of Test & Measurement Solutions

Similar Messages

  • Need to read data from a text file

    I need to read data from a text file and create my own hash table out of it. I'm not allowed to use the built in Java class, so how would I go implementing my own reading method and hash table class?

    It's not possible to read from a file without using classes from the core API*. You'll have to get clarification from your instructor as to which classes are and are not allowed.
    [http://java.sun.com/docs/books/tutorial/essential/io/]
    *Unless you write a bunch of JNI code to replicate what the java.io classes are doing.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Need to read data from pipe separated file using POJO?

    Hi,
    I need to read data from pipe separated file using POJO.
    There is config.properties file which consists of the
    data mapping.
    Can you help me with sample code or help?
    Regards
    Regards
    Taton
    Edited by: Taton on Mar 7, 2009 4:41 PM

    It's not possible to read from a file without using classes from the core API*. You'll have to get clarification from your instructor as to which classes are and are not allowed.
    [http://java.sun.com/docs/books/tutorial/essential/io/]
    *Unless you write a bunch of JNI code to replicate what the java.io classes are doing.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to read .dat files that are hidden?

    Is it possible to read .dat files that are set to hidden? 'cause what i did was i created a .dat file and set its attributes to hidden and my Read file code cannot read hidden files.
    here's my Read file code:
    Scanner read=new Scanner(FileReader("C:\password.dat"));
    and another thing, how do you Write a .dat file that is hidden too? 'cause my password.dat file needs to be updated.
    here's my Write file code:
    PrintWriter write=new PrintWriter("C:\password.dat");
    thank for the help.

    There should not be any problems opening up hidden files. Your problem is probably elsewhere (for example, you didn't escape the backslash, so what you posted is not your code).

  • Editing text in Photoshop CS3 file causes crash. File originally created in Photoshop CS6

    Trying to edit text in Photoshop CS3 file causes a crash - Tried on multiple PC's
    File originally created in Photoshop CS6 with "Maximise PSD/PSB File Compatibility" set at "Always".
    Document size A4, using Arial Regular. RGB. 8Bits. 72dpi
    Colour Profile: sRGB IEC61966
    Multi business licence for CS3 and CS6 Design Standard/Premium/Master Collection all on PC
    Please Help!

    Interestingly I have found that if I modify a document in CS6 from an earlier CS3-CS5 document and save it - it works fine. But if I create a new document in CS6 the issue persists.
    Looks like I will be modifying old documents for the time being
    Would be grateful for some advise eon this.

  • I need to read data from MQ? any example of OFSML   ?

    I need to read data from MQ so what I should know about this MQ properties ?? such ip,name,....
    I'm new in MQ programming
    and it can be over internet or local network only ?
    I will used the OFSML
    any one know any thing about OFSML or any example ?? Open Financial Services XML interface
    (http://dts.temenos.com/ofsml/)

    It's not possible to read from a file without using classes from the core API*. You'll have to get clarification from your instructor as to which classes are and are not allowed.
    [http://java.sun.com/docs/books/tutorial/essential/io/]
    *Unless you write a bunch of JNI code to replicate what the java.io classes are doing.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • I need sample basic data file containing Product,Market,Measures etc

    I need sample basic data file containing Product,Market,Measures etc to load data in to Sample Basic applications. Where can I get this?

    As I am the World Domain Lead for Sample.Basic (this is a joke, btw, it's sort of like being King of my front stoop, and besides, I just made it up) I will note two things about CALCDAT.TXT.
    1) It is not in columnar format, but instead in Essbase free-form data load format as user2571802 notes. This means if you take a look at it with a text editor, it's a bit confusing to read till you realize that it contains all dimensional information in the data file itself. See the DBAG's section on [Data Sources That Do Not Need A Rules File|http://download.oracle.com/docs/cd/E10530_01/doc/epm.931/html_esb_dbag/ddlintro.htm#ddlintro1029529].
    2) CALCDAT.TXT contains level 0 and calculated results. Just load it -- there's no need to calculate it.
    Regards,
    Cameron Lackpour

  • Need to read text file content and have to display it in multiline text box

    dear all,
    Need to read text file content and have to display it in multiline text box.
    actually im new to file handling. i have tried up to get_line and put_line.
    in_file := TEXT_IO.FOPEN ('D:\SAMPLE.txt', 'r');
    TEXT_IO.GET_LINE (in_file,linebuf);
    i dont know how to assign this get_line function to text item
    pls help me in this regards,

    Simply write:
    in_file := TEXT_IO.FOPEN ('D:\SAMPLE.txt', 'r');
    TEXT_IO.GET_LINE (in_file,linebuf);
    :block2.t1 := chr(10)||:block2.t1||chr(10)||linebuf;
    chr(10) --> is for new line character

  • I need to read Pages files but  I can't install Pages on osx 10.6

    I  need to read Pages files, but I can't install Pages because I have OSX 10.6.  Is there some version that will work?

    You can get iWork 09 on the net. You haven't had Pages before? Who is sending you Pages documents? Ask them to export the document to Word or Rtf and you will be able to read the documents in TextEdit, which you have on your computer

  • I need to read data from a text file and display it in a datagrid.how can this be done..please help

    hey ppl
    i have a datagrid in my form.i need to read input(fields..sort of a database) from a text file and display its contents in the datagrid.
    how can this  be done.. and also after every few seconds reading event should be re executed.. and that the contents of the datagrid will keep changing as per the changes in the file...
    please help as this is urgent and important.. if possible please provide me with an example code as i am completely new to flex... 
    thanks.....  

    It's not possible to read from a file without using classes from the core API*. You'll have to get clarification from your instructor as to which classes are and are not allowed.
    [http://java.sun.com/docs/books/tutorial/essential/io/]
    *Unless you write a bunch of JNI code to replicate what the java.io classes are doing.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Having difficulty reading data file and doing analysis, maybe DIAdem can help

    Hello,
    I am new to DIAdem but I think it may be helpful to my application.
    I used Write Labview Measurement File VI with n-signals input to generate a data file containing 2*n columns(time column and data column iteratively). Now I need to do data analysis from the file. I'd tried to use Read Labview Measurement File VI to load the data but didn't work. I found that it can only read file with one signal as input and without file header. But why?
    What I want to do is to extract specific columns from the file. Some column has special flag values which divide the column into sections. I also need to extract these sections from the column and plot each of them. I know this can be easily done on other data analysis software but is there any way I can do it on Labview? Can DIAdem help with this?
    Thank you

    Hello,
    To answer your last question first, DIAdem can certainly help. You can open the TDM file you created with the Write LabVIEW Measurement File VI with DIAdem. If you navigate to the TDM file in the External Data window of DIAdem NAVIGATOR, you can drag and drop the file into the Data Portal and use the channels of data at will.
    You can also right-click on the file in the External Data window and choose Selective Opening…. There is a Help button in the Selective Opening window which will tell you more about using this feature.
    Either way, once your data is in the Data Portal, you can use the DIAdem ANALYSIS to perform a wide range of analysis on your data. For more on the capabilities of DIAdem, I recommend starting at NI DIAdem.
    Now, in regards to using the LabVIEW to access the data in your TDM file, this is also possible. If you are using LabVIEW 7.1, you will want to look at the Read Channel Groups example. This example uses a sequence of VIs from the Functions>>All Functions>>FileI/O>>Storage palette. The example demonstrates reading multiple channels from a TDM file.
    Regards,
    Eric M

  • Method to get date file was created?

    I don't see a method for this in class File. I can get lastModified() but I don't see a way to get the date the file was created. Any ideas?
    Thx.

    You'd need to resort to a JNI call, this is too OS specific. The date of creation is not available on e.g. UNIX operating systems.

  • Reading data file(txt) present in a file system from a package deployed in SSISDB

    Hi,
    I am trying to create and later read a data file from a package deployed in SSISDB, but it is not reading it while it is successfully creating the file. The same package when run from the file system package, runs successfully. Generating ispac and deploying
    in SSISDB is running for infinite time. Any idea? Is it a permission issue?
    Thanks
    Ayush

    Hi Ayush,
    If I understand correctly, you directly execute a package from the file system source via Execute Package Utility, it works fine. When you right-click on a package under Integration Services Catalog \ SSISDB \ <Folder name> \ Projects \ <Project
    name> \ Packages \ <Package name> and select Execute... to run a package in SQL Server Management Studio, it fails.
    When we execute a package under Integration Services Catalog, the package will run under the credentials used to connect to SQL Server Management Studio. Please note that we need run the package using Windows Authentication.
    As to your issue, please make sure the account connects to SQL Server Management Studio has required permissions to access the file folder and file outside the SSIS package.
    If there are any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Using a CWM format XML as datastore; COM SDK to read the file and create Universe

    Hello everyone
    We are in the process of migrating from a metadata store to BusinessObjects Universe and the plan is to use Java/COM SDK to accomplish that. We have run into limitations with both the SDKs. Java SDK doesn't provide that facility and using COM SDK we are trying to read from a XML file (metadata in CWM format) and create the universe but so far haven't been successful. If the (Universe)Designer can read a CWM format xml file (say created from BODS) we are wondering why can't a customer made COM program do the same.
    Has anyone attempted this and been successful. Please acknowledge.
    Thanks

    I have written C#.NET code to build universes on the fly using the Designer SDK with no problems.  However, I wasn't using CWM formatted data to do this.
    I have two suggestions for you:
    1.  Since not all of the functionality in the Designer tool seems to be available through the SDK, can you parse the CWM xml file in your code and build the universe based on the data instead of trying have Designer build it?
    2.  Since you're using Java, you may get better answers by posting this question in the Java SDK Application Development space here:  http://scn.sap.com/community/bi-platform/java-sdk
    -Dell

  • Need to view .DAT file in Windows 7

    I saw this question here before but it was unanswered., How do I load a DAT file on my Windows 7 Palm software? I desperately need my address book. Is there a program to convert it to the file type that this program wants to see? HELP!
    Post relates to: Palm Pilot

    Even though I've been updating my Beta versions (now in FF 8), I just noticed this stupidity now, because most of the time I still use FF 3.6. (Bring back the d*%n Status Bar! Then I'll use the new versions regularly.)
    After more than 7 years of having "Page Source" be the most useful thing in the View menu (since at least version 0.8 back in 2004), these numbskulls decide that the View menu shouldn't provide '''''all the viewing options available?'''''

Maybe you are looking for

  • MB5B report divison-wise

    Hi Friends, I want to spool the MB5B report division-wise.  At present, there is no option to print this report divison-wise. Kindly guide me as to how to modify the existing MB5B report to get the report by division-wise. TIA. Regards, Mark K

  • Change track order

    For some reason when I dowloaded an audio book, the trracks are in the wrong order.  What is the fastest way to get them in the correct order.  The Chapter names are not alphabetical so I would like to click and drag the tracks within an album to cha

  • How to load a PDF blob?

    Hi, could some one help me with the steps to loading a DPF file into a table. In this table I have a column which is a BLOB datatype where I would like to store these PDF's. Any help would be greatly appriciated! Thanks for your time.

  • Please suggest learning material for photoshop elements 7.0/6.0 It came bundled with a wacom bamboo. We would like a book or website targeting OSX

    All of the websites and books (elements for dummies from amazon, etc.) seem to focus on windows.  The Elements for Dummies even says that Adobe stopped supporting Elements after 4.0.  My CD says 7.0 Win/6.0 MAC.  How can I find more info on how to us

  • XT65/XT75 as a GPS tracker

    Hi guys, First of all, sorry about my poor english. Me and few friends of mine are trying to make gps tracking system, the server is OpenGTS (done.) and accept opendmtp and/or NMEA protocol for incoming messages from the devices and google maps for m