Labview 8.2 Read Binary File, no pos offset option anymore?!

I have a VI that worked perfectly well in 7.1 and now I've opened it in 8.2 it doesn't work and I can't revert back to 7.1 because I accidently pressed save.
In 7.1 I used the combination of open, read and close file functions to read parts of a large binary data file - I cannot read the whole file into Labview 8.2 as it fills the memory. There isn't a terminal in the 'read binary file' function in 8.2 for 'pos offset' which is what I used to use in 7.1. How am I supposed to open the file now? Surely they have not removed such a useful facility entirely - is there another way to do it that I am not aware of?
Many thanks in advance for help,
Sarah

smercurio_fc wrote:
André, at first I could not understand your response, ...
Must be my Dutch way of writing English
Regards,
André
Using whatever version of LV the customer requires. (LV5.1-LV2012) (www.carya.nl)

Similar Messages

  • Read binary file in LabVIEW 2012

    Hi,
    Have anyoune experienced problems reading binary files in 2012 previously saved in 2010.
    As shown on attached image, the same VI is opened in 2010 and 2012 reading the same binary file containing the data structure "ProcessList IN".
    I suspect it has something to do with the variants ?
    The error message does help a lot (-;
    Any ideas ?
    Kind regards
    Kahr
    Regards Kahr
    Certified LabVIEW Architect
    CIM A/S
    Attachments:
    Read_Binary_File_Error_LV2012.png ‏426 KB

    Hi Kahr,
    "error 1" tells one of the input parameters is wrong: it's either the path or the cluster datatype! The error message only mentions a file path AS AN EXAMPLE!
    You're using BinaryRead similar to those old Datalog file functions to read a cluster of several data. It has been know that datalog files get tricky when one is using a different LabVIEW version to read them due to changes of internal data representation. Maybe that's the point that hits you now?
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • How to open and read binary files?

    How do I open and read Binary files?

    Did you  look on The Unarchiver's web site where it has a link to older versions? http://theunarchiver.googlecode.com/files/TheUnarchiver3.2_legacy.zip
    The best thing to do is ask your friends what programs they used to produce these files, or at least what format files they are producing.  Otherwise it's like being shown a car and given a bundle of 200 keys with no idea to which one to use, or even if any of them work with that car.
    Using The Unarchiver will likely not do anything because it too will not know what format files are involved, and they may not even been in an archived format.  If they sent you a Word file without telling you (a favorite of Windows users to do  -- it drives me crazy when they could have just sent them in plain text), The Unarchiver won't open them.  If it's a picture file then using Hexedit will just show you a bunch of unintelligible stuff as shown in an earlier post, though you may see a line of text providing a hint.
    As I said earlier, often .bin may be an executable program which needs another program to actually interpret it.  That's what Java is trying to do.  Still, it may think it can execute the file, but it is highly unlikely somebody would send you an executable program (and if they did I would not trust it).  For all you know it may be a Windows virus.

  • Reading binary files

    Hi
    I need some help in reading binary files. This is the code I have so far.
    import java.io.InputStream;
    import java.io.FileInputStream;
    import java.io.IOException;
    public class patternmatch {
         public static void main (String[] args) {   
              final byte[] bytes = new byte[1];
              try {     
                   final InputStream  instream = new FileInputStream  (args[0]);
                   while (true) {
                        final int count = instream.read (bytes);
                        if (count==-1) break;
                        System.out.println(bytes);
                   instream.close();       
              } catch (IOException e) {
                   System.err.println(e);         
    }Instead of a list of hexadecimal numbers that I want I get a long line of
    [B@eee36c
    [B@eee36c
    [B@eee36c
    [B@eee36c
    Which represents some address I think.
    Does anyone know how to extract the hexidecimal numbers?
    Thanks
    Charles

    double post http://forum.java.sun.com/thread.jsp?forum=31&thread=558802

  • Read binary file 10 bytes at a time

    I want to read binary file in a specific format. There is a number at the starting of the file. That tells us where the data is starting. Suppose it says 3975, then it mean data starts at 3975. Then once I read that location I want to read data at 10bytes at a time and then convert it to numeric and display it on graph. I am attaching the file format and the current vi which I am using. please help.
    Solved!
    Go to Solution.
    Attachments:
    topo.zip ‏89 KB

    Ah, the first 10 characters are a string!
    After opening the file, use the Read From Text File with count set to 10.  Then use the Decimal String to Number to convert this string into your "record size".
    NOTE:  The text indicator was just for debug purposes.  You don't really need it.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines
    Attachments:
    Read record size.png ‏12 KB

  • Write-read binary file Error 116

    Hi all,
    I am saving double, numeric array data into a binary file and then trying to read it back but keep on getting Error 116 (cannot read from binary file).
    I have attached screenshots of the way I am writing my data into the binary file and then the way I am trying to read it. Basically my data is chunks of 2D double arrays, coming at a rate of 1hz and this is why I have to use the get and set file size functions prior to saving into the file (i.e. so that each time I can append my file with new data).
    I have tried all combinations for the write to binary and read to binary file functions, thus meaning I have tried little, big and native endian options but I keep getting the same error. Also played with the way I append my data, i.e. I have used both the "offset in bytes" and "end of file" options, just in case this made any difference, but again no luck.
    Any help would be much much appreciated.
    Regards,
    Harry
    Solved!
    Go to Solution.
    Attachments:
    Write_Bin.JPG ‏154 KB
    Read_Bin.JPG ‏100 KB

    Just as an amendment to my original post, I can succesfully read my data in MATLAB using the standard fread function with double precision. I presume that this means that there is nothing wrong with the way I write the data into the file. However, it would be useful for me to be able to read it directly from Labview without having to build matlab executables etc etc...
    cheers again

  • Upload and read binary files

    I have created ADF form with input file item for initiator human task ( to upload a binary file)
    In the second form, I want see link of the file uploaded and I want open the file in other window ( to see the content of the binary file)
    How can I do?
    Thanks Elena

    Azazel,
    Looks like you are just being an over achiever.  There are VI's specifically written for reading and writing binaries.  I would guess that the VISA timeout is caused by the way you are calculating the size of the file.  Since it is too big the VISA session will time out.  See attached example for the easy way to do this.
    Matt
    Matthew Fitzsimons
    Certified LabVIEW Architect
    LabVIEW 6.1 ... 2013, LVOOP, GOOP, TestStand, DAQ, and Vison
    Attachments:
    RWbinary1.vi ‏100 KB

  • How to read binary file in Matlab

    "Hello all!
    Labview 7.0 has an example "Cont Acq to File (binary).vi" log the PCI 6014 card and writes the data to a binary file. How can I read that
    file in Matlab(6.5.0... R13)? Does anyone have a solution for this?

    Hello,
    Basically you can do it by saving the data in a file in MATLAB and reading it directly from LabVIEW, or vice versa. In MATLAB , the command "save" allows you to save the data in binary format (*.mat) or ASCII format. You also have an option of saving it in ASCII format using a tab delimiter between data points.
    There is a knowledge base which talks in detail about how to share data in between labview and matlab Import data from labview to Matlab and vice versa.
    Hope this helps. If not, please feel free to ask more questions.
    Good luck and have a great day!
    Koninika
    National Instruments

  • How to read binary files wrt specific BYTE size and length??

    Hello Everyone,
                                I have a project I want to accomplish. I have a binary file, and I would like to read the data and print on wfm in a specific order and size.
    The data is 16 bit binary type , and needs to be read in chunks of 2 bytes.
    i have 30 bytes of sample 1.
    followed by 2 bytes of sample 2.
    followed by another 2 bytes of sample 3.
    steps 2-4 should be repeated 10 times and then i should read sample 4 which is of 2 bytes.....
    How should I do it?? I don't have any VI build... all i have is the example VI...
    can anyone pleasehelp me???
    Now on LabVIEW 10.0 on Win7

    smercurio_fc, sorry for the confusion, i will try my best to explain...
    1. No, i don;t have to read the file again, once it has read, I used
    while loop just to see the data updating (i press run, and before i can
    visualize i have the waveforms; i can get rid of the while loop)
    2. I have 30 different values of 1 sample. actually, the data is cmg
    from tri-axial accelerometer; each axis is of 10 bytes(hence 3*10 =
    30bytes)
    3. I am repeating the steps 2-4 10 times because the data was written
    into the binary file after 10 times sampling the sensors(if first 3
    samples are read @ 1000hz, sample 4 was read at 1000/10 = 100hz)
    4. I am using the graphs to interpret the values, that's it. The
    values are already scaled when they were wrote to the binary file, I
    have to simply interpret it.
    I have made some changes in the VI, now i am reading only the first
    30bytes, that too, in chunks of 10-10-10 bytes, and plotting the 3
    samples simultaneously on a waveform chart. (will approach 1
    sensor/sample at a time) and running the loop for 10 times. I have changed I8 to I16 now.
    Please let me know if it makes sense to you now.
    P.S. each sample is a sensor data.
    Now on LabVIEW 10.0 on Win7
    Attachments:
    data_read.vi ‏24 KB

  • How to read binary file in developer 2000

    Hi,
    Is there any method through which i can read a binary file(pdf)
    in developer 2000
    Thanks in advance

    Hello,
    Basically you can do it by saving the data in a file in MATLAB and reading it directly from LabVIEW, or vice versa. In MATLAB , the command "save" allows you to save the data in binary format (*.mat) or ASCII format. You also have an option of saving it in ASCII format using a tab delimiter between data points.
    There is a knowledge base which talks in detail about how to share data in between labview and matlab Import data from labview to Matlab and vice versa.
    Hope this helps. If not, please feel free to ask more questions.
    Good luck and have a great day!
    Koninika
    National Instruments

  • Read Binary File - variable binary format

    Hi Everyone,
    I'm using the "read from binary file" subvi to interpret some data from a file. I have the code running fine if the the temp file is always the same format, however I want the "read from binary file" to adapt to different file structures based on a user input. Here's a snapshot of my current VI:
    The structure of the file I'm reading can change, so I tried to make it so that user input would change the way labview interprets the binary structure. I did this using case structures. The issue I ran into is that the ouput of the different case structures merges into 1 line, and since each case structure's binary format is a different array size I get an error:
    ======>
    Does anyone know of a way to remedy this issue?
    If you take a look at my file, I was thinking about putting all of my commands that interpret the binary file and parse the data into a case structure similiar to the one above. I was trying to avoid this as I would end up with a set of the entire code in 12 different cases, and if I wanted to make a small change to the the code I would have to change all 12 cases.
    Thanks for any suggestions!
    Attachments:
    Read Copy of Binary File - Static.vi ‏105 KB
    Read Copy of Binary File - Variable.vi ‏105 KB

    One solution is to include the File Read into the case structure. But you need to find a way to return the different types of data records as you obviously can't connect them to the same indicator.
    All in all I find your design rather crude anyhow. Reading a file and letting the user decide what data type to expect is going to give lots of errors. Instead the file should contain information of what is in there and the reading routine should decide based on that how to interpret the next bunch of data.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Read binary file made with VB

    Hi there,
    Here is something I never did, so a little help is welcome
    I have a binary file made with VB and I want to read it with LabVIEW 8.5.
    I know the structure of the records in the file, it's something like: 
        str1      As String * 5
        str2      As String * 6
        str3     As String * 2
        date      As Date
        str4     As String * 20
        str5   As String * 20
        int1       As Integer  
        flt1    As Single 
        flt2     As Single
        flt3      As Single
    and so on.
    Further on there's even a 2D array: 3 rows, 400 cols of singles.
    The total length of one record is 5120 bytes.
    I can pick up whatever record from the file using the "Set file positions" & "Read from binary file" vi's but how do I convert those 5120 bytes in the correct structure?
    I was thinking of a cluster but how do I define a fix string length in LV?
    Also, is a cluster the right way to go?
    So, like I said any help is welcome
    Thanks

    Alain S wrote:
    I was thinking of a cluster but how do I define a fix string length in LV?
    Also, is a cluster the right way to go?
    So, like I said any help is welcome
    Thanks
    Defining a fixed sized string officially not possible, and even the non official way will get you bugs, so let's do the official route.
    First open up the file with a hex editor, I normally use the Total Commander's built in F3, and then hit '3' to get a hex view. In that view I check wheter the lenght of the string is prepended to the string (Pascal and LabVIEW style) or ended with a Null (C style).
    If none of them is happening, I would use a cluster of 5 U8's to get the string, convert this cluster to an array, and convert that to a string.
    I have no idea what a 'Date' representation is in VB.
    A cluster is very suitable for this task, however I do not get the info about the 2D array, if you could add a data file that would be very helpfull.
    Ton
    Message Edited by TonP on 28-08-2009 08:44 PM
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!

  • Display PDF in different window by reading Binary file in MIME folder.

    Hi all,
    I've kept binary file in MIME folder and I'm trying to read the contents of it. and I'm trying to display contents in pdf format in separate window.
    For this I was able to read the file by using FileInputStream
    byte[] bytes = new byte[1000];
         try
                  //File file = new File(WDURLGenerator.getResourcePath(wdComponentAPI.getDeployableObjectPart(),"data.bin"));
                   File file = new File(WDURLGenerator.getResourcePath("test.bin"));
                   FileInputStream is = new FileInputStream(file);
                  long length = file.length();
                   //Create the byte array to hold the data
                   byte[] bytesA = new byte[(int)length];
                   //Read in the bytes
                    int offset = 0;
                    int numRead = 0;
                    while (offset < bytesA.length&& (numRead=is.read(bytesA, offset, bytesA.length-offset)) >= 0)
                         offset += numRead;
                        is.close();
                   bytes = bytesA;
                   wdContext.currentContextElement().setPdfSource(bytes);
                 catch(Exception e)
                   wdComponentAPI.getMessageManager().reportException("Error Reading File:"+e.getCause(),true);
                   wdComponentAPI.getMessageManager().reportException("Error Reading File To String:"+e.toString(),true);
    I've to show this in external window. I created attribute "pdfResource" of type binary
    and declared in the source
    private ISimpleType myPdfDoc;
    After that I added this bit of code in Init Method
    myPdfDoc = wdContext.getNodeInfo().getAttribute("pdfResource").getModifiableSimpleType();
    ((IWDModifiableBinaryType)myPdfDoc).setMimeType(WDWebResourceType.PDF);
    ((IWDModifiableBinaryType)myPdfDoc).setFileName("PDF");
    After this I made an action handler which has following code.
    final byte[] documentContent = bytes
    final String docUrl = myPdfDoc.format( bytes );
    String docUrl = myPdfDoc.format(bytes);
    IWDWindow window = wdComponentAPI.getWindowManager().createExternalWindow(docURL,"Resource", true);
    window.open();
    But it is throwing Null Pointer exception for Init Method and also while displaying.
    Where is that I'm faltering. Any Pointers will be help ful
    Thanks
    Srikant

    First of all why do you need those three lines of code in your wdDoInit() ?
    Simply, you may use this:
    IWDCachedWebResource cachedResource = null;
    String url = null;
    byte[] pdf = wdContext.currentContextElement().getPdfSource();
    if (pdf != null) {
       cachedResource = WDWebResource.getWebResource(pdf, WDWebResourceType.PDF);
       url = cachedResource.getURL();
    Refer <a href="http://help.sap.com/saphelp_nw04s/helpdata/en/4a/fb8342a7d30d53e10000000a155106/content.htm">Utilizing the IWDCachedWebResource-API</a> for further assistance.
    /* Changed the code */
    Message was edited by: Bala Krishnan

  • Read binary files that are wraped in the downloaded executable signed jar

    Hello, there:
    I have created a Swing application and created a signed jar file and uploaded it to my site. The signed jar includes class packages, and a folder of binary files which are the datasource for my application.
    jws downloads this signed executable jar, it'll automatically run it, but it has problems reading the binary folders wrapped in itself (the app is supposed to read the folder's structure and use the info to create a JTree object, and read the file's content as well). Is it the file path conversion problem? Do we need to use URL instead? I tried it after reading some threads on this forum but didn't make it.
    As an alternatives, I want JWS to unjar the jar file and expand it to exploded files. I manually unjar it and run the app from command line, it works fine.
    Plus, the app is supposed to manipulate the binary files when it's in process, like saving new content back to the files, zip the files and upload them to the remote sql server. therefore, I think it's easy to have it run when it's expanded.
    So here is the question: JWS by default is running the executable jar, is there a way to tell JWS to unzip the jar and find the main class in the exploded files and run it?
    Thanks a lot for your suggestions,
    Sway

    You can get to any resource in a jar file in your classpath. The code below will return InputStream for resource.bin nested two packages down.
    InputStream in = YourClass.class.getResourceAsStream("/com/mypackage/resouce.bin");  //use '/' instead of '.'You can open a FileOutputStream to write that file.
    OutputStream out = new FileOutputStream("myTempResource.bin");
    IOUtil.streamAndClose(in,out);If the resouce is a nested zip or nested jar then you can use the Java Zip utilities to unwrap the stream.

  • Read binary file in as string to perform RegEx

    I have a python script that I use to gather data from a particular data file. I want to convert the script into a java application so I can add a gui and make it more distributable. I am particularly struggling on how to read the binary file into java and convert it to a string for the regex searching.
    import re
    dat = 'c:/projects/test.dat'
    all_the_data = open(dat,'rb').read()
    pattern = 'title="(.*?)".*?value="(.*?)"'
    rx = re.compile(pattern, re.IGNORECASE|re.MULTILINE|re.DOTALL)
    result = rx.findall(all_the_data)
    for title, value in result:
        print "%-25s: %s" % (title, value)

    Hi infraray.
    Check my post out: Cyclomatic Complexity Using Regex .
    This will help.
    import java.util.regex.Matcher;
    import java.util.regex.Pattern;
    import java.io.*;
    1) static BufferedReader keyboard = new BufferedReader(new InputStreamReader(System.in));
    2) protected String txtFileName;
    3) System.out.println("Enter file name to be read: " );
    4) txtFileName = new String(keyboard.readLine());
    5) reader = new BufferedReader(new FileReader(txtFileName));
    // Your Pattern |
    V
    6) Pattern pattern = Pattern.compile("if|for|while|case|switch",Pattern.MULTILINE);
    7) Matcher m = pattern.matcher(txtFileName);
    8) boolean b = m.matches(); // return true if match found !
    9) String line = null;
    10) while((line = reader.readLine()) !=null)
    m.reset(line);
    if(m.find())
    // Change line below to suit your need
    System.out.println("Your message " + " found " + " start of line: " + m.start() + " ends at line: " +m.end());
    reader.close(); // close buffered reader!
    Hope this gives you some direction.

Maybe you are looking for

  • Creation of OM Infotype

    Hi All,    With the help of the following link I tried to create a OM infotype http://www.sappro.com/downloads/jan07/OMinfotypes.pdf    I want to create a OM infotype ( 9000 ),    I had created a structure HRI9000.    In transaction code PPCJ Infotyp

  • Can't open the forms using Oracle Forms Builder 6i

    Dear All, I at first download the file .fmb from linux server to local pc.and I setup oracle Forms builder 6i and want to edit the file .fmb on the local form builder ,but can't open it with forms builder raising FRM-10043. I download the source file

  • Problems with JSP

    We are working with J2EE technology. We have J2EE 1.3.1 an Forte4j in Windows 95 and Windows 98 system operatings When we compile and them, we want to run a JSP page the internet explorer opens and dont do anything more. Must we configure something f

  • Can I use my iMac on a plane?

    I'm traveling on a plane soon and I was wondering if I can use my iMac and get internet on the plane?

  • Strange behavior of adapter sequence in SFTP

    Hi all For SFTP sender callsap(which calls the queue and ....) is the last module in the module sequence. That implies that any module placed after callSap should not have any effect on the processing of message. However I observed if we place some m