Loading binary data to graph

Hello, I have a VI that uses an XY-Graph to graph 2 plots and after my buffer exceeds a certain limit it writes that data into a binary file and saves it on my computer.  Now I'm trying to make a VI that can open that binary file and display it on an XY-Graph.  But i'm having trouble, I keep getting an error... I'm using the LabVIEW Example VI "Read Binary File" to do this.  My data is a cluster of 2 2D arrays, each array contains the X and Y values needed for the plot.
I guess passing the data isn't as stragith forward as I assumed, does anyone know what I may be doing wrong? Here's a screen shot of the error.
Thanks!

Without the actual code to debug, I can only make a few guesses/observations.
1.   No need to read the file size, just set the count of Read from Binary File to -1 and read the whole thing.  Your calculation is incorrect, count is the number of 'elements' to read, not necessarily equal to the number of bytes.  For example, if you set the datatype to I32, you will read 4*count bytes.
2.  That datatype does not seem like the proper one for a multiple XY graph.  You should have an array of clusters containing 2 1D arrays.   Basically an array of what is called 'output cluster' in your screenshot.  To be honest, I am a little flumoxed as to why XY Graph seems to like that datatype.
Right-click on XY Graph and choose Create Constant and see what you get.
Message Edited by Darin.K on 12-07-2009 01:26 PM

Similar Messages

  • Show 8 bit binary data on graph

    Hello..
    I have an 8bit binary numeric control and I want it to be shown on graph so that it would look like a digital bit pattern just like image below.
    Please Help..

    Try something like the attached draft (LabVIEW 8.2).
    convert number to boolean array
    convert boolean array to (0,1) array
    graph (0,1) array.
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    GraphBits.vi ‏13 KB
    GraphBits.png ‏8 KB

  • Loading large volumes of arbitrary binary data to a clip

    It is easy to download external data in XML format to a movie
    clip. However, what I need is to load really large volumes of
    readonly binary data. In my case, textual representation is not an
    option. Is it possible to download an arbitrary array of bytes into
    memory then seek this array to read individual bytes?
    I don't think that ActionsScript arrays like this one
    var data:Array = [1,2,3,...];
    could be solution fro my problem either. The reason is that
    virtual machine associates so much extra information with every
    array member.
    The only solution I came so far is to pack binary data as
    strings,
    var data:String = "\u0000\u1234\uabcd";
    two byte per character. There should not be any storage
    overhead, and seeking for an individual data member is trivial.
    But I doubt is there any better solution?

    For as2 I don't believe there's any other option other than
    to load it in as an encoded string and then decode it internally.
    So if you have \u0000 as in the above example you will find it
    doesn't work.
    var data:String = "\u0000\u1234\uabcd";
    trace(data.length) //traces 0 (zero) because the first
    character is a string terminator
    I think you need an encoding method like base64 in the source
    string and an equivalent decoder class for decoding to binary
    inside flash. I'm not expert on this stuff... others may know more
    or it could be a starting point for your research.
    In the past I've used the meychi.com classes for this type of
    thing. Couldn't see them online now... but there's something else
    here that may be useful:
    http://www.svendens.be/blog/archives/8
    With as3 - as I understand it - there's no problem because
    you can load binary data.

  • Loading Labview Binary Data into Matlab

    This post explains the Labview binary data format. I couldn't find all of this information in any one place so this ought to help anyone in the future.  I didn't want to add any overhead in Labview so I did all of my conversion in Matlab.
    The Labview VI "Write to Binary File" writes data to a file in a linear format using Big Endian numbers of the type wired into the "Write to Binary File" VI. The array dimensions are listed before the actual array data. 
    fid = fopen('BinaryData.bin','r','ieee-be'); % Open the binary file
    Dim1 = fread(fid,4); % Reads the first dimension
    Dim2 = fread(fid,4); % Reads the second dimension
    Dim3 = ...
    Each dimension's length is specified by 4 bytes. Each increment of the first, second, third, and fourth byte represent 2^32, 2^16, 2^8, and 1 respectively. 0 0 2 38 equates to 2*256 + 38 = 550 values for that particular dimension.
    As long as you know the number of dimensions and precision of your binary data you can load it.
    Data = fread(fid,prod([Dim1 Dim2 Dim3]),'double',0,'ieee-be'); % Load double precision data
    If you have appended multiple arrays to the same file in Labview you would repeat this procedure. Load each dimension then load the data, repeat.
    Data = fread(fid,prod([Dim1 Dim2 Dim3]),'int8',0,'ieee-be'); % Load int8 precision data or boolean data
    I had to create a function for my own purposes so I thought I'd share it with everyone else too.  I uploaded it to the Matlab File Exchange.  The file is named labviewload.m.
    This was tested on Matlab R2007a and Labview 8.2.

    Thanks. I have the same questions as I tried to load labview binary data into Matlab. 
    -John

  • Conversion from scaled ton unscaled data using Graph Acquired Binary Data

    Hello !
    I want to acquire temperature with a pyrometer using a PCI 6220 (analog input (0-5V)). I'd like to use the VI
    Cont Acq&Graph Voltage-To File(Binary) to write the data into a file and the VI Graph Acquired Binary Data to read it and analyze it. But in this VI, I didn't understand well the functionnement of "Convert unscaled to scaled data", I know it takes informations in the header to scale the data but how ?
    My card will give me back a voltage, but how can I transform it into temperature ? Can I configure this somewhere, and then the "Convert unscaled to scaled data" will do it, or should I do this myself with a formula ?
    Thanks.

    Nanie, I've used these example extensively and I think I can help. Incidently, there is actually a bug in the examples, but I will start a new thread to discuss this (I haven't written the post yet, but it will be under "Bug in Graph Acquired Binary Data.vi:create header.vi Example" when I do get around to posting it). Anyway, to address your questions about the scaling. I've included an image of the block diagram of Convert Unscaled to Scaled.vi for reference.
    To start, the PCI-6220 has a 16bit resolution. That means that the range (±10V for example) is broken down into 2^16 (65536) steps, or steps of ~0.3mV (20V/65536) in this example. When the data is acquired, it is read as the number of steps (an integer) and that is how you are saving it. In general it takes less space to store integers than real numbers. In this case you are storing the results in I16's (2 bytes/value) instead of SGL's or DBL's (4 or 8 bytes/value respectively).
    To convert the integer to a scaled value (either volts, or some other engineering unit) you need to scale it. In the situation where you have a linear transfer function (scaled = offset + multiplier * unscaled) which is a 1st order polynomial it's pretty straight forward. The Convert Unscaled to Scaled.vi handles the more general case of scaling by an nth order polynomial (a0*x^0+a1*x^1+a2*x^2+...+an*x^n). A linear transfer function has two coefficients: a0 is the offset, and a1 is the multiplier, the rest of the a's are zero.
    When you use the Cont Acq&Graph Voltage-To File(Binary).vi to save your data, a header is created which contains the scaling coefficients stored in an array. When you read the file with Graph Acquired Binary Data.vi those scaling coefficients are read in and converted to a two dimensional array called Header Information that looks like this:
    ch0 sample rate, ch0 a0, ch0 a1, ch0 a2,..., ch0 an
    ch1 sample rate, ch1 a0, ch1 a1, ch1 a2,..., ch1 an
    ch2 sample rate, ch2 a0, ch2 a1, ch2 a2,..., ch2 an
    The array then gets transposed before continuing.
    This transposed array, and the unscaled data are passed into Convert Unscaled to Scaled.vi. I am probably just now getting to your question, but hopefully the background makes the rest of this simple. The Header Information array gets split up with the sample rates (the first row in the transposed array), the offsets (the second row), and all the rest of the gains entering the for loops separately. The sample rate sets the dt for the channel, the offset is used to intialize the scaled data array, and the gains are used to multiply the unscaled data. With a linear transfer function, there will only by one gain for each channel. The clever part of this design is that nothing has to be changed to handle non-linear polynomial transfer functions.
    I normally just convert everything to volts and then manually scale from there if I want to convert to engineering units. I suspect that if you use the express vi's (or configure the task using Create DAQmx Task in the Data Neighborhood of MAX) to configure a channel for temperature measurement, the required scaling coefficients will be incorporated into the Header Information array automatically when the data is saved and you won't have to do anything manually other than selecting the appropriate task when configuring your acquisition.
    Hope this answers your questions.
    ChrisMessage Edited by C. Minnella on 04-15-2005 02:42 PM
    Attachments:
    Convert Unscaled to Scaled.jpg ‏81 KB

  • Fix for "Graph Acquired Binary Data.vi" in daqmx 7.4's "Measure Voltage.llb". (factory gains are reversed)

    While perusing binary data collected from the SCXI 1102 and usb 1600, the gains were found
    to be reversed using daqmx writer/reader example code from NI. This bug only surfaces if your using different gains amongst the channels.
    http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=F7199E619CBF4215E0340003BA230ECF&p_node=201208&p_submitted=Y&p_rank=5&p_answer=yes
    has the fix for the binary to floating point viewer vi, "Graph Acquired Binary Data.vi".
    Enjoy.
    Best,
    Davy Baker
    GAMI

    duplicate post
    Continue in other thread
    Message Edited by smercurio_fc on 11-14-2008 09:10 AM

  • Airport downloading binary data instead of loading web page?

    I've been having the usual problems with dropped connections for the past month since I set up my new dsl service. It didn't bother me too much since all I had to do was unplug my airport and plug it back in. This morning it happened again and I decided to go ahead and update the firmware to 5.7.
    Whenever I tried to open a web page, I would get a little popup box that stated I was trying to download binary data. It gives me the option of opening in Textedit, etc. I'd try a different web page and the same thing happened. I've tried this on multiple computers and multiple browsers with the same result. I then downgraded to 5.5.1: same result. Tried soft and hard factory resets. No help. It's not the modem, since I am connected to it via ethernet right now with no problems. I can't believe I am the only one with this problem but I've searched all over and cannot find a fix for this. Any suggestions (in english please, I'm not completely computer-literate)?

    Mac OS X (10.6.6)
    Well, there is one problem....

  • Where is the binary data of this icon stored and retrieved from Application server?

    Hello guys,
    Today I observed one phenomenon and could not explain it per my knowledge.
    I have one url which points to an icon in application server:
    https://<host name>:44301/sap/public/bc/ur/nw5/themes/sap_corbu/common/libs/Icon/SuccessMessage.gif
    I could successfully open it via chrome:
    and after that I could see an entry in ICM server cache. Everything works perfectly.
    Then I tried to check this icon in mime browser in SE80. To my surprise, the folder /sap/public/bc/ur/nw5/themes is empty.
    However, the ICM cache shows that there is a subfolder called "sap_corbu" under "themes" folder. But why I cannot find it in mime browser?
    Then I write a report to retrieve the binary data of icon via CL_HTTP_CLIENT, and clear the ICM buffer via tcode SMICM.
    I expect this time some database table will be queried to load the content of the icon, since now the buffer is not available.
    To my surprise again, in SAT no database table is involved.
    So now I am confused: since I have already cleared the ICM server cache, where does the icon binary data come from when I run the report to access the icon?
    Best regards,
    Jerry

    Hello guys,
    one colleague today told me that there is a zip file "ur_mimes_nw7.zip" in MIME repository /PUBLIC/BC/UR/ur_mines_nw7.zip. I download it locally and unzip it and indeed find many theme folders including sap_corbu folder and its resource files. So I guess there must be some logic done in web application server which will unzip this archive file and put each theme folder to the corresponding folders in application server. I would assume those logic are done outside ABAP stack side, this is the reason I cannot find any hint of them in ABAP backend via tcode SAT even I clear both client and server side cache.
    Best regards,
    Jerry

  • Help needed with binary data in xml (dtd,xml inside)

    I am using the java xml sql utility. I am trying to load some info into a table.
    my.dtd:
    <!ELEMENT ROWSET (ROW*)>
    <!ELEMENT ROW (ID,JPEGS?)>
    <!ELEMENT ID (#PCDATA)>
    <!ELEMENT DESCRIPTION EMPTY>
    <!ATTLIST DESCRIPTION file ENTITY #REQUIRED>
    <!NOTATION INFOFILE SYSTEM "Files with binary data inside">
    <!ENTITY file1 SYSTEM "abc.jpg" NDATA INFOFILE>
    xml file:
    <?xml version="1.0" standalone="no"?>
    <!DOCTYPE ROWSET SYSTEM "MY.DTD">
    <ROWSET>
    <ROW>
    <ID>1272</ID>
    <DESCRIPTION file="file1"/>
    </ROW>
    </ROWSET>
    I am using the insertXML method to do this. However, the only value that gets loaded is the ID. abc.jpg is in the same directory where I ran the java program.
    Thanks in advance.

    Sorry! wrong dtd. It should read this instead:
    my.dtd:
    <!ELEMENT ROWSET (ROW*)>
    <!ELEMENT ROW (ID,DESCRIPTION?)>
    <!ELEMENT ID (#PCDATA)>
    <!ELEMENT DESCRIPTION EMPTY>
    <!ATTLIST DESCRIPTION file ENTITY #REQUIRED>
    <!NOTATION INFOFILE SYSTEM "Files with binary data inside">
    <!ENTITY file1 SYSTEM "abc.jpg" NDATA INFOFILE>
    null

  • Errors and exceptions in writing large binary data on sockets!!! urgent

    hi
    I am trying to write large binary data in the form of byte arrays on sockets.
    Data is as large as 512KB(== 524288bytes) So i store the data (actually read from a file through FileInputStream ) and then write on the socket with lines like this
    DataOutputStream dos =
    new DataOutputStream(new BufferedOutputStream(sock.getOutputStream()));
    dos.write(b);
    /* suppose b is the arrayreference in which data is stored. sometimes i write with that offset + len function*/
    dos.flush();
    dos.close();
    sock.close();
    but the program is not stable: sometimes the whole 512KB is read on other side and sometimes less usually 64KB.
    The program is unthreaded.
    There is another problem : one side(reading or writing) sometimes gives error :
    java.net.SocketException: Software caused connection abort: socket write error
    please reply and reply soon and give ur suggestions
    thanks

    hi
    I am trying to write large binary data in theform
    of byte arrays on sockets.
    Data is as large as 512KB(== 524288bytes) So istore
    the data (actually read from a file through
    FileInputStream ) and then write on the socketwith
    lines like this
    DataOutputStream dos =
    new DataOutputStream(new
    BufferedOutputStream(sock.getOutputStream()));
    dos.write(b);
    /* suppose b is the arrayreference in which datais
    stored. sometimes i write with that offset + len
    function*/
    dos.flush();
    dos.close();
    sock.close();
    but the program is not stable: sometimes the whole
    512KB is read on other side and sometimes less
    usually 64KB.
    The program is unthreaded.
    There is another problem : one side(reading or
    writing) sometimes gives error :
    java.net.SocketException: Software caused
    connection abort: socket write error
    please reply and reply soon and give ursuggestions
    thanksUmm how are you reading the data on the other side?
    some of your code snippet might help. Your writing
    code seems ok. I've written a file transfer program
    in a similar fashion and have successfully testing on
    different platforms (AIX, AS400, Solaris, Windows,
    etc) without any problems and without needing to set
    the buffer sizes with files as large as 600MB and you
    said you're testing this on the loopback?
    Point here is you should never need to reset any of the default TCP options to get program correctness. The options are more for optimizations and fine tuning. If indeed you need to change the options to get your program to work, then you program wont be able to scale under different load.

  • Binary Data

    Hi,
    I'm developing a program that reads and writes data via http. Although I am having a problem with the response that the server is giving me. The server is sending me binary data and I'm unsure how to decode it. For example, part of the below request returns 41 97 33 33, which is supposed to convert to 18.90. Here is the code that I'm using to connect and read the data.
    URL urlq = new URL(url);
    URLConnection streamrConnection = urlq.openConnection();
    streamConnection.setDoOutput(true);
    DataInputStream dis = new DataInputStream(streamConnection.getInputStream());
    float inputLine;
    while ((inputLine = dis.readFloat()) != -1) {
    System.out.printf("%f",inputLine);
    The output of this code is
    0.000000
    0.000000
    3367254360064.000000
    0.000000
    -0.000000
    -0.000000
    -0.000000
    -0.000000
    0.000000
    0.000000
    -67013848328296200000.000000
    -0.000000
    -0.000000
    -0.000000
    -0.000000
    -206013237815188270000000.000000
    0.000000
    1084495953920.000000
    Could anyone tell me the proper way to decode binary data coming from a server over http? Thanks for any help.

    jjstuart79 wrote:
    In order to print the actual bytes I'm receiving would I just use the int read(byte[] b) or the byte readByte() methods from the dataInputStream class? Maybe just wrap it in a LoggingInputStream?
    You can find loads of examples from Google (LoggingInputStream).

  • How to make JSF render binary data

    Hi Everybody,
    I am trying to make JSF render some binary data. I have my own components, set of renderers and render kit all implemented.
    Still, I get several problems, one of them seems to bo implementation of UIComponentTag (in Sun's reference implementation, but, on the first glance,MyFaces has the same problem).
    If you are rendering response, you should use either ResponseWriter or ResponseStream, not both of them, correct ? But UIComponentTag directly creates ResponseWriter in doStartTag() code - and what are my chances to use ResponseStream somewhere ? I was thinking about UIComponent subclassing ( re-implementing doStartTag() and doEndTag() ), but it does not seems to be easy if you are NOT calling parent's methods .
    Of course, I can access servlet's responseStream through facesContext and do anything I would like, but it seems to be more than a hack
    So - does anybody has a positive experience of making JSF render binary data, or this is more a theoretical possibility ?
    Regards, Nikolajs Krasnikovs

    If the data bean is request scoped, then just load it in its constructor or initialization block.
    If it is session scoped, add the following lines to the getter of the datamodel:
    if (FacesContext.getCurrentInstance().getRenderResponse()) {
        // Reload data list here.
    }Also see the following article for some new insights: http://balusc.blogspot.com/2006/06/using-datatables.html

  • Plotting Data on Graph

    Hi there, I have the following question that I would like to ask.
    I am currently receiving binary data from my ADC chip that I connected to labview via NI data accquirsation card. For every 10 bits of binary data, I have programmed labview to convert it to a decimal number. Therefore, I will constantly be having a set of decimal number in labview.
    Now I will like to plot this set of decimal number on a graph. Since I am using Analog to Digital chip to convert my Sine Wave, eventually what I am suppose to see on the labview graph, would be something like a dotted Sine Wave, which is made up of the decimal number that I had converted.
    My question is how can I build my program so that this set of decimal number can be plotted in a Amplitude and Time Domain on  the Graph?
    Ultimately, what I need to achieve is actually to do a FFT on this constructed waveform so that I can get the frequency of the waveform.
    Therefore, is there is a way to just supply the set of decimal number that I get and do FFT straight away so that I can retrieve the frequency of the waveform and bypass the step of plotting it onto a graph? 
    Hope you can understand what I am trying to say.
    Thanks and Regards
    Keith Tan

    It's not clear what you're exactly doing. You said "I tried to pump the set of 10bits words into a graph". What does this mean? How are you converting the 10 bits to a number? What numeric representation are you using? Integer or floating point? Also, are you using a waveform graph, or a waveform chart? If you feed one number to a graph, then you will only see one point. A chart, on the other hand, has a history, so it will plot that point, plus all the others that have been fed before (up to the history length).
    Can you show us some code?
    UPDATE: Hold on. This seems to be the same question as this one. Please stick to one thread so everyone can see what's already been covered and suggested, and folks don't waste their time answering something that's already been answered. 
    Message Edited by smercurio_fc on 06-11-2009 08:20 PM

  • Load File Data Block

    Hi.
    i want to load cap file (binary code) to java card(GP 2.1.1).
    load file data block means binary code of cap file , right?
    and im wondering how do i change structure for BER-TLV?
    binay codes are [50 4B 03 04 14 00 08 00 08 00 CF 56 86 3D 00 00 00 00 00 00 00 00 ....]
    80 E8 00 00 FA C4 *82 0A 29* 50 4B 03 04 14 00 08 00 08 00... (binary code)...
    i found out tag"82" means have length with 2 more byte (0x0A29 for now)
    do i need to add to load file data block structure somthing else ?
    thanks

    845467 wrote:load file data block means binary code of cap file , right?AFAIK no, not whole cap file. You have to find in cap file components such as "header.cap", "directory.cap" and others and download only them. These components are described in JCVM specification. You must download them in order defined in specification.
    845467 wrote:80 E8 00 00 FA C4 82 0A 29 50 4B 03 04 14 00 08 00 08 00... (binary code)...APDU must look something like that
    80 E8 00 00 FA C4 82 XX XX 01 YY YY DATA 02 ZZ ZZ DATA ....
    XX XX - lenght of C4 tag
    01 YY YY - name and length of header.cap component
    02 ZZ ZZ - name and length of directory.cap component
    Note, debug.cap and descriptor.cap are optional. In case of JCOP cards they are downloaded out of C4 tag.

  • Importing very special binary data into Diadem

    In order to use DIAdem I need to import binary data from transient recorders. The data is stored in block mode (CH after CH), as X-Y data pairs. All channels have different length but the structure and channel names are written into a special header block, preceeding the data. The X-Y data pairs are written into words (32-bit) with variable X/Y separation, that is that Y maybe e.g. 12-bit wide and thus X using the remaining 20 bits of the word. The X/Y separation position is coded in the header too.
    Can I define a very complex import rule directly in DIAdem or can I call a LabVIEW file read and decode driver? Or is it simply impossible, except I convert all of my 120000 data sets and have them using 4 times more space?
    Many thanks in advance to the experts!
    Marco Mailand
    ABB Switzerland Ltd.
    High Voltage Technology
    Solved!
    Go to Solution.

    Mr Mailand,
    generally, you can import binary data with the function "Import via header" which you find in the file menu (submenu DAT files) in the Navigator / Data Window. Within the dialog you can specify how your data is ordered in the file. But you are limited to some standard storage mode so you might not succeed importing the data in that way.
    Of course you can also call LabVIEW VIs and write the imported Data directly to DIAdem channels. The LabVIEW-DIAdem Connectivity VIs provide the functions you need for the data exchange.
    Another way would be to import the data with help of a VBScript.
    But there is also another method to expand the DIAdem features: With the GPI toolkit you can generate your own plugin DLLs for DIAdem. You can implement all the code you need
    to import the data in a c-program and import that function into DIAdem. In that way you will be able to load your data just as any other datatype using the standard file open nemu.
    GPI Toolkit for add-on DIAdem DLL creation
    http://digital.ni.com/softlib.nsf/websearch/D605AA96CF81760C86256C7600742EC5?opendocument&node=132070_US
    LabVIEW DIAdem Connectivity VIs Version 2.1
    http://digital.ni.com/softlib.nsf/websearch/D73B15862235486D86256D2D00798738?opendocument&node=132070_US
    Calling LabVIEW VIs interactively from DIAdem
    http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=D18837DE23EE32F6E034080020E74861&p_node=DZ52246&p_source=External
    Ingo Schumacher
    Application Engineering
    National Instruments

Maybe you are looking for

  • BAPI for Mass Purchase Order Confirmation

    Dear All, In standard SAP,it is possible to confirm for single line item only by using confirmation tab. We want to confirm Mass PO Confirmation. Is there any BAPI for Mass Purchase Order Confirmation? Regards, Ramesh

  • How do you save pictures in Safari directly as desktop background?

    I just switched from Firefox because I'm thinking of getting a Mac someday and wanted to adjust to some of the software. I love Safari but it's missing something Safari had. When you right-click on a picture in Firefox there's an option to 'set as de

  • My Captivate 7 Drag and Drop interaction is hit or miss . . .

    The interaction is with mutiple targets, each with multiple correct drag sources, some drag sources can be used in more than one drop target. In the background of each target, I have deselected "accept all" and then had selected only the acceptable a

  • Http post does not work in portlet

    Hi, I have a simple portlet that has a form using http post. When I submit the portal page just displays a blank page. And request parameter name is prefix by only "_pirefnull" : <INPUT TYPE="hidden" name="_pirefnull.param1" value="hello" /> When I c

  • Forget security answer question

    im forget the security answer question