Save data and tcp connection

Hi,
I have a connection between a measurement roboter and LabVIEW. I transmit the data above an TCP connection (for example the coordinate plane of the sensor). I have different ports to transmit the data. Is it possible to save the transmitted data and the TCP number of the Port?
Attachments:
datasend.vi ‏20 KB

Hi,
Just use the:
>
Regards, Christian

Similar Messages

  • Dynamic pdf up to 200 images, the size of pdf is larger, cannot save data and images to the form

    Hi all,
    My client would like to dynamic images up to 200 pictures to my forms. It is working fine. However, when I add images up to 35 images. I could not add images to the form any more. Then, I save data on the form. All images and data typed on the form are disappeared. I don't know reason.
    If I only add 10 images - I can save data and images on the form. The size of pdf is 15456 kb.  I was unable to  add more pictures or data on the form.
    Maybe there are problem the size of pdf? How much size can an dynamic pdf  limited?
    Can we save the information and images as much as we want?
    I have spent 2 weeks to work and try to figure out this problem. However it is not successful.
    Please help,
    Cindy

    You should ensure, that your users do not import big images.
    Therefore you can use a script on the change event of an image field which checks the data size and warns the user if the file is too big.
    function formatNumber(number) {
        var num = number + '',
        x = num.split('.'),
        x1 = x[0],
        x2 = x.length > 1 ? '.' + x[1] : '',
        rgx = /(\d+)(\d{3})/;
        while (rgx.test(x1)) {
            x1 = x1.replace(rgx, '$1' + ',' + '$2');
        return x1 + x2 + "KB";
    var sizeLimit = 200, //allow upto 200KB images
      thisSize = Math.round((this.value.oneOfChild.value.length * 3 / 4) / 1024);
    if (sizeLimit > 0) {
      if (thisSize > sizeLimit) {
      xfa.host.messageBox("Note: With " + formatNumber(thisSize) + " the size of the imported image is greater that the recommended maximum of " + formatNumber(sizeLimit) + ".\nLarge images can cause a insufficent performance.\n\nIf possible, use images with the following recommended specs:\nFormat:\t\tPNG or JPG\nColor depth:\t8 Bit (higher is not supported)\nColor space:\tRGB (CMYK is not supported)\nFile Size:\t\t" + formatNumber(sizeLimit), "Recommended image size exceeded", 3, 0);

  • How to send joystick data over TCP connection

    Hi all,
    I am a long time Labview discussion forum user for learning, but this is my first time posting a question, I hope somebody can help me!
    In the attached VI I am trying to send data from a joystick over a TCP connection. I can send data fine using the TCP examples (in fact the majority of my VI is just a copy of the example). However I am to the point where I do not know how to send all the data necessary (3 axis data, 12 buttons, and the POV data) over TCP. Strings, clusters, and arrays were never my strong suite and converting between them is a nightmare for me.
    Basically I am trying to send each axis data (X,Y, and Z), button data (12 buttons), and POV data (the POV data will be calculated to adjust the position of a camera, so the immediate data is not important, I will add functions to add the change in the button movements to write a standing position for two servos [pan and tilt], for which that I will need to send over the TCP connection) over the TCP connection to control various cameras and motors. I don't know if it is posible to send that much data over a TCP connection in one write VI through a string, and also how to separate the string on the other side in order to control the client VI.
    Again, the actual TCP communication I get, and can operate fine, just formatting all the data into a string (or whatever is required) so that I can unpack on the other side is the issue here.
    Another question I have (not impotant to get the program running just might make it easier on me) is can a TCP server (which sends the data to the client) also recieve data back from the client on the same port ( for example sensor data and digital positions [on,off])? Or do I need to set up two TCP communication loops with the first client acting as the server on a different port than the first, which then sends the data to the original server, which also has a client TCP configuration in another loop? I hope this makes sense...
    One final question.....I already have a solution to this but using labview for the entirety of this project would be nice. I use skype to stream 1080p video from a webcam to my computer so I can view live feed. Can labview do this? This would be awesome if so, I am just not sure if the communication protocols in use could support real time (or as close as possible to streaming) for 1080p video.
    Thanks all in advance for your help,
    Physicsnole
    Attachments:
    cameraserver.vi ‏24 KB
    cameraclient.vi ‏18 KB

    Physicsnole wrote:
    In the attached VI I am trying to send data from a joystick over a TCP connection. I can send data fine using the TCP examples (in fact the majority of my VI is just a copy of the example). However I am to the point where I do not know how to send all the data necessary (3 axis data, 12 buttons, and the POV data) over TCP. Strings, clusters, and arrays were never my strong suite and converting between them is a nightmare for me.
    Well, you cast the axis info cluster to a string, but then you cast it back to an array of DBL. Thatr's not compatible. You should probably cast it back to an "axis info" cluster of exactly the same type. Go the the other VI and right-click the cluster wire to create a constant. Now move that diagram cluster constant to the other VI and use it as type.
    Your default ports don't seem to match. You seem to have client and server roles confused. In the sever you create a listener, but then you start sending packets, even though no connection is established. The connection needs to be initiated by the client.
    Your client stops the loop the first time a timeout is encountered. Shouldn't that be more permanent? Also, please retain code clarity and avoid unecessary complexities. For example, replace the "not or" with a plain "or" and change the loop to "stop if true"
    Physicsnole wrote:
    Basically I am trying to send each axis data (X,Y, and Z), button data (12 buttons), and POV data (the POV data will be calculated to adjust the position of a camera, so the immediate data is not important, I will add functions to add the change in the button movements to write a standing position for two servos [pan and tilt], for which that I will need to send over the TCP connection) over the TCP connection to control various cameras and motors. I don't know if it is posible to send that much data over a TCP connection in one write VI through a string, and also how to separate the string on the other side in order to control the client VI.
    You can send as much as you want. The casting to/from string is the same as described above.
    Physicsnole wrote:
    Another question I have (not impotant to get the program running just might make it easier on me) is can a TCP server (which sends the data to the client) also recieve data back from the client on the same port ( for example sensor data and digital positions [on,off])? Or do I need to set up two TCP communication loops with the first client acting as the server on a different port than the first, which then sends the data to the original server, which also has a client TCP configuration in another loop? I hope this makes sense..
    The primary function of a "server" is to wait for a connection and then communicate with the client once a conenction is established. An established TCP/IP connection is fully two-way and both sides can send and receive.
    LabVIEW Champion . Do more with less code and in less time .

  • The packet data and wlan connection runs automatia...

    guys guys guys i'm having a wiered problem with this rubish E72
    well every time i check my log i find that my phone has used packet data connections and wlan connections for small time intervals and small periods while i haven't used the internet for a long time btw i always make sure to exit all app and also make sure to disconnect my email before exiting so packet data signals and wlan signal are not (on)
    so that means that the phone just uses internet by it's own self also notice that the time that the phone used the internet was during my sleep time
    but it's so weired it has used the packet data for 30 seconds and the wlan fo 1.5 mins by it self ..............is this a virus or that ugly firmware is just full of **bleep**
    please check your phones (log) and reply me back
    thank you
    Nokia E72-1 Black
    firmware : 053.001
    of 26 of nov 2010

    well for the  ovi sync i really use that app to sync my contacts and calender and it set to manual sync so i guess it wouldn't go by it self
    as for the wlan data and packet data , last night was ok withou any connection don't know how
    or what happened it seems the problem is solved but i will also make sure tonight of the problem still exist or not
    all i did last night i have installed 2 app (m.gaurd(netqin) and kaspersky antivirus) to scan my mobile and it did but it seems that its slowind down my already slow mobile
    and removed them today because they corrupted the interface of my snaptu application which i use for facebook (the highlight color disappeared but it was still working) so i had to uninstall it and reinstall back again
    Nokia E72-1 Black
    firmware : 053.001
    of 26 of nov 2010

  • Combining UDP and TCP connections

    I am trying to build a simple client -server app, where multiple client sends price quotes to a server and the server does some analysis on these numbers and spits it back out to all the clients every 5 seconds or so. Before I start, I want to make sure I am thinking about it correctly. I was thinking that I could have on each client a UDP connection and a TCP connection, the TCP connection would be used to send the quotes to the server. This way I have a live connection and confirmed packet reception from client to server.
    The UDP would be used for when the server sends back out the quotes to all the clients, since the server is just sending out back certain ones (the best quotes that is) to all the clients. Does that seem like a reasonable design?

    The only reason is because the server should be sending out it's information via datagrams because it wants to send the same message to all the clients. So in my point of view it looks like it would be more efficient to send out one datagram, broadcasted instead of going through each client and sending the same thing, especially when I'm trying to send an update every 5 seconds or so.

  • Keynote storing obsolete format data, and possible connection to crashes

    An “Ah ha!” moment with Keynote leading to a question about how it stores information regarding themes and fonts, and whether this is a bug in Keynote and/or if there is something that end users can do as a work-around. These points came to my attention today when I exported from Keynote to PowerPoint to share a (very inferior ) version of my presentation with a colleague. Note that the Keynote file I exported from has not exhibited any problems related to error messages or crashes.
    (1) Prior to making the export, I changed all slides to Keynote’s standard out-of-the-box “Gradient” theme since I had used Keynote Theme Park animated “Global Cool” theme (www.keynotethemepark.com). However, even though no slide any longer contained the KTP theme, in doing the export Keynote created a media folder of movies that contained the animated KTP theme. So Keynote is apparently storing obsolete file data and not cleaning up its house after the file is changed.
    (2) Prior to making the export, I changed all slides to use only fonts that I knew to be on my colleague’s PC. However, when I looked under the “Contents” tab of the resulting Powerpoint file’s “Properties” info, I discovered that Powerpoint was listing all the fonts that had been in the original Keynote file but that I had long since changed to Arial and Arial Narrow. Checking through the Powerpoint file slide by slide confirmed that the original fonts do not appear. Again, it appears that Keynote is storing obsolete information.
    MY QUESTION: I am wondering if what I discovered today about Keynote’s “elephant memory” is indicating a bug of some sort, and if so, is there a reasonable work-around for end users that will enable us to avoid having files bloated with obsolete data.
    Also, I am wondering if this storing of obsolete file data could be related to the ”missing file” error reports and Keynote crashes that others have noted in this forum and that I addressed in my previous post. The solution I had discovered was a file level work-around, but the question remained as to what had brought it on.
    BTW, this is with Keynote 3.0.0 because I reinstalled Keynote recently thinking that this procedure might resolve the crashing problem described in my previous post to this forum; the reinstall didn’t, but the problem was solved at a file level in the manner described in my previous post. Now that I finally have time tonight to upgrade again to Keynote 3.02, when I run Software Update expecting to see the Keynote 3.02 upgrade listed, it’s not there. Hmmmmm.… I know I can get it from Apple’s download site but since the site lists two downloads (3.0.1v2 and 3.0.2), I thought it’d be better to let software update manage this process. Now I’m not so sure.

    Thanks, dook and Kyn. Not only does that seem to resolve the issues, but deleting unused master slides dramatically drops the size of the exported presentation (e.g. to 20%).
    I wish the Apple Keynote team would provide a way to more intelligently delete unused themes so as to make it easier to email presentations. It seems to me that theere should be a setting available in the export process where one could do this. The only way I could see to do it was one master slide at a time. Please tell me if I am missing something here.
    I also wish we could export just a range of slides, e.g. from # to #, or slides selected in the Navigator/sorter/organizer.

  • Webdynpro application - save data and attachments

    Hello,
    I would like to know what is the best recommended practice / best apps methodology for the following scenario :
    A Custom web form with options to enter data, add attachments  and submit. On submission , the workflow gets triggered, followed by approvals and finally data update into the relevant transaction.
    My query :
      -  >  For saving the form data and attachments , the options which I am aware are :  tables, case management, into the transaction using GOS.
    Any more to add to this list would be really good.
    In such scenario , what are the best possible way to be used ?
    Would be good to hear your thoughts on this.
    Thanks alot
    Saujanya

    Hi
    Thanks for the update.
    Good to know the different ways to do it.
    Not sure if this fits in workflow forum too. as the question is primarily  around the  data handling and storage of attachments and documents.
    Hence I close this thread in this forum, And created the thread in 'Workflow forum ' to get to know the response.
    New Thread : Webforms - data handling and storage
    Please update your thoughts in the new thread. Appreciate your time and effort.
    Thanks alot.
    Best Regards
    Saujanya
    Edited by: Saujanya on Nov 17, 2011 12:20 PM

  • Receive data through TCP connection

    Hi
    I'm receiving a string "Hello" from TCP from a C-program, where I have to display this string in a string indicator in LabVIEW. 
    I have the following block diagram I found among the examples: 
    The point here is that I can only read the last character "o" in the indicator when I change the "bytes to read" value to 4 bytes, but can read the characters "ello" when setting the bytes to read value to 1. How do I read the whole "Hello" string ?. 
    Best regards
    Oesen
    Attachments:
    Simple TCP - Client.vi ‏15 KB

    Since you are sending a string, I would try using "CLRN" mode on TCP Read.  Then you can trigger it to read all the text until the "/r/n" characters in C.
    mode indicates the behavior of the read operation.
    0
    Standard (default)—Waits until all bytes you specify in bytes to read arrive or until timeout ms runs out. Returns the number of bytes read so far. If fewer bytes than the number of bytes you requested arrive, returns the partial number of bytes and reports a timeout error.
    1
    Buffered—Waits until all bytes you specify in bytes to read arrive or until timeout ms runs out. If fewer bytes than the number you requested arrive, returns no bytes and reports a timeout error.
    2
    CRLF—Waits until all bytes you specify in bytes to read arrive or until the function receives a CR (carriage return) followed by a LF (linefeed) within the number of bytes you specify in bytes to read or until timeout ms runs out. The function returns the bytes up to and including the CR and LF if it finds them in the string.
    3
    Immediate—Waits until the function receives any bytes from those you specify in bytes to read. Waits the full timeout only if the function receives no bytes. Returns the number of bytes so far. Reports a timeout error if the function receives no bytes.
    Otherwise, you need to follow the instructions per protocol;
    bytes to readis the number of bytes to read. Use one of the following techniques to handle messages that might vary in size:
    Send messages that are preceded by a fixed size header that describes the message. For example, it might contain a command integer that identifies what kind of message follows and a length integer that identifies how much more data is in the message. Both the server and client receive messages by issuing a read function of eight bytes (assuming each is a four byte integer), converting them into the two integers, and using the length integer to determine the number of bytes to pass to a second read function for the remainder of the message. Once this second read is complete, each side loops back to the read function of the eight byte header. This technique is the most flexible, but it requires two reads to receive each message. In practice, the second read usually completes immediately if the message is written with a single write function.
    Make each message a fixed size. When the content of a message is smaller than the fixed size you specify, pad the message to the fixed size. This technique is marginally more efficient because only a single read is required to receive a message at the expense of sending unnecessary data sometimes.
    Send messages that are strictly ASCII in content, where each message is terminated by a carriage return and linefeed pair of characters. The read function has a mode input that, when passed CRLF, causes it to read until seeing a carriage return and linefeed sequence. This technique becomes more complicated when message data can possibly contain CRLF sequences, but it is quite common among many internet protocols, including POP3, FTP, and HTTP.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    If someone helped you out, please select their post as the solution and/or give them Kudos!

  • Save data and report in subfolder

    Hi,
    I spend one day  trying to solve this "stupid" thing  but now I raise my white flag.
    Hope someone could show me the way.
    In my script I want to organize the output result in such a way to have:
    tdm files in "testdata" folder
    pdf + xls in "testdata"\"document" folder
    I'm able to create the testdata folder, but no idea how to create the subfolder.
    The testdata folder should be a variable because it change test by test.
    I've highlighted the error in my script.
    dim myfold
    myfold = inputbox("Inserire nome della prova", "diadem", DataSetName)
    call foldercreate(DataReadPath & myfold)
    call foldercreate(DataReadPath & myfold\"documents")
    rem 'Save elaborated data
    rem If (FileNameGet ("NAVIGATOR", "FileWrite", DataReadPath & DataSetName & myfold & "." & DataExtension) = "IDOk") Then
    rem Else 'Dialog was canceled
      rem Call MsgBoxDisp ("Data saving was canceled")
    rem End If
    Bye
    Solved!
    Go to Solution.

    Giova
    You were very close to have it work.  Just some syntax issues.
    The lines below will make the documents directory under /testdata/
    dim myfold
    myfold = inputbox("Inserire nome della prova", "diadem", DataSetName)
    callfoldercreate(DataReadPath & myfold)
    callfoldercreate(DataReadPath & myfold&"\documents")
    You mentioned that PDF and Excel were the next files to create. I have done both.
    Here is some helpful PDF making code for report output.
    dim ofso
    Set ofso = CreateObject("Scripting.FileSystemObject")
    'ReportPrintTransparency = 1 ' needed to display transparency colors
    REPORTPrintAsGraphic = 0' needed to display transparency colors
    PDFResolution = "600 DPI"
    PDFOptimization = true
    iffilex(gsPDFFileFullPath) then
    ofso.DeleteFile(gsPDFFileFullPath)
    endif
    CallPicPDFExport(gsPDFFileFullPath)
    Paul

  • How to save data and load data from an arrayList ??

    i got a run time problem .....when i try to save my data to a file and load a data from a file....i got some kind of error like that
    Please enter your CD`s title : ivan
    Please enter your CD`s Artist/GroupName : diw
    Please enter your CD`s year of release : wid
    InputMismatchException error occurred (the next token does not match the Integer regular expression, or is out of range) java.util.InputMismatchException
    Invaild value....Please enter the value between 1000 & 9999
    Please enter your CD`s MusicGenre(e.g.: Jazz, Blues, Funk, Classical, Rock, etc...) : w
    Please enter your CD`s comment : w
    Do you have another Cd ? (Y/N) : n
    Saving to file
    java.io.EOFException
         at java.io.ObjectInputStream$BlockDataInputStream.peekByte(Unknown Source)
         at java.io.ObjectInputStream.readObject0(Unknown Source)
         at java.io.ObjectInputStream.readObject(Unknown Source)
         at Demo.loadDate(Demo.java:49)
         at Demo.readDataFromConsole(Demo.java:103)
         at Demo.main(Demo.java:173)
    Exit code: 0
    import java.util.ArrayList;
    import java.io.*;
    public class Demo{
         readOperation theRo = new readOperation();
         errorCheckingOperation theEco = new errorCheckingOperation();
         ArrayList<MusicCd> MusicCdList;
         public Demo()
         private void heading()
              System.out.println("\tTesting read data from console, save to file, reopen that file\t");
         private void saveDate()
              MusicCdList = new ArrayList<MusicCd>( ); 
              try
                   File f = new File("jessica.txt");
                   FileOutputStream fos = new FileOutputStream(f);
                   ObjectOutputStream oos = new ObjectOutputStream(fos);
                   for( MusicCd s : MusicCdList)
                   oos.writeObject(s);
                   oos.close();
              catch (IOException ioe)
                   ioe.printStackTrace();
         private void loadDate()
              MusicCdList = new ArrayList<MusicCd>( );  
              try
                   File g = new File("jessica.txt");
                   FileInputStream fis = new FileInputStream(g);
                   ObjectInputStream ois = new ObjectInputStream(fis);
                   ArrayList<String> stuff = (ArrayList<String>)ois.readObject();
                   for( String s : stuff ) System.out.println(s);
                   ois.close();
              } catch (Exception ioe)
                   ioe.printStackTrace();
         private void readDataFromConsole()
         //private void insertCd()
           ArrayList<MusicCd> MusicCdList = new ArrayList<MusicCd>( ); 
            readOperation theRo = new readOperation();
            errorCheckingOperation theEco = new errorCheckingOperation();
            MusicCd theCd;
            String muiseCdsTitle;
            String muiseCdsArtistOrGroupName;
            int muiseCdsYearOfRelease;
            int validMuiseCdsYearOfRelease;
            String muiseCdsMusicGenre;
            String muiseCdsAComment;
              while(true)
                    String continueInsertCd = "Y";
                   do
                        muiseCdsTitle = theRo.readString("Please enter your CD`s title : ");
                        muiseCdsArtistOrGroupName = theRo.readString("Please enter your CD`s Artist/GroupName : ");
                        muiseCdsYearOfRelease = theRo.readInt("Please enter your CD`s year of release : ");
                        validMuiseCdsYearOfRelease = theEco.errorCheckingInteger(muiseCdsYearOfRelease, 1000, 9999);
                        muiseCdsMusicGenre = theRo.readString("Please enter your CD`s MusicGenre(e.g.: Jazz, Blues, Funk, Classical, Rock, etc...) : ");
                        muiseCdsAComment  = theRo.readString("Please enter your CD`s comment : ");
                        MusicCdList.add(new MusicCd(muiseCdsTitle, muiseCdsArtistOrGroupName, validMuiseCdsYearOfRelease ,
                        muiseCdsMusicGenre, muiseCdsAComment));
                        MusicCdList.trimToSize();
                        //saveToFile(MusicCdList);
                        continueInsertCd = theRo.readString("Do you have another Cd ? (Y/N) : ");
                   }while(continueInsertCd.equals("Y") || continueInsertCd.equals("y") );
                   if(continueInsertCd.equals("N") || continueInsertCd.equals("n"));
                                        System.out.println("Saving to file ");
                                                    //MusicCdList.add(new MusicCd(muiseCdsTitle, muiseCdsYearOfRelease));     
                                                    saveDate();
                                        loadDate();
                                  break;
         public static void main(String[] args)
              Demo one = new Demo();
              one.readDataFromConsole();
              how should i fix it if i want to reach the save to a file and load from a file purpose??
    thx all
    for much more understand of this program
    import java.io.Serializable;
    public class MusicCd implements Serializable
         private String musicCdsTitle;
         private String artistOrGroupName;
            private int yearOfRelease;
         private String musicGenre;
         private String aComment;
         public MusicCd()
              musicCdsTitle = "";
              artistOrGroupName = "";
              yearOfRelease = 1000;
              musicGenre = "";
              aComment = "";
         public MusicCd(String newMusicCdsTitle, String newArtistOrGroupName, int newYearOfRelease,
         String newMusicGenre, String aNewComment)
              musicCdsTitle = newMusicCdsTitle;
              artistOrGroupName = newArtistOrGroupName;
              yearOfRelease = newYearOfRelease;
              musicGenre = newMusicGenre;
              aComment = aNewComment;
         public String getTitle()
              return musicCdsTitle;
         public String getArtistOrGroupName()
              return artistOrGroupName;
         public int getYearOfRelease()
              return yearOfRelease;
         public String getMusicGenre()
              return musicGenre;
         public String getAComment()
              return aComment;
         public void setTitle(String newMusicCdsTitle)
              musicCdsTitle = newMusicCdsTitle;
         public void setArtistOrGroupName(String newArtistOrGroupName)
              artistOrGroupName = newArtistOrGroupName;
         public void setYearOfRelease(int newYearOfRelease)
              yearOfRelease = newYearOfRelease;
         public void setMusicGenre(String newMusicGenre)
              musicGenre = newMusicGenre;
         public void setAComment(String aNewComment)
               aComment = aNewComment;
         public boolean equalsName(MusicCd otherCd)
              if(otherCd == null)
                   return false;
              else
                   return (musicCdsTitle.equals(otherCd.musicCdsTitle));
         public String toString()
              return("Title: " + musicCdsTitle + "\t"
              + "Artist/GroupName: " + artistOrGroupName + "\t"
              + "Year of release: " + yearOfRelease + "\t"
              + "Music Genre: " + musicGenre + "\t"
              + "Comment: " + aComment + "\t" );
    }import java.util.*;
    public class readOperation{
         public String readString(String userInstruction)
              String aString = null;
              try
         Scanner scan = new Scanner(System.in);
                   System.out.print(userInstruction);
                   aString = scan.nextLine();
              catch (NoSuchElementException e)
                   //if no line was found
                   System.out.println("\nNoSuchElementException error occurred (no line was found) " + e);
              catch (IllegalStateException e)
                   // if this scanner is closed
                   System.out.println("\nIllegalStateException error occurred (scanner is closed)" + e);
              return aString;
         public char readTheFirstChar(String userInstruction)
              char aChar = ' ';
              String strSelection = null;
              try
                   //char charSelection;
         Scanner scan = new Scanner(System.in);
                   System.out.print(userInstruction);
                   strSelection = scan.next();
                   aChar = strSelection.charAt(0);
              catch (NoSuchElementException e)
                   //if no line was found
                   System.out.println("\nNoSuchElementException error occurred (no line was found) " + e);
              catch (IllegalStateException e)
                   // if this scanner is closed
                   System.out.println("\nIllegalStateException error occurred (scanner is closed)" + e);
              return aChar;
         public int readInt(String userInstruction) {
              int aInt = 0;
              try {
                   Scanner scan = new Scanner(System.in);
                   System.out.print(userInstruction);
                   aInt = scan.nextInt();
              } catch (InputMismatchException e) {
                   System.out.println("\nInputMismatchException error occurred (the next token does not match the Integer regular expression, or is out of range) " + e);
              } catch (NoSuchElementException e) {
                   System.out.println("\nNoSuchElementException error occurred (input is exhausted)" + e);
              } catch (IllegalStateException e) {
                   System.out.println("\nIllegalStateException error occurred (scanner is closed)" + e);
              return aInt;
    import java.util.Scanner;
    import java.util.InputMismatchException;
    import java.util.NoSuchElementException;
    public class errorCheckingOperation
         public int errorCheckingInteger(int checkThing, int lowerBound, int upperBound)
               int aInt = checkThing;
               try
                    while((checkThing < lowerBound ) || (checkThing > upperBound) )
                         throw new Exception("Invaild value....Please enter the value between  " +  lowerBound + " & " +  upperBound );
               catch (Exception e)
                 String message = e.getMessage();
                 System.out.println(message);
               return aInt;
           public int errorCheckingSelectionValue(String userInstruction)
                int validSelectionValue = 0;
                try
                     int selectionValue;
                     Scanner scan = new Scanner(System.in);
                     System.out.print(userInstruction);
                     selectionValue = scan.nextInt();
                     validSelectionValue = errorCheckingInteger(selectionValue , 1, 5);
               catch (NoSuchElementException e)
                   //if no line was found
                   System.out.println("\nNoSuchElementException error occurred (no line was found) " + e);
              catch (IllegalStateException e)
                   // if this scanner is closed
                   System.out.println("\nIllegalStateException error occurred (scanner is closed)" + e);
              return validSelectionValue;
    }Message was edited by:
    Ivan1238
    Message was edited by:
    Ivan1238

    You should thoroughly check you code. It's full of problems.
    For example in saveDate():
    You create a new empty ArrayList and then want so save it's contents. I guess, the file size is always 0.
    For example in loadDate():
    Since you read from an empty file you get an EOFException. This is ok and you should catch and treat the exception properly.
    You try to read the ArrayList instead of single MusicCd objects, although in saveDate you saved the single MusicCD objects. You can only read from the file what to saved in it before.
    I suggest to write the size of the ArrayList as first object in the file. Then you know how much you can expect to read when loading from the file.
    private void saveDate()
              try
                   File f = new File("jessica.txt");
                   FileOutputStream fos = new FileOutputStream(f);
                   ObjectOutputStream oos = new ObjectOutputStream(fos);
                            oos.writeObject(new Integer(MusicCdList.size()));
                   for( MusicCd s : MusicCdList)
                   oos.writeObject(s);
                   oos.close();
              catch (IOException ioe)
                   ioe.printStackTrace();
         }

  • In table maintance to save date and time.

    Hi,
    I am trying to write a code in table maintenance for updating date, time and user id.
    I have created a z include and written a below code which i got from help document. Thid code i have implemented in maintenance event 01. When i checked the code system is showing declare total. Where shall i declare this. Is this code is correct.
    FORM abc.
    DATA: F_INDEX LIKE SY-TABIX. "Index to note the lines found
    LOOP AT TOTAL.
    IF <ACTION> = desired constant.
    READ TABLE EXTRACT WITH KEY <vim_xtotal_key>.
    IF SY-SUBRC EQ 0.
    F_INDEX = SY-TABIX.
    ELSE.
    CLEAR F_INDX.
    ENDIF.
    (make desired changes to the line TOTAL)
    MODIFY TOTAL.
    CHECK F_INDX GT 0.
    EXTRACT = TOTAL.
    MODIFY EXTRACT INDEX F_INDX.
    ENDIF.
    ENDLOOP.
    SY-SUBRC = 0.
    ENDFORM.
    Please any one suggest on this.
    Thanks in advance,
    Ravi

    Hi Ravi,
    Can you go to SE80 and check the function group you have provided while creating the table maintainance generator.
    See at the top include what the name SAP has generated for the  internal table .
    I think if you get the name of the internal table name you can do the manipulation.

  • Any Date and Time Connection Problems?

    My clock doesn't setup properly at startup, all the time. Do I just need a new PRAM battery? I believe it happened on my Quicksilver, too ... that's why I ask below about the Server. I did get my Quicksilver off eBay ... so it might need a battery, too.
    Or is Apple's Time Server having periodic problems? or do I have DSL timing issues?
    I am running OS X 10.3.9 on an XPostfacto PowerPC 9500. Shouldn't matter, software wise.
    Mac Plus, Performa 6116, PPC 8500, 9500, QS 2@1GHz   Mac OS X (10.3.9)  

    Mine are PPC 9500 G3/500, PPC 8500 G4/450, QS Dual 1GHz
    I still think there is a problem with Apple Americas ... I got the correct time and date with Apple Europe, and the same bad result from Apple America. My zone is set correctly.
    So, I've gone totally Euro.
    Thanks.
    Mac Plus, Performa 6116, PPC 8500, 9500, QS 2@1GHz Mac OS X (10.3.9)

  • HT4157 I am trying to use my cellular data on iPad and states connection failed. What do I need to do?

    I am trying to use cellular data and states connection failed. What do I need to do to fix this?
    Thanks

    Hi there April3939,
    You may find the troubleshooting steps in the article below helpful.
    iPad (Wi-Fi + Cellular Models): Troubleshooting a cellular data connection
    http://support.apple.com/kb/TS4249
    -Griff W. 

  • Solaris Kernel and TCP/IP Tuning Parameters (Continued)

    This page describes some configuration optimizations for Solaris hosts running ATG Page Serving instances (application servers) that will increase server efficiency.
    Note that these changes are specific to Solaris systems running ATG application servers (+page serving+ instances). Do not use these on a web server or database server. Those systems require entirely different settings.
    h3. Solaris 10 Kernel
    Adjust /etc/system (parameters below) and reboot the system.
    set rlim_fd_cur=4096
    set rlim_fd_max=4096
    set tcp:tcp_conn_hash_size=32768
    set shmsys:shminfo_shmmax=4294967295
    set autoup=900
    set tune_t_fsflushr=1h4. Set limits on file descriptors
    {color:blue}set rlim_fd_max = 4096{color}
    {color:blue}set rlim_fd_cur = 4096{color}
    Raise the file-descriptor limits to a maximum of 4096. Note that this tuning option was not mentioned in the "Sun Performance And Tuning" book.
    [http://download.oracle.com/docs/cd/E19082-01/819-2724/chapter2-32/index.html]
    h4. Increase the connection hash table size
    {color:blue}set tcp:tcp_conn_hash_size=8192{color}
    Increase the connection hash table size to make look-up's more efficient. The connection hash table size can be set only once, at boot time.
    [http://download.oracle.com/docs/cd/E19455-01/816-0607/chapter4-63/index.html]
    h4. Increase maximum shared memory segment size
    {color:blue}set shmsys:shminfo_shmmax=4294967295{color}
    Increase the maximum size of a system V shared memory segment that can be created from roughly 8MB to 4GB.
    This provides an adequate ceiling; it does not imply that shared memory segments of this size will be created.
    [http://download.oracle.com/docs/cd/E19683-01/816-7137/chapter2-74/index.html]
    h4. Increase memory allocated for dirty pages
    {color:blue}set autoup=900{color}
    Increase the amount of memory examined for dirty pages in each invocation and frequency of file system synchronizing operations.
    The value of autoup is also used to control whether a buffer is written out from the free list. Buffers marked with the B_DELWRI flag (which identifies file content pages that have changed) are written out whenever the buffer has been on the list for longer than autoup seconds. Increasing the value of autoup keeps the buffers in memory for a longer time.
    [http://download.oracle.com/docs/cd/E19082-01/819-2724/chapter2-16/index.html]
    h4. Specify the time between fsflush invocations
    Specifies the number of seconds between fsflush invocations.
    {color:blue}set tune_t_fsflushr=1{color}
    [http://download.oracle.com/docs/cd/E19082-01/819-2724/chapter2-105/index.html]
    Again, note that after adjusting any of the preceding kernel parameters you will need to reboot the Solaris server.
    h3. TCP
    ndd -set /dev/tcp tcp_time_wait_interval 60000
    ndd -set /dev/tcp tcp_conn_req_max_q 16384
    ndd -set /dev/tcp tcp_conn_req_max_q0 16384
    ndd -set /dev/tcp tcp_ip_abort_interval 60000
    ndd -set /dev/tcp tcp_keepalive_interval 7200000
    ndd -set /dev/tcp tcp_rexmit_interval_initial 4000
    ndd -set /dev/tcp tcp_rexmit_interval_max 10000
    ndd -set /dev/tcp tcp_rexmit_interval_min 3000
    ndd -set /dev/tcp tcp_smallest_anon_port 32768
    ndd -set /dev/tcp tcp_xmit_hiwat 131072
    ndd -set /dev/tcp tcp_recv_hiwat 131072
    ndd -set /dev/tcp tcp_naglim_def 1h4. Tuning the Time Wait Interval and TCP Connection Hash Table Size
    {color:blue}/usr/sbin/ndd -set /dev/tcp tcp_time_wait_interval 60000{color}
    The tcp_time_wait_interval is how long a connection stays in the TIME_WAIT state after it has been closed (default value 240000 ms or 4 minutes). With the default setting, this socket will remain for 4 minutes after you have closed the FTP connection. This is normal operating behavior. It is done to ensure that any slow packets on the network will arrive before the socket is completely shutdown. As a result, a future program that uses the same socket number won't get confused upon receipt of packets that were intended for the previous program.
    On a busy Web server a large backlog of connections waiting to close could build up and the kernel can become inefficient in locating an available TCP data structure. Therefore it is recommended to change this value to 60000 ms or 1 minute.
    h4. Tuning the maximum number of requests per IP address per port
    {color:blue}ndd -set /dev/tcp tcp_conn_req_max_q 16384{color}
    {color:blue}ndd -set /dev/tcp tcp_conn_req_max_q0 16384{color}
    The {color:blue}tcp_conn_req_max_q{color} and {color:blue}tcp_conn_req_max_q0{color} parameters are associated with the maximum number of requests that can be accepted per IP address per port. tcp_conn_req_max_q is the maximum number of incoming connections that can be accepted on a port. tcp_conn_req_max_q0 is the maximum number of “half-open” TCP connections that can exist for a port. The parameters are separated in order to allow the administrator to have a mechanism to block SYN segment denial of service attacks on Solaris.
    The default values are be too low for a non-trivial web server, messaging server or directory server installation or any server that expects more than 128 concurrent accepts or 4096 concurrent half-opens. Since the ATG application servers are behind a DMZ firewall, we needn't starve these values to ensure against DOS attack.
    h4. Tuning the total retransmission timeout value
    {color:blue}ndd -set /dev/tcp tcp_ip_abort_interval 60000{color}
    {color:blue}tcp_ip_abort_interval{color} specifies the default total retransmission timeout value for a TCP connection. For a given TCP connection, if TCP has been retransmitting for tcp_ip_abort_interval period of time and it has not received any acknowledgment from the other endpoint during this period, TCP closes this connection.
    h4. Tuning the Keep Alive interval value
    {color:blue}ndd -set /dev/tcp tcp_keepalive_interval 7200000{color}
    {color:blue}tcp_keepalive_interval{color} sets a probe interval that is first sent out after a TCP connection is idle on a system-wide basis.
    If SO_KEEPALIVE is enabled for a socket, the first keep-alive probe is sent out after a TCP connection is idle for two hours, the default value of the {color:blue}tcp_keepalive_interval{color} parameter. If the peer does not respond to the probe after eight minutes, the TCP connection is aborted.
    The {color:blue}tcp_rexmit_interval_*{color} values set the initial, minimum, and maximum retransmission timeout (RTO) values for a TCP connections, in milliseconds.
    h4. Tuning the TCP Window Size
    {color:blue}/usr/sbin/ndd -set /dev/tcp tcp_xmit_hiwat 65535{color}
    {color:blue}/usr/sbin/ndd -set /dev/tcp tcp_recv_hiwat 65535{color}
    Setting these two parameters controls the transmit buffer and receive window. We are tuning the kernel to set each window to 65535 bytes. If you set it to 65536 bytes (64K bytes) or more with Solaris 2.6, you trigger the TCP window scale option (RFC1323).
    h4. Tuning TCP Slow Start
    {color:blue}/usr/sinb/ndd -set /dev/tcp tcp_slow_start_initial 4{color}
    tcp_slow_start_initial is the number of packets initially sent until acknowledgment, the congestion window limit.
    h4. Tuning the default bytes to buffer
    {color:blue}ndd -set /dev/tcp tcp_naglim_def 1{color}
    {color:blue}tcp_naglim_def{color} is the default number of bytes to buffer. Each connection has its own copy of this value, which is set to the minimum of the MSS for the connection and the default value. When the application sets the TCP_NODELAY socket option, it changes the connection's copy of this value to 1. The idea behind this algorithm is to reduce the number of small packets transmitted across the wire by introducing a short (100ms) delay for packets smaller than some minimum.
    Changing the value of tcp_naglim_def to 1 will have the same effect (on connections established after the change) as if each application set the TCP_NODELAY option.
    {note}
    The current value of any of the TCP parameters can be displayed with the command ndd get. So to retrieve the current setting of the {color:blue}tcp_naglim_def parameter{color}, simply execute the command:\\
    {color:blue}ndd -get /dev/tcp tcp_naglim_def{color}
    {note}
    h3. References
    Solaris Tunable Parameters Reference Manual
    [http://download.oracle.com/docs/cd/E19455-01/816-0607/index.html]
    WebLogic Server Performance and Tuning
    [http://download.oracle.com/docs/cd/E11035_01/wls100/perform/OSTuning.html]

    For example,
    Socket.setSoTimeout() sets SO_TIMEOUT option and I
    want to what TCP parameter this option corresponds in
    the underlying TCP connection.This doesn't correspond to anything in the connection, it is an attribute of the API.
    The same questions
    arises fro other options from SocketOptions class.setTcpNoDelay() controls the Nagle algorithm. set{Send,Receive}BufferSize() controls the local socket buffers.
    Most of this is quite adequately described in the javadoc actually.

  • Unable to insert date and time when using date datatype

    Hi
    I am hitting a bit of a problem when using the date datatype. When trying to save a row to the table where the field it throws an error ora 01830 and complains about converting the date format picture ends...etc. Now when I do the insert, I use the to_date function with the format of "dd-mon-yyyy hh24:mi:ss". Of course, when I remove the time element, everything is perfect.
    Checking sysdate, I noticed that the time element wasn't be displayed, and I used alter session set nls_date_format to set the date and time I want to save to the table, which worked!
    Then based on advice in a previous thread to permanently fix the problem, I used alter system set nls_date_format ="dd-mon-yyyy hh24:mi:ss" scope=spfile; This showed that it was altered, and I can see the setting in the em. In sqlplus, I shutdown the database, and restarted with startup mount; alter database open; and then selecting sysdate, it still shows the date as dd-mon-yy, and still no time! Checking the em, and looking up the nls_date_format the setting is still shown as "dd-mon-yyyy hh24:mi:ss".
    So, my question is this - what am I doing wrong? Why can't save date and time using date in Oracle 11g?????
    Thanks

    user633278 wrote:
    Hi
    I am hitting a bit of a problem when using the date datatype. When trying to save a row to the table where the field it throws an error ora 01830 and complains about converting the date format picture ends...etc. Now when I do the insert, I use the to_date function with the format of "dd-mon-yyyy hh24:mi:ss". Of course, when I remove the time element, everything is perfect.
    Checking sysdate, I noticed that the time element wasn't be displayed, and I used alter session set nls_date_format to set the date and time I want to save to the table, which worked!
    Then based on advice in a previous thread to permanently fix the problem, I used alter system set nls_date_format ="dd-mon-yyyy hh24:mi:ss" scope=spfile; This showed that it was altered, and I can see the setting in the em. In sqlplus, I shutdown the database, and restarted with startup mount; alter database open; and then selecting sysdate, it still shows the date as dd-mon-yy, and still no time! Checking the em, and looking up the nls_date_format the setting is still shown as "dd-mon-yyyy hh24:mi:ss".
    So, my question is this - what am I doing wrong? Why can't save date and time using date in Oracle 11g?????
    ThanksYou most certainly can save the time. A DATE column, by definition stores date and time. What you describe is a presentation problem, and setting nls_date_format at the system as an init parm is the weakest of all settings as it is overridden by several other locations.
    without seeing the exact sql that produced the error (not just your description of what you think you were doing) it is impossible to say for sure.
    However, I'd suggest you read http://edstevensdba.wordpress.com/2011/04/07/nls_date_format/

Maybe you are looking for

  • IMac5,1 mirroring possible via minidisplay port?

    Hi there, I have an old iMac 5,1 2006 and a macBook pro 5,5. Can I mirror the macbook screen onto the iMac? The  thunderbolt cable I bought for this purpose doesn't fit the minidisplay port on the iMac. Any workarounds? Thanks

  • Post-processing error Template code: ARXCMGJR

    Hi SR 6648071.994 CAP GEMINI ERNST & YOUNG UK PLC ISSUE: Customer is testing for a major upgrade to 11.5.10.2, and receive an error when submitting ARXCMGJR module: On Account Credit Memo Gain and Loss Journal report in post processing of concurrent:

  • Recorded for outbound processing in SXMB_MONI???

    Hi XI friends, in my file to abap proxy, in sxmb_moni i am getting message like "recorded for outbound processing" and Q status is stopped. please help me. thanks and regards ram

  • ALV Group and Sort

    Hi, I am sorting the ALV Display on the basis of Assignment Field. It is getting sorted, but it is displaying the value in all the lines/rows. I want to display it only once(the first row) if the value is same. Also, the first line of the ALV Output

  • Plz help on javamail api (mayagiri)

    Can you tell me that, where can i find the history of javamail api like, who developed it, what is the motivation behind it? why the technology was developed. I am student , now persuing masters in IT. if possible plz mail me at [email protected]