Telnet Buffer Questions

Hi,
Modems are configured to telemeter data to a LabView VI.  The LabView VI works as designed when hardwired to the instruments.  Now a modem and internet connection replace the hardwire, so a reconfiguration of the VI was required using Telnet Read/Writes instead of VISA Read/Writes.  Initially there were some kinks associated with the modem configurations, but those have been worked out.  Reason for backstory: I believe I have isolated my issue to how I use/configure Telnet Read.
My issue: data dropouts and incomplete data packets.  I receive 25 bytes of binary data per second, easiestly viewed as Hex when it streams in.  A valid packet looks like this:
0119 81CC 4C47 884B 5722 7ECA 000A FA37 7E52 FC66 7CF7 25D0 04
where 01 begins the sequence, and 04 ends the sequence.  All the mess inbetween is useful to me, but completely uninteresting to most sane people.  Attached are two examples of code.  The first, TelnetEx.vi, is a simple version of how I use the Telnet Read.  When I use this configuration I think I am buffering 25 bytes of data then ending the line whenever a hex04 is observed.  All too frequently I receive packets that are not 25 bytes long, but end in hex04.  By the way, I haven't been successful using 'normal' or'immediate' mode with the Telnet Read - I get no data packets delivered at all.  (??)
So I thought if I could hardwire a way to spot-check the 25-byte buffered data packet then I would outsmart the incomplete packets (an incomplete packet results in false spikes in my data as the VI is wired to look for data in a particular byte location in the data packet). An example of this shoddy attempt is shown in TelnetEx.vi.  When I apply this filter, I receive no data.  The filter is supposed to look for hex01, then look for hex04, then count to see if they are 25 bytes apart, and if they are, send that data to the rest of the VI because it is a valid packet.
One last note: I have been tinkering with the VI and found that if I use the time-delay at a faster sampling rate (10Hz) than my instrument (instrument = 1Hz) then I have fewer incomplete packets delivered, and sometimes there is a pause that looks like a data dropout and then I receive multiple packets at once.  This is probably a connection/packet delivery issue, but perhaps someone has seen this before and knows a good way to handle it?
Is the Telnet Read buffer a FIFO?  Is there a more sophisticated method of checking the validitiy of a data packet than my mangled attempt?
Thanks,
~Tristan
Solved!
Go to Solution.
Attachments:
TelnetEx.vi ‏17 KB
TelnetEx2.vi ‏24 KB

Take a look at the revised example. Also, are you guaranteed that the 0x04 will never be part of the data itself and it will only appear as the termination character? My example assumes that it will only appear as a termination character and never be part of the valid data. Have you sniffed the data using a LAN analyzer (think Wireshark) to verify what is actually being sent by the device?
Under the hood at the socket layer data does get buffered. In fact, depending on the implementation of the stackon the device sending the data you could receive multiple packets of your data in a single TCP packet. It is legal and valid for the stack to buffer data before sending it. This generally occurs more often when you are sending lots of small packets very quickly. In your case I doubt this is happening.
Message Edited by Mark Yedinak on 10-22-2009 05:24 PM
Mark Yedinak
"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Attachments:
TelnetEx-1.vi ‏21 KB

Similar Messages

  • Redo log buffer question

    hi masters,
    this seems to be very basic, but i would like to know internal of this process.
    we all know that LGWR writes redo entries to online redo log files on disk. on commit SCN is generated and tagged to transaction. and LGWR writes this to online redo log files.
    but my question is, how these redo entries comes to redo log buffer??? look all required data is fetched into buffer cache by server process. it is modified there, and committed. DBWR writes this to datafiles, but at what point, which process writes this committed transaction (i think redo entry) into log buffer cache????
    does LGWR do this?? what internally happens exactly???
    if you can plz focus some light on internals, i will be thankfull....
    thanks and regards
    VD

    Hi Vikrant,
    DBWR writes this to datafiles, but at what point, which process writes this committed transaction (i think redo entry) into log buffer cache????Remember that, Before DBWR Acts on flushing the dirty Blocks to Data files, Before this server process, makes sure that LGWR finishes the writing Redo Log Buffer to Online Redo Log files. Since as per ORACLE Architecture poting of Recovering data till point of time @ Crash is important and this is achieved by Online Redo Logs files.
    Rest how the data is Updated in to the Redo Log Buffer Aman had stated the clear steps.
    - Pavan Kumar N

  • As of this morning, I am being redirected to uk.gomeo when i click on google search results in Safari. Do I have a virus?

    Hi,
    First time poster and very non-techy person here. I am being redirected to urls starting "uk.gomeo..." when clicking on Google search results in Safari. Quick search on this seems to suggest I have a virus. Not sure what to do or how to get rid of it. Not sure what could have caused it either. Downloaded Acrobat update couple of days ago which took hours, and Twitter account was hacked about a week ago. All software updates up to date. Any advice much appreciated.
    Thanks.

    Sorry editing that way doesn't work anymore in Lion. But you can look and see if there are any google entries in it. If there are not any google entries you can ignore my posts. If there are try this:
    Open terminal
    sudo nano /etc/hosts
    When prompted for the sudo password - The correct password is your own (the password of the user logged into OS X, also the password you provide when doing system updates and so on).
    now you can delete the line(s) that contain google and save.
    Using your arrow keys go to the line containing google. Delete the line. Do the same for all lines containig google.
    if you have a problem deleting, do a control-x to exit, and reply n to the modified buffer question. To save your changes do a  control-o and hit enter , then do a control-x to quit.
    Note: normally you never edit the hosts file, but if you see google entries in it then a malware programs has added them. It has been happening with a bogus flash update, that installs flash and asks for your system password. SOmething that seem quite normal when installing software. This bogus flash update makes the hosts modifications adding their own IP adrress for google.

  • Where can I find the generic usb-midi driver?

    Hello All,
    I'm having trouble with logic recording any midi signal as having latency. This is not the usual buffer question as I'm not concerned about a laggy audio playback when I depress a midi key - I'm more concerned about having logic record what midi I play exactly when I play it.
    In an effort to solve the issue, I thought I'd try to re-install the generic usb-midi drivers that come with osx, but I can't find them - can anyone point me in the right direction? Are there "better" drivers?
    If you're interested in the original problem or think you might have a solution, the original thread is here:
    http://discussions.apple.com/thread.jspa?threadID=2399493&tstart=0
    Thanks,
    mario

    five fathom wrote:
    How can this be normal? If logic can't track a midi performance accurately then that's a huge flaw... What are other artists doing to work around this? Mousing everything is not an attractive option.
    MIDI is an old protocol, and not a very fast one.
    Different audio devices and different audio device drivers take different amounts of time to process audio and bring it to the outputs, or to process audio that comes IN through the inputs and is recorded, resulting in different latency for different interfaces.
    This is normal, and completely expected - once you've read up on the basics of computer-aided recording, which is why people are telling you to read up on "latency" in the Logic manual.
    This is why Logic has come with latency adjustment for playback/recording and MIDI output (positive or negative) for years and years - another reason why people are telling you to read up on "latency" in the Logic manual.

  • Incomming Faxes -- Is There a Way to React to Different Ringtone?

    I have only used my fax setup to send faxes because I didn't have a second line and didn't want to get into messing with our home phone and voicemail.
    But ... as part of our phone package we have a second number on the same line that rings with a different pattern -- two short instead of the normal ring.
    Is there a way to tell the computer to answer as a fax machine if the broken ring calls but leave normal calls alone?
    Or any other simple solution so we can receive inbound faxes?
    Thanks

    Yes there is, but you have to get your hands dirty in Terminal.app to do it. It's really easy though. In Tiger, log into an administratively privileged user account. Launch Terminal.app (in the /Applications/Utilities folder). First off, make a backup of the original file that you are going to edit. Type:
    sudo cp -pv /usr/bin/fax /usr/bin/fax.original 
    and press the return key. Enter your admin password. It will not be echoed back to you as you type it. Hit return key when finished.
    Next, launch the "pico" text editor. Pico is a simple command-line text editor, very similar to the old DOS Edit program if you're old enough to remember that. So type:
    sudo pico /usr/bin/fax 
    You are looking for a line that reads,
    INIT="-iZ -i&FE0&D2S7=120" 
    at least that's how it reads in the Leopard version. I think the Tiger version had an extra parameter on that line, so that it read,
    INIT="-iZ -i&FE0&D2S7=120 -i&C0" 
    At any rate, the line you are looking for is going to be very close to one of these two lines. You use the arrow keys to manuever around in the file, and you can also use control-v to page down and control-y to page up, as is shown in the bottom of the pico window.
    You need to edit that line to read as,
    INIT="-iZ -i&FE0&D2S7=120 -i&C0-SDR=2" 
    That "-SDR=2" sets the distinctive ring pattern for the fax to only answer on the second ring pattern, not the first.
    Now do a control-x (^X) to exit the pico application, answer the "save modified buffer" question with "y" (for yes), and depress the return key to save (overwrite) the original filename. You may have to reboot to make the change to become effective. I don't know for sure, I always did just for grins and chuckles.
    It is not likely that there ever will be any more Tiger updates to 10.4.12 and beyond, but if there were, my experience had been that said updates blew away the modified /usr/bin/fax. So you may want to keep a backup lying around. If you do, then type:
    sudo cp -pv /usr/bin/fax /usr/bin/fax.distinctiveRing 
    If you type:
    ls -l /usr/bin/fax* 
    you will see all three of these files in the /usr/bin directory.
    You're finally finished, so ⌘q Terminal, and, like I said, reboot your computer just to be sure the modifications take hold.
    I have been successfully running this setup for years, first with Tiger and then with Leopard, on my 2001 Quicksilver G4 computer. I set up fax preferences to answer after the second ring (gave me adequate time for me to recognize an incoming call as ringing in on the fax number so I wouldn't rush to the phone to answer it), and it coexists nicely with my PhoneValet 5.4.2 (voice mail and call logging) that rolls to voice mail after (user-configurable in PhoneValet) seven rings on the primary number.
    I should caveat all of this by saying that I am assuming that your computer has a built-in modem and not something dangling off the back of your computer via USB cable or something. Long ago, a person posted that they were having issues with doing the above stuff that I have described with what I recall to be an external modem and Tiger OS. He was able to work around it by making several edits to that same /usr/bin/fax file but they were way different than the edits that I describe above, and he had to play around with finding the correct numeric values for some of the parameters that he was editing. But he did get it to work.

  • Simple question about telnet and characters

    Hi all,
    We've installed for the first time a SUN machine. So i think it's for a SUN expert a very simple question.
    Normally when i type a special character it will be dispayed like " � " [alt+132]
    But when i use a telnet session and i type "alt+132" i get a "d" and not "�".
    Does someone know where i must start to find out how this works ?
    Thanks you very much.
    ESP

    This is probably related to the locale your server is in. I don't remember the default locale a box is installed in if you don't specify. I think its "C". I use the UTF-8 or en_US.ISO8859-1 locales at home. At work, usually C but sometimes applications may require UTF-8. BEA Weblogic required this for a project a while back. This is defined in /etc/init/tz.

  • Question about reading a very big file into a buffer.

    Hi, everyone!
    I want to randomly load several characters from
    GB2312 charset to form a string.
    I have two questions:
    1. Where can I find the charset table file? I have used
    google for hours to search but failed to find GB2312 charset
    file out.
    2. I think the charset table file is very big and I doubted
    whether I can loaded it into a String or StringBuffer? Anyone
    have some solutions? How to load a very big file and randomly
    select several characters from it?
    Have I made myself understood?
    Thanks in advance,
    George

    The following can give the correspondence between GB2312 encoded byte arrays and characters (in hexadecimal integer expression).
    import java.nio.charset.*;
    import java.io.*;
    public class GBs{
    static String convert() throws java.io.UnsupportedEncodingException{
    StringBuffer buffer = new StringBuffer();
    String l_separator = System.getProperty("line.separator");
    Charset chset = Charset.forName("EUC_CN");// GB2312 is an alias of this encoding
    CharsetEncoder encoder = chset.newEncoder();
    int[] indices = new int[Character.MAX_VALUE+1];
    for(int j=0;j<indices.length;j++){
           indices[j]=0;
    for(int j=0;j<=Character.MAX_VALUE;j++){
        if(encoder.canEncode((char)j)) indices[j]=1;
    byte[] encoded;
    String data;
    for(int j=0;j<indices.length;j++) {
         if(indices[j]==1) {
                encoded =(Character.toString((char)j)).getBytes("EUC_CN");
                          for(int q=0;q<encoded.length;q++){
                          buffer.append(Byte.toString(encoded[q]));
                          buffer.append(" ");
                buffer.append(": 0x");buffer.append(Integer.toHexString(j));
                buffer.append(l_separator);
        return buffer.toString();
    //the following is for testing
    /*public static void main(String[] args) throws java.lang.Exception{
       String str = GBs.convert();
       System.out.println(str);*/

  • Question about Telnet (jakarta commons or general)

    Sorry if I ask some basic questions but I am still learning.
    With Telnet (or a Socket), you basically will open the Telnet - IP address and the port. One question, why is 23 used a lot? Anyhow, after opening it I would have to read the inputstream for "Login" then send it the login name, then read the inputstream for "Password" then send it the password?
    Also I tried to use the Runtime.exec() to just execute telnet and sent an array of commands which included "telnet" "login" and "password" but I assume that was incorrect way of doing it, huh?

    With Telnet (or a Socket), you basically will open
    the Telnet - IP address and the port.The IP address is the IP of the host you wish to connect to . The port is a port where that host has a telnet server listening.
    One question,
    why is 23 used a lot?It was chosen as the default port for the telnet service by whatever standards body or other group selected these things.
    When you enter a URL in your browser, you can explicitly specify a port. You normally don't because port 80 is the default, so that's what most web servers listen on.
    Anyhow, after opening it I
    would have to read the inputstream for "Login" then
    send it the login name, then read the inputstream for
    "Password" then send it the password? It wouldn't be two different input streams. You would just read from an input stream and write to an output stream.
    Also I tried to use the Runtime.exec() to just
    execute telnet and sent an array of commands which
    included "telnet" "login" and "password" but I assume
    that was incorrect way of doing it, huh?I don't know what the problem is, as I haven't seen your code and am not intimately familiar with the details of the telnet protocol. Google for telnet protocol spec or something like that and you shoud find all the gory details.
    I haven't used the Net module from jakarta, but I expect it would hide a lot of that low-level detail from you.

  • Buffer Underrun Protection - Simple Question

    Hello. I've searched this forum (and Roxio's) for about an hour, and I can't find a simple answer to this question.
    I know that to create a stable DVD for replication, I should have Lossless Linking turned OFF. Yet, if I burn using Toast (which many on this forum recommend), should the "Buffer Underrun Protection" be turned on or off?
    The wording in the manual is very ambiguous. Can anyone that knows please spread the wealth?
    Thanks
    PowerPC G5   Mac OS X (10.4.8)  

    Buffer underrun protection should be on normally to prevent bad burns, have not heard of it being an issue, maybe someone else here has more info,
    Make sure you also speak to the replicator on how they want the DVD prepared.

  • Ask a question about using of buffer

    I have read an element  for a  queue buffer, for   there are 10  element  in the queue,How can I get any element  in the queue.
    Attachments:
    Untitled 1.vi ‏14 KB

    There is a flush Queue function that will return all of the elements as an array. Then you can index this array. You can also take this array and put it back into the queue if you need to keep them. Queues aren't really made to pull items out of the middle.

  • KEEP and RECYCLE buffer pools question...

    About the DB buffer cache's two optional buffer pools: KEEP and RECYCLE pools.
    If i want a table to be kept in KEEP buffer pool, can i specify that in CREATE TABLE or ALTER TABLE syntax? Or is it possible only at tablespace level?

    HI,
    You can keep tables at keep pool by specifying storage (buffer_pool keep) parameter.

  • Question: Ideal I/O Buffer

    Hello everyone. I was wondering what would be an ideal buffer size for 3 vocalists, Backing tracks and 1 Software Instrument? I don't want to overload my CPU but I want to make sure onscreen controls run smoothly.
    Thanks guys. This forum is always helpful.
    Message was edited by: Gambit85

    I found this on the safety buffer, the precise nature of which, I was never sure (thanks to logic users group);
    What is the I/O Safety Buffer?
    By Orren Merton (excerpted from _Logic Pro 8 Power_ by Orren Merton and Kevin Anker. ©2009 Course Technology PTR, all rights reserved)
    The I/O Safety Buffer, when engaged, will add an extra I/O buffer after the regular I/O buffer. This will, in effect, double the latency of the I/O buffer size you have set. So if you have your I/O buffer size set to 64 samples, for example, engaging the I/O Safety Buffer will basically increase the latency to the same amount as if you had set the I/O buffer size to 128 samples.
    Enabling the I/O Safety Buffer will also reserve an entire CPU or CPU core on Macs with more than a single processor, just for recording. This means that if you have two core machine, such as a MacBook, MacBook Pro, iMac, Dual G5, and so on, engaging the I/O Safety Buffer will reserve nearly half of your available processing power to ensure a smooth recording. If you have a Mac Pro with four or eight cores, it will reserve either 25 percent or 12.5 percent of your available processing power.
    As you can see, this makes the I/O Safety Buffer quite a mixed blessing. Unless you have a Mac Pro, the I/O Safety Buffer will reserve so much processing power as to make it nearly useless. Even if you do have a Mac Pro, you will get better performance by simply setting the I/O buffer size higher and keeping the I/O Safety Buffer off. However, if you do have a Mac Pro, you need to record at the lowest latency you can but you are getting crackles and pops in the recorded audio, and your Logic project currently takes up very little processing power, the I/O Safety Buffer may be perfect.

  • Question abou daq board buffer

    Hi, everyone:
    I am using Labview 7.1 and the daq board is NI6023E.  My program computes AI analog inputs (4 channels), I used a For loop to gather a certain number of anlog input data, and do the calculation with each input data, and put the calculated data to an array, and then find the minimum value among the array elements. So whenever I push a control button on the front panel, the program is supposed to give me a minimum value. When I run the program the first time it will work, then if the program is running and I push the button a few times, I found the first few elements in the array is not real, it seems they came from the data result when I pushed the button previously. I am not sure if this has to do with daq board buffer. Please help.
    I used a stacked sequencial structure (3 frames) for AI config, AI scan, AI clear in each frame. For the for loop I set a delay time 20ms, I found if I increase the delay time, the number of unrealistic data will decrease. For example, if I set 20ms, then I got 15 unrealistic data, if I set 100ms, I only got 3 bad data. But then I cannot set the delay too long because N number of the for loop is  hundreds!
    Thanks,
    bj

    I am not sure if this has to do with daq board buffer
    Yes, Probably it has nothing to do with your buffer
    Attach your VI / pic of your block diagram so that we can have a look and suggest better

  • Question of telnet or SSH to 4500X management port

    I configured 4500X management port (Fa1) and I can ping the IP from the network. But when I tried telnet to the port, the switch showed "password required but not set".
    I didn't configure any password for VTY. Should it be equivalent to "no login"? If to set or change a password for the management port, where to configure it?
    Thanks a lot

    Hi,
    Yes, "password" and "login" for the management port should be configured under the "vty" lines.
    Best regards,
    Antonin

  • Question about buffer, getData()?

    Hello,
    Could anyone advise, I wrote a program to loop through the frames of a color .avi video. As I understand its possible to access the buffers pixels using getData();
    positioner.seek(i);
    buffer = grabber.grabFrame();
    But I wondered if the the getData would return the pixels in a RGB format, or if the format could other color types?
    Thanks

    You'll want to look through that sample code and pay special attention to where they specify the supported Formats of the data.
    http://java.sun.com/products/java-media/jmf/2.1.1/apidocs/javax/media/Format.html
    Given a byte array and a RGBFormat object, do you think you could figure out how to extract the individual pixels?

Maybe you are looking for

  • Adding Data file to existing primary file group with 1 data file

    Currently our databases are configured to only have 1 data file and 1 log file.  I am looking at adding a 2nd data file to the primary group, which will be on a separate lun. Will we benefit from adding the 2nd data file (same size as 1st data file a

  • Dynamic image in table  in adobe PDF form

    Hi experts                 I have been using a table in interactive form . In table I have a image field in which I want to insert employee pic which is comming in table as a URL . I have craeted a image field and attached tha table field to it but i

  • How to retrieve database connection port? Oracle XE 11g beta

    Hi, I installed Oracle XE 11g beta two weeks ago. I can use Application Express in the local host and from other networks. I have been trying to connect to the database with SQL Developer from another PC in the same network, but I just can't. User an

  • Cash back Card what are your thoughts.

    I wanted to get some feedback of what my next reward card should be.  I was interested in either a chase freedom or a Discover.   I also did some research on the amex blue preferred.  I dont like the option of salle mae. I just wanted 1 last good rew

  • I need a lesson on how to use my 'favorites' bar on IPad  w/iOS 7.

    I have turned on the 'show favorites bar' in settings. When I open Safari I see the 'favorites' bar ....but....when I tap on one it does not go to the site. Instead it shows a tab with a name in it and if I tap on that name nothing happens. How do I