Binary file readed from Labview and Borland C++ v.5

Hi Everybody!
My problem is reading binary file from Labview 7.0 and Borland C++ version 5 is not the same.
Only one difference is "space". Reading from Labview I got "00" (decimal) and reading from Borland C++ I got "32".
I also try to read this binary file with Matlab 6  and I also got "00" as well as those from Labview.
I really struck with this problem.. Anybody has an idea about this problem.
Thanks a lot for anybody help!
Nok

Hi,
These threads regarding reading of binary files was recently discussed in this forum
You might find some answers for your query
http://forums.ni.com/ni/board/message?board.id=170&message.id=99016&requireLogin=False
and
http://forums.ni.com/ni/board/message?board.id=170&message.id=153565&requireLogin=False
Regards
Dev

Similar Messages

  • Is there any way to know data is read from tape and written to disk

    is there any way to know data is read from tape and written to disk

    784786 wrote:
    Just asked because I am doing restoration, I see files read from tape and then restored, but can't find them physically there.
    Is there any way I can find it.What kind of restoration? What kind of files?
    The usual "no information" question is of the form "My car won't start. Tell me how to fix it"
    Yours is a bit different - "I tried to fix my car. Tell me how to know it's fixed".

  • How to read a binary file written in LabVIEW 6.1 using VB ?

    How to read a file saved in binay forrmat in LabVIEW 6.1 platform through VB.
    Is there any code ?
    Thanks

    Hello,
    LabVIEW files stored in binary can take on just about any format that
    you choose, so there will not be a single piece of code that will give
    you what you are looking for.  You can use VB's standard file
    operation functions to read in a binary file created by LabVIEW, just
    as you would read in any other binary file.  See this page
    on Microsoft's web site for more information on the binary file read
    operation.  How you stored the data in the binary file will
    determine how you need to extract it from the byte array.  So, if
    the first element stored in the file was a 32-bit integer, you could
    extract an int from the byte stream to recover that piece of your
    data.  You would need to know in advance how the file was
    formatted in order to successfully retrieve the information.  If
    you need a reference for the VB functions, the microsoft link above
    will get you to some good information.
    Cheers,
    Matt Pollock
    National Instruments

  • HT4489 Hi all, I have .vcf contact file exported from yahoo and need to import it to cloud. When I try to import it I get an eror "53 contacts not imported, eror reading vCards". Pls help ty

    Hi all, I have .vcf contact file exported from yahoo and need to import it to cloud. When I try to import it I get an eror "53 contacts not imported, eror reading vCards". Pls help ty

    1 - Select  the thumbnail of one of the problem photos and use the File ➙ Reveal in Finder ➙ Original menu option.  This will take you to the folder containing the original file with that file selected by the Finder. 
    You can also use Find Any File to search for that file (get the file name from the Info pane in iPhoto). You will find the thumbnail version and maybe an edited version also.  Made sure what is found is the large, original version and note were it's located.  Search all of your drives with FAF just in case.
    If you don't fine the full sized version then the only recourse is to use a file recovery application like   SubrosaSoft FileSalvage on your drives to see if any of your full sized photos can be recovered.   If you find enough files to make the purchase of the software worthwhile buy it and recover the files.  However, since it may have been quite a while since you discovered the missing originals it seems unlikely you'll be able to recover any due to being overwritten.
    2 - book projects are just entries in the library databases and can't be exported to another library. 

  • Hey guys, how can i password protect my files in external hard drive? I want to access those files both from mac and windows PC!

    Hey guys, how can i password protect my files in external hard drive? I want to access those files both from mac and windows PC!

    If you want a cross-platform solution that doesn't require the use of third-party software, use an external drive with hardware encryption. The device will have either a physical key or a numeric keypad. I don't have a specific recommendation.

  • No more data to read from socket" and OALL8 is in an inconsistent state

    HI All
    user getting various errors – such as “No more data to read from socket” and “OALL8 is in an inconsistent state”.
    database is on windows 2k8-64 bit
    database is 11.2.0.1.0
    is this problem with JDBC drivers on client side
    thanx

    You will usually get this error when the connection get drop before completing the query/transaction.
    Check the alert log file for core dump as well as the trace file associated to the core dump.
    Also check if you are using the right driver version (ojdbc?)
    Regards
    Michel.
    www.odbTools.com

  • How do I get a print to pdf file option from Word and PP?

    I have windows vista. How do I get a print to pdf file option from Word and PP?

    Do you own Acrobat? If so what version? If not what version of Word and PP do you have? Newer versions contain non-Adobe software for creating pdfs. If you do not own Acrobat that it would be best to check in a Microsoft forum on how to use Word to create pdfs.

  • Binary File Read

    Hello everyone,
    I am not that comfortable with binary file reading. I am trying to learn.
    I have a vi which logs a sine wave in a binary file.
    The Read vi which I have written is not giving the expected data.
    Thanks in advance
    cooldude 
    Attachments:
    Log Data.vi ‏9 KB
    Read Data.vi ‏10 KB

    Attachments:
    Log.JPG ‏20 KB
    Read.JPG ‏13 KB

  • Read binary file information from servlet - from database accessor method

    Okay, I have been working on this for awhile now and I just plain dont know what I am doing. Could someone please help me? I cannot find any examples through google or the forums for this specific type of situation( as in a servlet calls a method which gets binary file from a database).
    - How do I get the inputStream into the servlet so that I can read it?
    - Why am I getting the error message that OutputStream has already been called?
    If someone could give me direction or simply tell me what I should look up - I would really really appreciate it.
    The Servlet
    response.setContentType("application/msword");
    response.setHeader("Content-disposition","attachment; filename="+ file + ext);
    OutputStream os = response.getOutputStream();
    OOT openAttachments = searchInfo.openAttachments(newID, oot, ootNum, file, ext, os);
    InputStream is2 = oot.getIs();
        byte b[] = new byte[16384];
        int numBytes;
            while((numBytes=is2.read(b))!=-1){
                os.write(b,0,numBytes);
                System.out.println("is - in while" + is);
            is2.close();
    RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/ootMain.jsp?newID="+newID);
    dispatcher.forward(request, response);
            os.flush();
            os.close();
    The Method
    public OOT openAttachments(String newID, OOT oot, String ootNum, String file,
                               String ext, OutputStream os) {
        this.conn = database.SybaseDAO.grabConnection();
        String query = " edited for space'";
        state = conn.createStatement();
        rs = state.executeQuery(query);
            if(rs.next()){
               InputStream is = rs.getBinaryStream(2);
               oot.setIs(is);
               System.out.println("is - in while" + is);
               is.close();
    Error Messages
    (is - in while - method)    sun.jdbc.odbc.JdbcOdbcInputStream@c02a
    (is2 - after - servlet)      sun.jdbc.odbc.JdbcOdbcInputStream@c02a
    IOException: java.io.IOException: InputStream is no longer valid - the Statement
                                      has been closed, or the cursor has been moved
    Mar 14, 2005 9:53:19 AM org.apache.catalina.core.ApplicationDispatcher invoke
    SEVERE: Servlet.service() for servlet jsp threw exception
    java.lang.IllegalStateException: getOutputStream() has already been called for this responseThanks for your help/time -
    Crystal

    Here is the entire exception:
    Mar 16, 2005 9:32:44 AM org.apache.catalina.core.ApplicationDispatcher invoke
    SEVERE: Servlet.service() for servlet jsp threw exception
    java.lang.IllegalStateException: getOutputStream() has already been called for this response
         at org.apache.catalina.connector.Response.getWriter(Response.java:596)
         at org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFacade.java:161)
         at javax.servlet.ServletResponseWrapper.getWriter(ServletResponseWrapper.java:111)
         at org.apache.jasper.runtime.JspWriterImpl.initOut(JspWriterImpl.java:122)
         at org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java:115)
         at org.apache.jasper.runtime.PageContextImpl.release(PageContextImpl.java:182)
         at org.apache.jasper.runtime.JspFactoryImpl.internalReleasePageContext(JspFactoryImpl.java:115)
         at org.apache.jasper.runtime.JspFactoryImpl.releasePageContext(JspFactoryImpl.java:75)
         at org.apache.jsp.ootMain_jsp._jspService(org.apache.jsp.ootMain_jsp:596)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:325)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:302)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:246)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:682)
         at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:581)
         at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:501)
         at oot.display_files.doGet(display_files.java:63)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:106)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:576)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Thread.java:595)
    Mar 16, 2005 9:32:44 AM org.apache.catalina.core.StandardWrapperValve invoke
    SEVERE: Servlet.service() for servlet display_files threw exception
    java.lang.IllegalStateException: getOutputStream() has already been called for this response
         at org.apache.catalina.connector.Response.getWriter(Response.java:596)
         at org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFacade.java:161)
         at javax.servlet.ServletResponseWrapper.getWriter(ServletResponseWrapper.java:111)
         at org.apache.jasper.runtime.JspWriterImpl.initOut(JspWriterImpl.java:122)
         at org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java:115)
         at org.apache.jasper.runtime.PageContextImpl.release(PageContextImpl.java:182)
         at org.apache.jasper.runtime.JspFactoryImpl.internalReleasePageContext(JspFactoryImpl.java:115)
         at org.apache.jasper.runtime.JspFactoryImpl.releasePageContext(JspFactoryImpl.java:75)
         at org.apache.jsp.ootMain_jsp._jspService(org.apache.jsp.ootMain_jsp:596)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:325)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:302)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:246)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:682)
         at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:581)
         at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:501)
         at oot.display_files.doGet(display_files.java:63)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:106)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:576)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Thread.java:595)Line 63 is the include...

  • How to read from BLOB and Write to a file in user readable format.

    Hi,
         I am trying to read from a BLOB column and write the content to a file in user readable format. So far I was able to read the Blob column using dbms_lob, but not able to write to a file. Kindly let me know the method to do this.

    Hi, with this Java Code from Oracle Technet it's a easy thing:
    // classpath= /ORACLE/u01/app/oracle/product/10.2.0.3/jdbc/lib/ojdbc14.jar
    // Java SQL classes
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.Statement;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    // Oracle JDBC driver class
    import oracle.jdbc.OracleDriver;
    // Java IO classes
    import java.io.IOException;
    import java.io.BufferedReader;
    import java.io.FileNotFoundException;
    import java.io.FileReader;
    //Java Util classes
    import java.util.Properties;
    * This class demonstrates the Oracle JDBC 10g enhanced features for inserting
    * and retrieving CLOB data from the database. Using the new features, large
    * data of more than 32765 bytes can be inserted into the database using the
    * existing PreparedStatement.setString() and PreparedStatement.getString()
    * methods.
    public class ClobMan {
    /* Database Connection object */
    private Connection conn = null;
    /* Variables to hold database details */
    private String url = null;
    private String user = null;
    private String password = null;
    // Create a property object to hold the username, password and
    // the new property SetBigStringTryClob.
    private Properties props = new Properties();
    /* String to hold file name */
    private String fileName = null;
    * Default Constructor to instantiate and get a handle to class methods
    * and variables.
    public ClobMan(String fileName) {
    this.fileName = fileName;
    * Main runnable class.
    public static void main(String[] args) throws SQLException {
    // Instantiate the main class.
    ClobMan clobMan = new ClobMan(args[0]);
    // Load the Oracle JDBC driver class.
    DriverManager.registerDriver(new OracleDriver());
    // Load the database details into the variables.
    String dbUrl = "jdbc:oracle:thin:@pmol:1550:dbpmol";
    clobMan.url = dbUrl;
    clobMan.user = "gh10";
    clobMan.password = "secret";
    // Populate the property object to hold the username, password and
    // the new property 'SetBigStringTryClob' which is set to true. Setting
    // this property allows inserting of large data using the existing
    // setString() method, to a CLOB column in the database.
    clobMan.props.put("user", clobMan.user );
    clobMan.props.put("password", clobMan.password);
    clobMan.props.put("SetBigStringTryClob", "true");
    // Check if the table 'CLOB_TAB' is present in the database.
    //clobMan.checkTables();
    // Call the methods to insert and select CLOB from the database.
    //clobMan.insertClob();
    clobMan.selectClob();
    * This method will insert the data into a CLOB column in the database.
    * Oracle JDBC 10g has enhanced the existing PreparedStatement.setString()
    * method for setting the data more than 32765 bytes. So, using setString(),
    * it is now easy to insert CLOB data into the database directly.
    private void insertClob() throws SQLException {
    // Create a PreparedStatement object.
    PreparedStatement pstmt = null;
    try {
    // Create the database connection, if it is closed.
    if ((conn==null)||conn.isClosed()){
    // Connect to the database.
    conn = DriverManager.getConnection( this.url, this.props );
    // Create SQL query to insert data into the CLOB column in the database.
    String sql = "INSERT INTO clob_tab VALUES(?)";
    // Read a big file(larger than 32765 bytes)
    String str = this.readFile();
    // Create the OraclePreparedStatement object
    pstmt = conn.prepareStatement(sql);
    // Use the same setString() method which is enhanced to insert
    // the CLOB data. The string data is automatically transformed into a
    // clob and inserted into the database column. Make sure that the
    // Connection property - 'SetBigStringTryClob' is set to true for
    // the insert to happen.
    pstmt.setString(1,str);
    // Execute the PreparedStatement
    pstmt.executeUpdate();
    } catch (SQLException sqlex) {
    // Catch Exceptions and display messages accordingly.
    System.out.println("SQLException while connecting and inserting into " +
    "the database table: " + sqlex.toString());
    } catch (Exception ex) {
    System.out.println("Exception while connecting and inserting into the" +
    " database table: " + ex.toString());
    } finally {
    // Close the Statement and the connection objects.
    if (pstmt!=null) pstmt.close();
    if (conn!=null) conn.close();
    * This method reads the CLOB data from the database by using getString()
    * method.
    private void selectClob() throws SQLException {
    // Create a PreparedStatement object
    PreparedStatement pstmt = null;
    // Create a ResultSet to hold the records retrieved.
    ResultSet rset = null;
    try {
    // Create the database connection, if it is closed.
    if ((conn==null)||conn.isClosed()){
    // Connect to the database.
    conn = DriverManager.getConnection( this.url, this.props );
    // Create SQL query statement to retrieve records having CLOB data from
    // the database.
    String sqlCall = "SELECT rownum, name, sourcetext FROM t_source";
    pstmt= conn.prepareStatement(sqlCall);
    // Execute the PrepareStatement
    rset = pstmt.executeQuery();
    String rownum = null;
    String o_name =null;
    String clobVal = null;
    // Get the CLOB value from the resultset
    //java.io.BufferedWriter out = new java.io.BufferedWriter(new java.io.FileWriter("pr_all.sql"));
    while (rset.next()) {
    rownum = rset.getString(1);
         o_name = rset.getString(2);
         clobVal = rset.getString(3);
    System.out.println(" length: "+clobVal.length()+" "+o_name+" "+rownum);
         java.io.BufferedWriter out =
         new java.io.BufferedWriter(new java.io.FileWriter(o_name+".prc"));
         out.write(clobVal);
         out.newLine();
         out.write("/");
         out.newLine();
         out.newLine();
    out.flush();
    out.close();
    } catch (SQLException sqlex) {
    // Catch Exceptions and display messages accordingly.
    System.out.println("SQLException while connecting and querying the " +
    "database table: " + sqlex.toString());
    } catch (Exception ex) {
    System.out.println("Exception while connecting and querying the " +
    "database table: " + ex.toString());
    } finally {
    // Close the resultset, statement and the connection objects.
    if (rset !=null) rset.close();
    if (pstmt!=null) pstmt.close();
    if (conn!=null) conn.close();
    * Method to check if the table ('CLOB_TAB') exists in the database; if not
    * then it is created.
    * Table Name: CLOB_TAB
    * Column Name Type
    * col_col CLOB
    private void checkTables() {
    Statement stmt = null;
    ResultSet rset = null;
    try {
    // Create the database connection, if it is closed.
    if ((conn==null)||conn.isClosed()){
    // Connect to the database.
    conn = DriverManager.getConnection( this.url, this.props );
    // Create Statement object
    stmt = conn.createStatement();
    // Check if the table is present
    rset = stmt.executeQuery(" SELECT table_name FROM user_tables "+
    " WHERE table_name = 'CLOB_TAB' ");
    // If the table is not present, then create the table.
    if (!rset.next()) {
    // Table does not exist, create it
    stmt.executeUpdate(" CREATE TABLE clob_tab(clob_col CLOB)");
    } catch (SQLException sqlEx) {
    System.out.println("Could not create table clob_tab : "
    +sqlEx.toString());
    } finally {
    try {
    if( rset != null ) rset.close();
    if( stmt != null ) stmt.close();
    if (conn!=null) conn.close();
    } catch(SQLException ex) {
    System.out.println("Could not close objects in checkTables method : "
    +ex.toString());
    * This method reads the specified text file and, returns the content
    * as a string.
    private String readFile()
    throws FileNotFoundException, IOException{
    // Read the file whose content has to be passed as String
    BufferedReader br = new BufferedReader(new FileReader(fileName));
    String nextLine = "";
    StringBuffer sb = new StringBuffer();
    while ((nextLine = br.readLine()) != null) {
    sb.append(nextLine);
    // Convert the content into to a string
    String clobData = sb.toString();
    // Return the data.
    return clobData;
    }

  • CAN AN EXCEL XLSM FILE READ FROM A CSV AND WRITE BACK TO THE SAME XLSM -VBA

    Hey Carlos- Here's the repost. 
    Could an XLSM file read a line from a CSV file in "A1" and depending on what was in the first column in the XLSM, search the CSV file and find the indexed item in the second column or third? I've done it before with standard VLookup functions and it was cumbersome and very slow, and for some reason, everytime I would save the file it would take forever although the xls file was a single sheet.
    i've attacthed a sketch of what I'm talking about, because it's hard to explain and I think the sketch explains it better. Here it is, sorry if it is blurry, it looked fine before I posted:

    ok, use this version, I changed it a bit. To accommodate the issue with the single cell, I moved the main procedures to a function for a more efficient use.
    Sub xlsmCsvLookup()
        'have both your xlsm and your csv files open
        'in the xlsm file, select a range of cells to look up
        'run the script to search all selected cells and get the values from the csv file
        Dim csvDataRange As Range 'csv file data column
        Dim selRange As Range 'to hold selected cells
        Dim foundRange As Range
        'get the source range
        Set csvDataRange = Workbooks("Book2.csv").Sheets(1).Range("a:a") ' replace "Book2" with yourCSVfile.csv
        'check for selection, only one cell, ceck that cell and exit, otherwise loop thru selection
        If Selection.Count > 1 Then
            'loop thru all selected cells, ignore empty cells
            For Each selRange In Selection.SpecialCells(xlCellTypeConstants)
                findSelection selRange, csvDataRange
            Next
        Else
            findSelection ActiveCell, csvDataRange
        End If
        Set foundRange = Nothing
        Set selRange = Nothing
        Set csvDataRange = Nothing
    End Sub
    Function findSelection(selRange, csvDataRange)
            'try to find it in the csv file
            Set foundRange = csvDataRange.Find(selRange) 'if found, assign it to foundRange
            'if no match highligh cut
            If foundRange Is Nothing Then
                selRange.Interior.ColorIndex = 34
            Else
                'if found, get the value in next cell
                selRange.Offset(0, 1) = foundRange.Offset(0, 1)
            End If
    End Function

  • Write to binary file different from 8.0 to 8.2?

    I am communicating with a device via USB and am using a method setup by the USB driver programmer. To communicate, I write to a binary file with a filename of \\?\COMx. This has been working fine for about a  year in mfg with Labview 8.0. I recently "upgraded" to 8.2 and now it does not work. If I save for a previous version and run 8.0 it works fine. How can I make this work with 8.2?

    Yi Y,
    The USB device is one of the instruments we manufacture. The USB driver is written so writing to the USB port is just like writing to a file. I use the binary read/write VI's to send and receive commands to this USB device. The filename I use is \\?\COM#. I am told by the USB driver creator that this is common for low level C. I have been using this VI for that last year and recently upgraged from 8.0 to 8.2 and it does not work. I run the same vi under 8.0 and it works fine. This is not a common way to communicate, so will probably not get an answer.
    My next question is, is there any way to run an 8.0 dll or vi from an 8.2 executable?
    Thanks
    Hi dgtest1,
    Which USB device you are using, and which driver are you using? I'm trying to figure out specifically how you are communicating with the USB device by writing a binary file and how was the binary file written.  Could you please post more information to describe in more details about what your set up is doing?
    Thanks!
    Yi Y.
    Applications Engineer
    National Instruments
    http://www.ni.com/support

  • Binary File Reader to a Chart

    Hello All,
    Newbie having some trouble with reading a chart from a binary file. My problem may be with trying to use a binary file, I am not sure. The x axis time is not the same length as the actual test time. I have acquired a rms voltage from a VCR RF envelope. I'm using a 6009 DAQ with LV 7.1 on Win2K. I have attached the recording vi and the reading vi and a sample file.  I have tried different things including the examples that came with lab view. I need to write a small sized file because this test will last for 4 hours. I have another application that will run for 5 days.  I appreciate any help or ideas.
    Thanks,
    bh3560
    Attachments:
    Chart write_Read.zip ‏140 KB

    Hi,
    The program you have attached acquires, saves and reads data  in ASCII ( floating numbers) and not binary.
    To get an idea on how to write and read data in binary format, look at attached examples( taken from examples shipped with labview)
    Hope this helps
    Regards
    Dev
    Attachments:
    Cont Acq&Graph Voltage-To File(Binary).vi ‏88 KB
    Graph Acquired Binary Data.llb ‏72 KB

  • Trying to parse a file-read from text file.vi

    I'm attempting to read a txt file that has tab separated data. In the fourth (or any) column is the only data I need. The data is a string of numbers (23.454).
    I've used the Read from Text File.vi and the Read From Spreadsheet.vi and I just don't seem to have enough LV background to extract the pertinent  data into a graph. any suggestions?

    (It is silly to use "delete from array" if all you want is a column. The correct function is "index array")
    Joe's idea above basically works fine. Here's a quick adapdation (the node before the graph is "index array" from the array palette.).
    Message Edited by altenbach on 06-11-2007 11:57 AM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    FileRead.png ‏11 KB

  • Blob for binary file, read/write problems

    Hi,
    I am relatively new to this type of development so apologies if this question is a bit basic.
    I am trying to write a binary document (.doc) to a blob and read it back again, constructing the original word file. I have the following code for reading and writing the file:
    private void save_addagreement_Click(object sender, EventArgs e)
    // Save the agreement to the database
    int test_setting = 0;
    // create an OracleConnection object to connect to the
    // database and open the connection
    string constr;
    if (test_setting == 0)
    constr = "User Id=royalty;Password=royalty;data source=xe";
    else
    constr = "User ID=lob_user;Password=lob_password;data source=xe";
    OracleConnection myOracleConnection = new OracleConnection(constr);
    myOracleConnection.Open();
    // create an OracleCommand object to hold a SQL statement
    OracleCommand myOracleCommand = myOracleConnection.CreateCommand();
    myOracleCommand.CommandText = "insert into blob_content(id, blob_column) values 2, empty_blob())";
    OracleDataReader myOracleDataReader = myOracleCommand.ExecuteReader();
    // step 2: read the row
    OracleTransaction myOracleTransaction = myOracleConnection.BeginTransaction();
    myOracleCommand.CommandText =
    "SELECT id, blob_column FROM blob_content WHERE id = 2";
    myOracleDataReader = myOracleCommand.ExecuteReader();
    myOracleDataReader.Read();
    Console.WriteLine("myOracleDataReadre[\"id\"] = " + myOracleDataReader["id"]);
    OracleBlob myOracleBlob = myOracleDataReader.GetOracleBlobForUpdate(1);
    Console.WriteLine("OracleBlob = " + myOracleBlob.Length);
    myOracleBlob.Erase();
    FileStream fs = new FileStream(agreement_filename.Text, FileMode.Open, FileAccess.Read);
    Console.WriteLine("Opened " + agreement_filename.Text + " for reading");
    int numBytesRead;
    byte[] byteArray = new byte[fs.Length];
    numBytesRead = fs.Read(byteArray, 0, (Int32)fs.Length);
    Console.WriteLine(numBytesRead + " read from file");
    myOracleBlob.Write(byteArray, 0, byteArray.Length);
    Console.WriteLine(byteArray.Length + " written to blob object");
    Console.WriteLine("Blob Length = " + myOracleBlob.Length);
    fs.Close();
    myOracleDataReader.Close();
    myOracleConnection.Close();
    This gives the following console output:
    myOracleDataReadre["id"] = 2
    OracleBlob = 0
    Opened D:\sample_files\oly_in.doc for reading
    56832 read from file
    56832 written to blob object
    Blob Length = 56832
    My write to file code is:
    private void save_agreement_to_disk_Click(object sender, EventArgs e)
    string filename;
    SaveFileDialog savedoc = new SaveFileDialog();
    if (savedoc.ShowDialog() == DialogResult.OK)
    filename = savedoc.FileName;
    // create an OracleConnection object to connect to the
    // database and open the connection
    OracleConnection myOracleConnection = new OracleConnection("User ID=royalty;Password=royalty");
    myOracleConnection.Open();
    // create an OracleCommand object to hold a SQL statement
    OracleCommand myOracleCommand = myOracleConnection.CreateCommand();
    myOracleCommand.CommandText =
    "SELECT id, blob_column " +
    "FROM blob_content " +
    "WHERE id = 2";
    OracleDataReader myOracleDataReader = myOracleCommand.ExecuteReader();
    myOracleDataReader.Read();
    Console.WriteLine("myOracleDataReader[id] = " + myOracleDataReader["id"]);
    //Step 2: Get the LOB locator
    OracleBlob myOracleBlob = myOracleDataReader.GetOracleBlobForUpdate(1);
    Console.WriteLine("Blob size = " + myOracleBlob.Length);
    //Step 3: get the BLOB data using the read() method
    byte[] byteArray = new byte[500];
    int numBytesRead;
    int totalBytes = 0;
    FileStream fs = new FileStream(filename, FileMode.OpenOrCreate, FileAccess.Write);
    while ((numBytesRead = myOracleBlob.Read(byteArray, 0, 500)) > 0)
    totalBytes += numBytesRead;
    fs.Write(byteArray, 0, byteArray.Length);
    Console.WriteLine("numBytes = " + numBytesRead + " totalBytes = " + totalBytes);
    Console.WriteLine((int)fs.Length + " bytes written to file");
    fs.Close();
    myOracleDataReader.Close();
    myOracleConnection.Close();
    This gives the following console output:
    myOracleDataReader[id] = 2
    Blob size = 0
    0 bytes written to file
    If I manually add the blob file using the following:
    DECLARE
    my_blob BLOB;
    BEGIN
    -- load the BLOB
    my_bfile := BFILENAME('SAMPLE_FILES_DIR', 'binaryContent.doc');
    SELECT blob_column
    INTO my_blob
    FROM blob_content
    WHERE id = 1 FOR UPDATE;
    DBMS_LOB.FILEOPEN(my_bfile, dbms_lob.file_readonly);
    DBMS_LOB.LOADFROMFILE(my_blob, my_bfile, DBMS_LOB.GETLENGTH(my_bfile), 1, 1);
    DBMS_LOB.FILECLOSEALL();
    COMMIT;
    END;
    COMMIT;
    The write to file works perfectly. This tells me that there must be something wrong with my code that is writing the blob to the database. I tried where possible to following the Oracle article using large objects in .NET but that (along with most things on the internet) focus on uploading text files.
    Thanks in advance.
    Chris.

    myOracleCommand.CommandText = "insert into blob_content(id, blob_column) values 2, empty_blob())";
    OracleDataReader myOracleDataReader = myOracleCommand.ExecuteReader();
    This looks wrong, you shouldn't be using ExecuteReader unless you expect to get a result back. Try using ExecuteNonQuery to do the insert.

Maybe you are looking for

  • Built in camera no longer recognized..

    Just installed new hard drive, installed Leopard, iLife and iWork 09 and now my built in camera is no longer being recognized by iChat and other applications... Any advice?

  • Acrobat 9 Pro Extended does not allow multiple renditions

    I have tried adding several different kinds of media files (Tools > Multimedia > Video or Flash), but I can never see the Multimedia Properties dialog box, so therefore I cannot add additional renditions. I had no problem doing this in Acrobat 8 Pro.

  • Enable/disable second monitor Mavericks - only software solution.

    I am looking for a way to disable a second monitor (plugged into the Display Port of a 2011 Mac mini) without unplugging it. Does anyone know of a software solution? When I am working I like that second monitor for desktop space, but other times (wat

  • ORA-04301:Unable to allocate 8144 bytes of shared memory

    I am using 64 bit version of oracle 10g Release 2 (10.2.0.1.0) I am randomly getting this error. The full error message is below: ORA-04301:Unable to allocate 8144 bytes of shared memory("large pool","COMPANYHISTORY","kxs-heap-w","qesaQBinit:buffer")

  • I can't open the latest version of iphoto.

    When opening the latest version of Iphoto an error message appears that says; You can't open your current iphoto library using this version of Iphoto. You have made changes to your photo library using a newer version of iphoto. Please quit and use th