LabVIEW Graphics files input/output (not IMAQ)

Hello,
I am building a LabVIEW (8.2) application that will be
acting as a slave to a web server.  Its
primary function is to send graphics in text format (UTF8) over a socket.  There are lovely functions already that will
read and write PNG, BMP, and JPG.  But
the diagrams are locked and they do not expose the binary stream that is being
read or written to file. 
I would very much
like access to that binary stream directly.
I have a workaround (see example program), in that I can
write my image to a file, in this case a PNG file, and then immediately read
that file as a binary stream.  But this
is inefficient--notice how the example program takes a half-second to run on
just a tiny amount of data.  And I understand
that you don't want to expose your PNG encoding scheme to the world; But you
wouldn't have to unlock the diagram, nor expose your algorithm, in order to
output that binary stream.
So I know better than to ask for some function that I've
just dreamed up, as if NI is there to accommodate my fancies.  But in this case, I suspect the functionality
is already there, it's just encapsulated in a locked diagram.  I suspect that the full binary stream is
there underneath that 'write to png file' function.
You wouldn’t have to build it into a revised version of
LabVIEW (although as a hardcore LV
lover that is being dunked underwater to near suffocation in the internet pool,
I highly advise it).  If someone could
please, please, send me a function that exposes that data, I would be eternally
grateful for at least a day.  I am after
all about to drop $4200 or so of my own cash into this environment (although I’m
going to anyway, even if you disregard my comment/question).
I'm just surprised that it is not already a
function.  If you're wanting to nudge
LabVIEW in the direction of being able to accommodate web serving functionality
(which from a few recent whitepapers, I've gotten this feeling from NI), this
would be a fundamental requirement; i.e., being able to serve up little
graphics via binary (whatever encoding, UTF8, UTF7, doesn’t actually matter)
over a socket (really just a string control, that’s what goes into the TCP and
networking functions anyway).  LabVIEW's
2D and 3D graphs, as well as the picture control along with its sundry helper
functions, are hugely powerful.  Why not
let us use them to make the best interactive technical websites out there?
Unless of course you point out something obvious that I'm
missing, in which case I'll be both delighted and embarrassed.
Example program
explanation:  This shows the workaround that I mentioned.  You’ll want to look at the file in the root
C:\ directory “Through_the_binary_blender.png”. 
This will show that the binary stream I’ve extracted does indeed contain
the right data.  You can open the new PNG file with your choice of image viewers.
Message Edited by Ben Phillips on 11-08-2006 05:36 PM
Message Edited by Ben Phillips on 11-08-2006 05:37 PM
Attachments:
PNG_binary_stream.vi ‏23 KB

Well, I would welcome such a feature myself, although from a slightly different angle.
My apprentice wrote a program, with my help.
See http://forums.ni.com/ni/board/message?board.id=170&message.id=150815#M150815
It reads images via HTTP from the net. It would make good sense for me to turn this datastream straight into an image, but no, I can't do it.
I have to write a file, then turn around and read the file.
It seems like a bad decision to inseparably marry the encoding / decoding part with the file reading/writing part.
But then, they didn't ask me.
Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com
Blog for (mostly LabVIEW) programmers: Tips And Tricks

Similar Messages

  • Java.sql.SQLException: File input/output error: File input/output error: re

    Hi,
    We are using JCAPS 512. We use oracle eway to connect to Oracle 10g database. But sometimes we are getting the following exception
    and suddenly all jcds stop processing. If we restart the server again job continue processing, otherwise server hangs and nothing get processed.
    Exception is as follows
    java.sql.SQLException: File input/output error: File input/output error: reading: java.io.EOFException in statement [SET TABLE EVENT_STORE INDEX '11183416 55935']
         at org.hsqldb.Trace.getError(Unknown Source)
         at org.hsqldb.Log.runScript(Unknown Source)
         at org.hsqldb.Log.open(Unknown Source)
         at org.hsqldb.Database$Logger.openLog(Unknown Source)
         at org.hsqldb.Database.open(Unknown Source)
         at org.hsqldb.Database.<init>(Unknown Source)
         at org.hsqldb.jdbcConnection.openStandalone(Unknown Source)
         at org.hsqldb.jdbcConnection.<init>(Unknown Source)
         at org.hsqldb.jdbcDriver.connect(Unknown Source)
         at java.sql.DriverManager.getConnection(DriverManager.java:525)
         at java.sql.DriverManager.getConnection(DriverManager.java:171)
         at com.stc.eventmanagement.impl.DBEventStore$EventStoreDB.addNewConnection(DBEventStore.java:359)
         at com.stc.eventmanagement.impl.DBEventStore$EventStoreDB.getConnection(DBEventStore.java:444)
         at com.stc.eventmanagement.impl.DBEventStore$EventStoreDB.executeParameterizedQuery(DBEventStore.java:777)
         at com.stc.eventmanagement.impl.DBEventStore$EventStoreDB.access$000(DBEventStore.java:250)
         at com.stc.eventmanagement.impl.DBEventStore.getEventIDsList(DBEventStore.java:133)
         at com.stc.eventmanagement.impl.DBEventStore.getEventIDsList(DBEventStore.java:115)
         at com.stc.eventmanagement.impl.EventForwarderMBean.cachePersistedEvents(EventForwarderMBean.java:728)
         at com.stc.eventmanagement.impl.EventForwarderMBean.setup(EventForwarderMBean.java:334)
         at com.stc.eventmanagement.impl.EventForwarderMBean.invoke(EventForwarderMBean.java:565)
         at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(DynamicMetaDataImpl.java:213)
         at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:220)
         at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:815)
         at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:784)
         at com.stc.eventmanagement.impl.EventManagementService.setupEventForwarderMbean(EventManagementService.java:270)
         at com.stc.eventmanagement.impl.EventManagementService.registerMBean(EventManagementService.java:147)
         at com.stc.eventmanagement.impl.EventManagementService.startService(EventManagementService.java:96)
         at com.stc.eventmanagement.impl.EventManagementResourceAdapter.start(EventManagementResourceAdapter.java:75)
         at com.sun.enterprise.connectors.ActiveInboundResourceAdapter.<init>(ActiveInboundResourceAdapter.java:94)
         at com.sun.enterprise.connectors.ActiveRAFactory.createActiveResourceAdapter(ActiveRAFactory.java:74)
         at com.sun.enterprise.connectors.ResourceAdapterAdminServiceImpl.createActiveResourceAdapter(ResourceAdapterAdminServiceImpl.java:269)
         at com.sun.enterprise.connectors.ResourceAdapterAdminServiceImpl.createActiveResourceAdapter(ResourceAdapterAdminServiceImpl.java:372)
         at com.sun.enterprise.connectors.ConnectorRuntime.createActiveResourceAdapter(ConnectorRuntime.java:204)
         at com.sun.enterprise.server.ConnectorModuleLoader.load(ConnectorModuleLoader.java:87)
         at com.sun.enterprise.server.ConnectorModuleLoader.load(ConnectorModuleLoader.java:108)
         at com.sun.enterprise.server.AbstractManager.load(AbstractManager.java:216)
         at com.sun.enterprise.server.AbstractManager.load(AbstractManager.java:106)
         at com.sun.enterprise.server.ApplicationLifecycle.onStartup(ApplicationLifecycle.java:183)
         at com.sun.enterprise.server.ApplicationServer.onStartup(ApplicationServer.java:295)
         at com.sun.enterprise.server.PEMain.run(PEMain.java:238)
         at com.sun.enterprise.server.PEMain.main(PEMain.java:186)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at org.apache.commons.launcher.ChildMain.run(ChildMain.java:269)
    |#]
    Please provide some suggestions to overcome this  error
    Regards
    Venkatesh.S

    Delete the EventStoreDb.data file (its somewhere in your logical host) and restart the logical host.

  • Problem Removing Files: Input/Output Error

    I recently posted this article
    http://discussions.apple.com/thread.jspa?messageID=4596969#4596969
    about my struggles to repair my hard drive. I'm currently in Single-User Mode, in the process of manually removing files that returned the error "Overlapped Extent Allocation" during fsck. Everything's going well for the most part, but a few of the files I'm finding can't be removed. When I try, I receive this message:
    hfs: WARNING - blocks on volume Garfunkel not allocated!
    rm: [path name]: Input/output error
    It all sounds very dire and life-threatening, but I have no idea what this means. I can only assume it means there is a permissions issue. Am I close? Is there a way I can remove these files? So far all of the files have been iCalendar files or iApps preference files. If it's important, I can list the exact files. I hope someone can help me, because I know very little about Unix.
    Thanks to everyone who makes an attempt at rescuing me!

    Thanks. I did that, as per the Apple Support article instructions, but apparently I have to do it before every remove command. And sometimes, I have to input the command twice for it to work. Thanks for the tip.

  • 10 dukeroonies!  File input output

    Hi, i would truly love to put this little bugger to bed...
    can you help me...
    (if you cant help me, then maybe you could call the men-in-white?)
    http://forum.java.sun.com/thread.jsp?forum=54&thread=347108&tstart=0&trange=30

    file input output?
    why not...
    // Reading Text from a File
    try {
    BufferedReader in = new BufferedReader(new FileReader("infilename"));
    String str;
    while ((str = in.readLine()) != null) {
      process(str);
    in.close();
    } catch (IOException e) {
    // Writing to a File
    try {
    BufferedWriter out = new BufferedWriter(new FileWriter("outfilename"));
    out.write("aString");
    out.close();
    } catch (IOException e) {
    }http://www.javaalmanac.com/cgi-bin/search/find.pl?words=java.io%2Breading%2Bwriting%2Bfile

  • Try to mount a dmg file -- Input/Output error

    I have certainly searched thru postings, but I cannot quite find a solution.
    [1] An external FireWire drive holds a lot of dmg files of application installers.
    [2] Double-clicking some, not all, of them results in an Input/Output error.
    [3] Toast is always able to mount them.
    [4] When the error happens, an attempt to copy the dmg file onto the Desktop results in another error message "The Finder cannot complete the operation because some data in "<name>.dmg" could not be read or written. (Error code -365)". At this point, clicking on OK brings up a Copy window which hangs. The only way out is to Force-Quit the FInder.
    What should I do to rectify these issues?

    I appreciate your suggestions.
    The external drive in question is OWC's Mercury Elite-AL Pro with FireWire 800 (2) and 400 (1) ports
    It was purchased in February, 2008. Its original connection was thru FireWire 800 to my G5 Tower.
    [1] Ports
          The G5 has only one FireWire 800 port, while the OWC enclosure has two.
          So, I used the other FireWire 800 port on the OWC.
          The same intermittent I/O error in mounting dmg files.
    [2] Cables 
          I tried another FireWire 800 cable with either of the two FireWire 800 ports on the OWC.
          The same intermittent I/O error in mounting dmg files.
          So, I switched the connection to FireWire 400 between my G5 and the OWC.
          No I/O errors after trying to mount numerous dmg files.
    [3] MacBook Pro
          I disconnected the OWC and connected it to a MacBook Pro's FireWire 800 port.
          No I/O errors after trying to mount numerous dmg files.
    From [1], [2], and [3] above, can I deduce that something is wrong with the FireWire 800 port on my G5 Tower? I thought that both FireWire 800 and 400 ports on the G5 Tower were controlled by the same chip.
    Please advise.

  • File input does not show up the result in OWL

    Dear experts,
    In the training material in chapter 3 step 9 there was a part talking about file input.
    It works perfectly until I checked the WoC. There is no result showing up in the work center although in execution details there was a green dot and no errors.
    Has anyone had similar issue? Where should I check to ensure that the mass data run works properly?
    Many thanks
    Cheers
    Linh Hoang

    Linh,
    Latest update, which may help:
    I did manage to get a file to work.
    Here's the basic structure of my XML (i've renamed the elements):
    <?xml version="1.0" encoding="UTF-8"?>
    <MyCustomBusinessObjectUploadInputRequest>
    <MessageHeader>
    <CreationDateTime>2014-08-11T09:48:04.000Z</CreationDateTime>
    <TestDataIndicator>false</TestDataIndicator>
    <ReconciliationIndicator>false</ReconciliationIndicator>
    </MessageHeader>
    <List listCompleteTransmissionIndicator="true" actionCode="01" reconciliationPeriodCounterValue="123">
    <!---Repeat Below For Each Business Object--->
    <MyCustomBusinessObject actionCode="01">
    < ...Data Elements...>
    </MyCustomBusinessObject>
    <!---End Repeat--->
    </List>
    </MyCustomBusinessObjectUploadInputRequest>
    Here's what i'm currently working through now - if i have a single file with this structure in Unprocessed Files, and execute the run, it does work.
    However, if i upload two files and run them both at the same time, it either takes a lot longer to process, or sometimes nothing happens. Both files work individually, but it seems very intermittent when processed together.

  • Need PAPI WebService WSDL files - INPUT & OUTPUT schema will do

    Dear Friends,
    I need all the wsdl files or atleast input and output schema for all PAPI Web Services. Currently I dont have access to development env but need to put this in a document. The Oracle documents related to PAPI WS does not include this. They just show a few examples and code snippets.
    Thanks,
    Som
    Edited by: user10880245 on Sep 20, 2010 9:44 PM

    Try using SoapUI to view the PAPI-WS... It will list out all the methods that are available, and should allow you get what you need. You can even do this from studio, so a DEV environment isn't needed.
    HTH,
    -Kevin

  • Amd graphics card input output

    i need to know if this would work on my mointor http://www.amazon.ca/gp/product/B00EF0Z2RM/ref=oh_details_o00_s00_i00?ie=UTF8&psc=1
    graphics card xfx radeon 6670 2Gb 
    my monitor is only vga and that graphics card doesnt have vga i need a hdmi conversion
    so it can work with the monitor thanks

    Not a problem.  Thank you for the additional information.
    I don't believe that the video converter in the link will work with your computer.  It has a HDMI and VGA connector.  There is no HDMI port shown on your computer's Back I/O ports.  You will need the same type of converter with USB 2.0 to VGA adapter.
    Please click the "Thumbs up + button" if I have helped you and click "Accept as Solution" if your problem is solved.
    Signature:
    HP TouchPad - 1.2 GHz; 1 GB memory; 32 GB storage; WebOS/CyanogenMod 11(Kit Kat)
    HP 10 Plus; Android-Kit Kat; 1.0 GHz Allwinner A31 ARM Cortex A7 Quad Core Processor ; 2GB RAM Memory Long: 2 GB DDR3L SDRAM (1600MHz); 16GB disable eMMC 16GB v4.51
    HP Omen; i7-4710QH; 8 GB memory; 256 GB San Disk SSD; Win 8.1
    HP Photosmart 7520 AIO
    ++++++++++++++++++
    **Click the Thumbs Up+ to say 'Thanks' and the 'Accept as Solution' if I have solved your problem.**
    Intelligence is God given; Wisdom is the sum of our mistakes!
    I am not an HP employee.

  • File Input Output -

    Ive got a graphical application -
    something that lets the user manipulate objects on screen i.e. drag and stretch
    How would i save an object on screen -
    using the save menut item
    and then how is it possible to get the same object on screen when the user clicks on open from the file menu -
    Could some one help me on that

    If the object implements java.io.Serializable then the object can be saved to disk using ObjectOutputStream.writeObject.
    There is also a method to save objects as xml (which you might find by searching this fourm for serializable or looking at the API for the above classes (because I think xml may be the preferred method).

  • Re: file input/output

         private class PurchaseButtonHandler implements ActionListener
                                       throws ExceptionClasses don't throw exceptions. Methods do. Remove the 2nd line.

    hidden_within wrote:
    This is what I now get:
    Ch8Project.java:64: unreported exception java.io.FileNotFoundException; must be caught or declared to be thrown
              Scanner infile = new Scanner(new FileReader("memberData.txt"));
    Tip of the day: learn the general meaning of each compiler error. How? Type it in google
    Mel

  • Error: input/output field not defined in subscreen.

    Hello Experts,
    I have defined a subscreen for transaction MM41 and when I try to put the statement: 'FIELD: MARA-ZZPARENT'
    there is an error saying input/output not defined. I already declared this in layout and it is there in element list.
    What causes this error? Thank you guys!

    Hi,
    What you can do is create a new ztop include from the existing top include.
    Define the field in ZTOP include.
    And in the main program change the statement for include top to include ztop.
    Hope this helps you.
    Regards,
    Tarun

  • Buffered input/output stream

    How the buffereing is done in buffered input/output streams?
    From the API doc I got to know that they use internal buffer to store bytes before they can be read or written. But i found that File input/output stream also have methods like read(byte[]) or write(byte[]). So what is extra in buffered input/ouput streams? Does the phrase "buffered" suggests that bytes can be read from an array or be written to an array? Am i thinking the right way?

    How the buffereing is done in buffered input/output
    streams?
    From the API doc I got to know that they use internal
    buffer to store bytes before they can be read or
    written. But i found that File input/output stream
    also have methods like read(byte[]) or write(byte[]).Thouse are your buffer, not the streams'.
    So what is extra in buffered input/ouput streams?
    Does the phrase "buffered" suggests that bytes can be
    read from an array or be written to an array? Am i
    thinking the right way?No. It means that the stream either prefetches some data even if it's not requested yet, or that it withholds data that it's supposed to write until it's flushed or gets a larger chunk.

  • File input question

    I'm new to java and I'm trying to write a program using file input/output.
    The user is asked for the names of an input file and an output file.
    My question is that in case I don't specify the path of the input file, where should it reside?
    thanks,

    My question is that in case I don't specify the path
    of the input file, where should it reside? In the present working directory. Which is not reliably known at runtime. If the input file will remain unchanged, you can put it into your JAR (if you create one) or somewhere else in your classpath, like the package root, and use getClass().getResourceAsStream("/thefile.ext") to load it. That will always work.

  • Nvidia Input/Output error. Could not open the device file /dev/nvidia0

    Hello, I finally have Arch running on my MacBook pro 3,1 (mid 2007) but when I startx after installing Nvidia drivers it gives the Input/Output error and states "could not open device file /dev/nvidia0." I tried everything from the Nvidia wiki, and nothing seems to work. Does anyone please have any other ideas or things to try? My Nvidia card is 8600M GT and I have installed xorg-server, xorg-apps and Nvidia-utils already.  Also is it possible my graphics card is not compatiable with this new kernel? Thank you for your time.

    You know that this posts a huge list - and I couldnt remember how to trim for certain keywords (which one would you be interested in?).
    So here the last few things regarding Video: from dmesg:
    [..] nvidia: module license "NVIDIA" taints kernel.
    [..] Disabling lock debugging due to kernel taint.
    [..] nvidia 0000:01:00.0: enabling device (0002 -> 0003)
    [..] vgaarb device changed decodes: PCI:0000:01:00.0,oldcodes=io+mem,decodes=none:owns=none
    [..] NVRM: loading NVIDIA UNIX x86_64 Kernel Module 304.37 Wed Aug 8 19:52:48 PDT 2012
    then comes Swap, wlan, eth0 etc..

  • How can I input read a line from a file and output it into the screen?

    How can I input read a line from a file and output it into the screen?
    If I have a file contains html code and I only want the URL, for example, www24.brinkster.com how can I read that into the buffer and write the output into the screen that using Java?
    Any help will be appreciate!
    ======START FILE default.html ========
    <html>
    <body>
    <br><br>
    <center>
    <font size=4 face=arial color=#336699>
    <b>Welcome to a DerekTran's Website!</b><br>
    Underconstructions.... <br>
    </font> </center>
    <font size=3 face=arial color=black> <br>
    Hello,<br>
    <br>
    I've been using the PWS to run the website on NT workstation 4.0. It was working
    fine. <br>
    The URL should be as below: <br>
    http://127.0.0.1/index.htm or http://localhost/index.htm
    <p>And suddently, it stops working, it can't find the connection. I tried to figure
    out what's going on, but still <font color="#FF0000">NO CLUES</font>. Does anyone
    know what's going on? Please see the link for more.... I believe that I setup
    everything correctly and the bugs still flying in the server.... <br>
    Thank you for your help.</P>
    </font>
    <p><font size=3 face=arial color=black>PeerWebServer.doc
    <br>
    <p><font size=3 face=arial color=black>CannotFindServer.doc
    <br>
    <p><font size=3 face=arial color=black>HOSTS file is not found
    <br>
    <p><font size=3 face=arial color=black>LMHOSTS file
    <br>
    <p><font size=3 face=arial color=black>How to Setup PWS on NT
    <BR>
    <p><font size=3 face=arial color=black>Issdmin doc</BR>
    Please be patient while the document is download....</font>
    <font size=3 face=arial color=black><br>If you have any ideas please drop me a
    few words at [email protected] </font><br>
    <br>
    <br>
    </p>
    <p><!--#include file="Hits.asp"--> </p>
    </body>
    </html>
    ========= END OF FILE ===============

    Hi!
    This is a possible solution to your problem.
    import java.io.*;
    class AddressExtractor {
         public static void main(String args[]) throws IOException{
              //retrieve the commandline parameters
              String fileName = "default.html";
              if (args.length != 0)      fileName =args[0];
               else {
                   System.out.println("Usage : java AddressExtractor <htmlfile>");
                   System.exit(0);
              BufferedReader in = new BufferedReader(new FileReader(new File(fileName)));
              StreamTokenizer st = new StreamTokenizer(in);
              st.lowerCaseMode(true);
              st.wordChars('/','/'); //include '/' chars as part of token
              st.wordChars(':',':'); //include ':' chars as part of token
              st.quoteChar('\"'); //set the " quote char
              int i;
              while (st.ttype != StreamTokenizer.TT_EOF) {
                   i = st.nextToken();
                   if (st.ttype == StreamTokenizer.TT_WORD) {          
                        if (st.sval.equals("href")) {               
                             i = st.nextToken(); //the next token (assumed) is the  '=' sign
                             i = st.nextToken(); //then after it is the href value.               
                             getURL(st.sval); //retrieve address
              in.close();
         static void getURL(String s) {     
              //Check string if it has http:// and truncate if it does
              if (s.indexOf("http://") >  -1) {
                   s = s.substring(s.indexOf("http://") + 7, s.length());
              //check if not mailto: do not print otherwise
              if (s.indexOf("mailto:") != -1) return;
              //printout anything after http:// and the next '/'
              //if no '/' then print all
                   if (s.indexOf('/') > -1) {
                        System.out.println(s.substring(0, s.indexOf('/')));
                   } else System.out.println(s);
    }Hope this helps. I used static methods instead of encapsulating everyting into a class.

Maybe you are looking for