How do I Only read from TCP/IP listener if there is data?

In my data acquisition software that I've written, I have a TCP/IP listener to occasionally receive messages from Matlab.  I only want to do that if there are available bytes to be read.  I've thought of setting the mode on the listener to Immediate, but it says in the help that there will still be a timeout error.  The main things that I'm looking at are avoiding timeout errors, and I don't want waiting for the message to interfere with the data acquisition.
Thanks,
Alan Stemmons
[email protected]

The data acquisition software is running in Labview, while Matlab is running software to control the antenna position.  What I would like to do, is have Matlab send a message when the antenna has arrived at the correct position telling Labview to start acquiring, and then also send a message to Labview telling it when to stop acquiring.  In between this time, while labview is acquiring, Matlab will also send messages to Labview telling where the antenna is pointed.  An example message would be "Az=180, El=45\n".  The purpose for this is to keep a log file of when the antenna moves relative to when data acquisition started.  The problem that I've had when I tried doing this with a TCP/IP read block with a short timeout is that the read buffer overruns.  Basically, I just have a while loop with a Daqmx read block, then the data from that read block is written to a binary file.  In this while loop there is a TCP/IP read block that uses immediate mode with a timeout of 10 ms.  It tries comparing the string that is read to "Stop Acquiring\n".  That is the condition to terminate the the while loop.  I'm not going to worry about the log file until I can actually get it to acquire for the whole time.  It would be nice if there was some way to make this interrupt driven, so it would only pay attention to the tcp/ip read block if there was actually data.  I'm assuming that's where the problem is, although I might be wrong.
Thank you.

Similar Messages

  • How to keep Reader from being installed if running Pro? Running Acrobat X Pro. Occaisionally, a website with a PDF triggers Reader to be installed on my system. NEVER want reader (that's why i bought Pro). How do i keep Reader from EVER being installed?

    Running Acrobat X Pro.
    Occasionally, a website with a PDF triggers Reader to be installed on my system.
    NEVER want reader (that's why i bought Pro).
    How do i keep Reader from EVER being installed?

    I don't get a pop-up. Something triggers the Reader installer to be loaded on my system. This occurs without my knowledge. Then, the next time i go to open a PDF, instead of it opening immediately with Acrobat Pro, I get the first screen of the installation stuff for Reader (Accept/Decline Terms of use, etc.). At this point, i get out of the install, go into control panel and uninstall Reader (which is listed as a loaded program, even though i haven't finished the install). After i uninstall reader and open a PDF, it opens correctly with Acrobat Pro. This happens once or twice a month at least. Is it possible that the Adobe Acrobat Update Service task loads Reader on my system at some interval? How do i block Reader form EVER being installed or loaded?

  • How can I delete apps from the app store? There seems to be every app I have ever downloaded and deleted since I got my phone in 2007. When I go to app store and select update apps there's a menu at the top that says purchased! I would like to delete hist

    How can I delete apps from the app store? There seems to be every app I have ever downloaded and deleted since I got my phone in 2007. When I go to app store and select update apps there's a menu at the top that says purchased and when I select it it shows every app I've ever had! I would like to delete the history please.
    Many thanks

    You cannot.
    The entire point of this is that you can redownload any and all of your past purchases.

  • HT4890 how do i view photos from icloud on my PC, there is no icon for that purpose

    how do i view photos from icloud on my PC, there is no icon for that purpose

    If you have Outlook 2007 or higher on your PC, you can print your iCloud calendar from within Outlook.  If you don't, and are accessing it on icloud.com, about all you can do is take a screenshot using your print screen key and print the image.

  • How do I stop Mavericks from using the Internet, I have a DATA PLAN LIMIT!

    Since installing Mavericks on our 2 iMacs our DATA PLAN is overused. Over 1.5 to 2.5 GB PER DAY! This is unacceptable!
    How do I stop Mavericks from using the Internet, I have a DATA PLAN LIMIT!
    HELP!

    Have you seen this thread…
    https://discussions.apple.com/message/23826437#23826437
    The short story is that the new 'certifcate checking' system could be downloading large amounts of data, you can turn it of as follows…
    clockworkapps wrote:
    Turning off CRL & OCSP checking in the Certificates Preferences in Keychain Access solved the problem.
    You can do as others have done, install Little Snitch & use the Network Monitor to view what is happening, that thread has some good advice. http://www.obdev.at/products/littlesnitch/index.html
    @Topher, Activity Monitor is a bit pants for tracking processes that respawn or just go away (I assume its because it's an on-demand job, have you got a nice article on 'mach services', Linc confused me !? ).
    ocspd seems to do that in my limited testing,
    Little Snitch is the easiest way to monitor & you can get away with the free demo for long enough to test if funds are tight.

  • HOW TO WRITE AND READ FROM A TEXT FILE???

    How can I read from a text file and then display the contents in a JTextArea??????
    Also how can I write the contents of a JTextArea to a text file.
    Extra Question::::::: Is it possible to write records to a text file. If you have not idea what I am talking about then ignore it.
    Manny thanks,
    your help is much appreciated though you don't know it!

    Do 3 things.
    -- Look through the API at the java.io package.
    -- Search previous posts for "read write from text file"
    -- Search java.sun.com for information on the java.io package.
    That should clear just about everything up. If you have more specific problems, feel free to come back and post them.

  • Dev question: how to prevent Adobe Reader from copying pdfs to "Download/Adobe Reader"?

    I am making an app that downloads pdf files from a server and the users can decide to store them in the phone. Those files are kept in the app's private storage.
    The pdf files can be opened from inside the app. The problem is that every time a pdf is opened, adobe reader copies it in "Download/Adobe Reader" (the path may be different depending on the device and the android version). Those pdf files should not be available from outside my app. How can I prevent adobe reader from creating copies in that folder? Do I really have to make my app track them down and delete them? It wouldn't be the safest solution...
    In order to open the files, I se up a content provider:
    from the manifest:
    <provider
        android:name="android.support.v4.content.FileProvider"
        android:authorities="com.example.myapp.fileprovider"
        android:exported="false"
        android:grantUriPermissions="true" >
        <meta-data
            android:name="android.support.FILE_PROVIDER_PATHS"
            android:resource="@xml/filepaths" />
    </provider>
    And then, in a method, I do this:
    File pdfToRead = new File(pdfPath);
    Uri uri = FileProvider.getUriForFile(context, "com.example.myapp.fileprovider", pdfToRead);
    for (ResolveInfo resolveInfo : appsList) {
        String packageName = resolveInfo.activityInfo.packageName;
        context.grantUriPermission(packageName, uri, Intent.FLAG_GRANT_READ_URI_PERMISSION);
    openPDF(context, uri);
    public static final void openPDF(Context context, Uri localUri) {
        Intent i = new Intent(Intent.ACTION_VIEW);
        i.setDataAndType(localUri, PDF_MIME_TYPE);
        context.startActivity(i);
    Thanks for the help.

    Meh, I just hoped there was a way to tell acrobat "don't create a copy of the file because it's private". For now, I'm detecting the "downloads/Adobe Reader" folder, look if there's the file that was opened and delete it.
    Now I need to know something that I can't ask on stackoverflow: what paths does Adobe Reader use to create the "Adobe Reader" folder? Because not every device has an external sd card (external, not removable. Just for clarity). In my device it's at "Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS)+"/Adobe Reader".

  • How to install only Garageband from OS 10.6 install discs?

    Hi. I recently got a new Mac with OS 10.6.2. It came with the iLife Apps installed.For reasons I won't get into ......I had to try to install the older iMovie 08 (which I believe had some sound files connected to Garageband).After attempting that install.....I noticed that garageband had dissappeared.......the icon both in the dock and in applications had dissappeared.
    So I believe I need to reinstall Garageband.........but not sure if its on install disc 1 or 2 and how I install only Garageband and not the other iApps? Thanks for any help.

    Bruce Thompson wrote:
    how I install only Garageband and not the other iApps?
    http://www.bulletsandbones.com/GB/GBFAQ.html#reinstallgb
    (Let the page FULLY load. The link to your answer is at the top of your screen)

  • Sockets: How do I know how much I can read from a socket?

    Hi everyone,
    I've opened a socket connection to a cisco router and want to read some of its databases. These are the main part of my code:
    Socket so = new Socket(routerIP, routerPort);
    BufferedReader br = new BufferedReader(
    new InputStreamReader(so.getInputStream()));
    BufferedWriter bw = new BufferedWriter(
    new OutputStreamWriter(so.getOutputStream()));
    // user/password entered.
    bw.write("show ip alias\r\n");
    bw.flush();
    while ((in = br.readLine()) != null) {
    System.out.println(in);
    so.close();
    The problem occurs in the "while" loop at the end of the code. The last line that the router is sending doesn't have a \r\n at the end and therefore my readLine command waits indefinitly.
    Well, I guess I can change that command with a simple read but still it won't be general. I'm looking for a command like "available" in socketImpl that tells me the number of bytes that I can read from the server beforehand.
    Any solutions?????????????
    Thanks,
    Ali.

    Ok, that much I know from the router. It supports
    telnet. So, basically if a telnet client can tell when
    it has read all the data coming from the router and
    when it has to wait for user to input the data, I have
    to be able to do so too.Hi, telnet does not know that it has read all the data coming from the router or from you; It waits for data from both sources (the router and you), and then retransmits that data to (you or the router respectively.)
    telnet must be sending and receiving data byte by byte
    cause what we type is displayed on the screen if the
    server echos the characters back to the client.
    Any suggestions, anyone knows of a simple telnet
    source?True. In particular, telnet does not care whether there is any carriage return or linefeed characters. It just retransmits whatever it gets from the source to the destination, except that it looks for particular escape sequences from the data source, such as the sequence for shutting out echo when you enter passwords.
    In your case, I am not sure what you want to achieve. I think you are trying to find the end-of-data but the end-of-data is not unambiguously terminated by an end-of-line. Maybe you need to find some other character or even strings for that purpose. You may even need to process the whole data received in order to determine the end of it.
    However, if you just want just that answer from the router and no more, you can send your logout after your query, so that after the router replies your queries, it also closes the connection and your BufferedReader.readLine() will return.

  • Why can i only 'read' from some portable hard drives

    I'm having trouble with some portable hard drives.  I can only read them and not copy to.  Why is this, and can i change this?

    Keller is right - you probably have an NTFS drive - if it is yours, and you don't need to share it with folks with Windows machines, reformat it for HFS+. If you need to share it, and don't have files larger than 2gb, format it for FAT32. If you need to share it and need to move large files (larger than 2gb) then you'll have to figure something out with NTFS 3G or some other fix.

  • How to get only seconds from the time block function?

    Hello, I want to know to get only "seconds" from the time function. I tried to find other time function but I couldn't find anything that provides only second to be written in the text file.

    It may not be the best way but it works...
    Rodéric L
    Certified LabVIEW Architect

  • How to capture only audio from video on iMovie 11?

    Iam working with imovie. I need only  audio from video. Could some body help me please?

    >>> click >>>
    http://help.apple.com/imovie/index.html#mov3b0fa051

  • How to change existing terminals from "view as icon" to view as data type through program

    I got some legacy LabVIEW code from other people. And there are tons of existing terminals displayed as icon. Is there any way to do batch process to change all of them to view as data type?
    Thanks a lot!
    Solved!
    Go to Solution.

    If you have a VI in 2010, you can save it as far back as 8.0.  There is a thread on this forum dedicated to downconvert requests (and on for upconvert, as well).  So post your VI there, and it will probably be converted quickly.
    Scripting has existed in LabVIEW since about version 5.1.  It was created to support scripting LabVIEW code in products such as the DAQ Assistant and Motion Assistant.  The first product to use this technology was the Vision Assistant.  However, the early versions are very primitive with limited or no support for common functions (e.g. Delete).  Usually, support was added when it was needed for a project.  Scripting took a huge leap in quality when LabVIEW 7.0 was released, since it is used behind the scenes to generate the code for Express VIs (which were introduced in 7.0).  Scripting steadily improved in quality and features until it was released to general use in LabVIEW 2009.  We are still working to expose all the development time functionality.
    Take home message is that you can downconvert your VI, but there is no guarantee that the functionality you have in LabVIEW 2010 will exist in 7.1.  While this is true in general, it is especially true of scripting functions.
    This account is no longer active. Contact ShadesOfGray for current posts and information.

  • HT1651 Only reading 1Gb off each slot, when there is 2 per slot.

    I installed (2) 2gb 533mhz DDR2 SDRAM, however its only reading 1 Gg off each stick, I have a late 2007 macbook Core Duo 2.  Any Ideas?

    you have incorrect ram installed.  you mac requires 200-pin PC2-5300 (667MHz) DDR2 SO-DIMM, not 533mhz.

  • How to send only email from workflow

    Hi Guys,
    I want to send an email from a workflow without sending a notification ... how do i do it ?
    Thanks In advance
    Tom.

    Hi,
    Two possible ways - neither of which I would recommend.
    1 - Write a trigger on the WF_NOTIFICATIONS table, so that if the notification for the process that you require is sent, then you populate the mailer status column to 'spoof' the mailer into thinking that it has already sent it. That should suppress the email.
    2 - Modify the flow to include an activity prior to the notification to change the recipient preferences to not receive email, send the notification, then change the preferences back.
    Email is an "all or nothing" solution - either get email from everything, or get it from nothing. How are they planning on dealing with the notification that they are sent? If they are logging into the application to view the notification, then you could consider sending summary notification emails, and force the users to log into the application to view them all, rather than trying to adopt a half-and-half solution where some things come by email and some only come in the application.
    HTH,
    Matt
    WorkflowFAQ.com - the ONLY independent resource for Oracle Workflow development
    Alpha review chapters from my book "Developing With Oracle Workflow" are available via my website http://www.workflowfaq.com
    Have you read the blog at http://thoughts.workflowfaq.com ?
    WorkflowFAQ support forum: http://forum.workflowfaq.com

Maybe you are looking for

  • IPod nano (4th generation) doesn't retain time/clock properly

    I have an iPod nano model MC062LL (Version 1.0.2 PC) and the time/clock is an hour behind. I have set it properly (Settings->Date & Time->Time) but whenever I reset the iPod (which I do occassionally), it reverts back an hour.  BTW, my Time Zone is p

  • Print to PDF 9.0 - Not able in QuarkXpress!

    I recently got a new iMac and also purchased the CS4 Design Premium Suite (including Acrobat 9.0) and QuarkXpress 8. I am having trouble "printing to PDF" in QuarkXpress. I tried printing to PDF in other programs, like Word, Excel, etc., and they all

  • WLC 5508 upgrade

    Hi All, We currently have 4 x WLC 5500 (AIR-CT5508-K9) V01 and V02 So two in  one datacenter and the other two in another datacenter. They are connected via Mobility group to and BOYD open wifi with an Anchor WLC the other 1. All four of them are 7.4

  • Javax.naming.AuthenticationException: No such domain/application:

    I'm trying on JDeveloper 11g tutorial on "Build a Web Application with JDeveloper 11g Using EJB, JPA, and JavaServer Faces. I encounter this problem when try to run the simple java client created by Jdeveloper. javax.naming.AuthenticationException: N

  • Photo album sharing on iMac/ iPad

    My wife and I share the same iMac but with different log-ins.  At the moment my wife has to log in, as me to see the family photo albums.  I am trying to find a way of sharing my photo albums so my she may see them when she uses her log in.  I am thi