Applicatio​n locking up at Call by Reference

We are seeing our application lock up occasionally at a VI Server Call By Reference node. The VI acts like it is waiting for subVI called to execute, but the subVI acts like it never got the message to execute. We've seen this at a number of VIs that call subVIs by reference. In some cases we are using strickly typed VI references, and in other cases we are not. We've seen the code lock up in both. Has anyone else seen this type of behavior?
We are running LabVIEW 7.0, Windows XP, and TestStand 3.0.
Also, I noticed that in a couple of places, the reference isn't explicitly closed. Since these VIs are only a small part of the application, not called very often, would that cause much of a problem (memory or otherwise)?

SAS,
The problems described by TPoint in the thread "TestStand hang, Execution with Event-Callback-VI " sound familiar.  Our code locks up at the "Run VI" Method (I've enclosed a screen capture of the VI where it locks up), and once it does, you can't open any VIs from Explorer.  You can still open VIs from within LabVIEW.  My main problem, though, is trying to get it to happen in a small application, and getting it to repeat more frequently.  Right now, we can go through 200 test runs before it happens.  Not enough to stop production, but enough to cut into our yields.  Unfortunately, it also makes it very hard to diagnose.  On our development system, it takes about 4 days to get through 200 runs.  So what I'm getting at is, if you can post an example of where you saw the problem, may that would help me put together an example of my problem.
We don't use Events, we use polling.  We are also using LabVIEW 7.0, and I see that TPoint was using LV 7.1, so I couldn't open that example.  If there are other screen shots that you think would be helpful, let me know.  The Operator Interface is huge (its inherited code, I wish I had the time to rewrite it), so I can't post the whole thing, but if there are specific routines (such as the polling routine) that you'd like to see, I could post that.
Thanks,
Tom
Attachments:
Call_Driver_Mode_Block_Diagram.jpg ‏72 KB

Similar Messages

  • Application locking up at Call by Reference

    We are seeing our application lock up occasionally at a VI Server Call By Reference node. The VI acts like it is waiting for subVI called to execute, but the subVI acts like it never got the message to execute. We've seen this at a number of VIs that call subVIs by reference. In some cases we are using strickly typed VI references, and in other cases we are not. We've seen the code lock up in both. Has anyone else seen this type of behavior?
    We are running LabVIEW 7.0, Windows XP, and TestStand 3.0.
    Also, I noticed that in a couple of places, the reference isn't explicitly closed. Since these VIs are only a small part of the application, not called very often, would that cause much of a problem (memory or otherwise)?

    It sounds like your reference is pointing to something else than you
    think it is pointing to.  Generally speaking, not closing
    references is not good.  Whether it will lead to problems is most
    likely a matter of probability.  Could it be that the reference is
    actually being closed before you issue the correct command?
    Fix the code first (make sure that references are closed when they're
    no longer used and make sure references aren't closed when they are
    still in use).
    References are great for uncovering tiny errors in code.  Hunt
    them down and show no mercy!  Or just debug, that'll work too.
    Seriously, I recommend you trace where the references are coming from and make sure they're being closed at the right time.
    Important is also the difference between (what I understand as)
    "static" references (right-clicking a control and selecting -create
    reference) and those created dynamically (such as in lauching a VI via
    VI server).  All Dynamic references should be closed when finished.
    If you could post a picture of the block diagram (Jpg is good, BMP is bad) maybe someone can offer some more precise help.
    Hope this helps
    Shane.
    Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)

  • Check VI type for call by reference node

    Hi Ppl,
    I'm calling a set of VI's dynamically using call by reference node. And I have a type specifier linked to a particular type connector pane. But at times when the VI prototypes do not math I get error from the open VI reference node. Is there any way to check if the VI connector panes matches before opening the refrence with the VI type specifier ?, or using the error code is the only way to check if there were miss match in VI connector pane.
    Thanks 
    Solved!
    Go to Solution.

    But what is wrong with Error checking?
    For example, I using code like this in my application for detect which type of dynamic VI should be used (decision based on Error output):
    Andrey.

  • When my iPhone 4S (with ios7) experiences a failed call while connected to my Bluetooth hands free in my car(screen locked) the failed call appears on the locked screen, as it should, then when I unlock the phone it automatically redials the failed call,

    When my iPhone 4S (with ios7) experiences a failed call while connected to my Bluetooth hands free in my car(screen locked) the failed call appears on the locked screen, as it should, the problem arises whenever I unlock the phone, it automatically redials the last failed call, it doesn't do this with missed calls that are on the locked screen, if any. It is really annoying as sometimes the phone doesn't respond to attempts to end the call before it connects to the number. I then have to explain that it was my phone and not me, I look like an idiot, which I don't really need any extra help with!! Does anyone have any ideas? I don't want to stop missed call from showing in the locked screen but it might be associated with the failed calls and therefore be the only resolution

    I have had the same issue which was driving me mad but think I have just found a way around it. In iOS 7 if you swipe up on the lock screen to access quick settings and go into timer then click the home button you get into the phone without calling the person back. Not a great 'fix' but hope it works for you. Come on Apple this isn't good enough, fix this bug otherwise you will lose your customers.

  • Is there any way to show vi's called by reference in the hierarchy window

    I've inherited some code and in order to save memory and system resources at run time it calls several vi's by reference rather than including them as sub vi's.
    Howver I would like to use the hierarchy window to get a more general overview of how the system works but the vi's called by reference don't show up here. Is there any easy way of finding out how all the parts interconnect?

    VIs called by reference should appear in the hierarchy window but not under the caller icon. They appear at the top line of VIs.
    If you are sure that a VI is in memory and it does not appear in the Hierarchy window, this VI has been marked as "System VI". Such a VI won't appear on the Hierarchy window or on the application property "VIs in memory".
    LabVIEW, C'est LabVIEW

  • LabVIEW RT, Timed loop, finished late, Call by reference

    I have a timed loop triggered by the sample clock of a DAQ-Card. The sample Clock is 8 kHz and the loop will run with dt = 4. Normally the loop is running without finished late[i-1]. But from time to time it happens that the loop is running extremly longer which means instead of 0.5 millisec it needs 4 - 5 millisec. It seems this doesn't never occur while accessing DAQmx.
    The application uses plugin technologies and some of the VIs in the timed loop are preloaded and called by Call by Reference.
    Does those VIs inherit the priority, execution system and CPU of the timed loop?
    The application is running on LV RT 2009 on a Dual core PXI-Controller. The timed loop is bound to CPU 1. There is no  difference runinng the application from the development environment or as a startup application.
    For the measuring test  I modified the application in a way that I don't have:
    disk access for storing the result file
    TCP/IP communication
    Controls on the front panel of the top level VI
    Waldemar
    Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
    Don't forget to give Kudos to good answers and/or questions

    To keep you informed:
    I stripped the application and have left only the measurement storing module and the timed loop. The loop was using the microsecond timer running each 500 µsec. Additional all Non-Real-Time modules were loaded and only one module creates a XML string and sends it to the communication layer which will drop it because no TCP/IP port is open. The creation of the XML string is done each 300 ms.
    In this case I don't have any finished late iterations
    Next I added the DAQ Module. Now I get finished late again but with a lesser frequency as original.
    I removed all unnesseccary tasks from the DAQ moulde leaving one task for a PXI-4204 for using as the clock source for the timed loop. No I get finished late seldom.
     I removed the module which will send the XML string and I don't get finished late.
    Next I was adding code to see memory allocation. I can when memory allocation is changing but it is not related to the finished late iterations.
    Next time I have the chance to do more tests I will see which DAQ task triggers the finished late iterations. I have one AI task on a PXI-4204,  4 Counter tasks on a PXI-6602, 1 DI task on a PXI-6514, 1 DO task on a PXI-6514, 1 DI task on a PXI-6259, 1 DO task on a PXI-6259, 1 AO task on a PXI-6259 and 1 AO task on a PXI-6711.
    The AI task on the PXI-4204 is running in Continous Sampling (Single Point HW Timed is not supported), all other tasks exept the DI and DO are Single Point HW Timed.
    Waldemar
    Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
    Don't forget to give Kudos to good answers and/or questions

  • Java programming language uses call by reference for objects?

    Is Java programming language uses call by reference for objects?

    Yes. You make calls to an object via itsreference.
    No.Yes, you're referring to passing a reference into a
    method in which case the value of the
    reference is passed.I believe the OP is using the term "call by reference" to mean "pass by reference." The two are interchangable, AFAIK. So, while "making calls to an object via its reference" is correct, I don't believe it's germane to the question.

  • Threading and Re-Use of buffers Using Call By Reference node (Duct Tape required)

    I have been trying to get the following information into the public domain for years and now that I have the answers, I will share with those that may be interested.
    Warning!
    Wrap your head in duct tape before reading just for safety sakes.
    My two questions have been;
    1) can LV Re-use the buffers of the calling VI when using VI Serve Call by reference?
    2) Is the UI thread used when using Call by reference?
    1. When calling a VI using the call by reference node, does the data going into the connector pane of the node get copied, or is it in-line as it would be with a properly set up subVI?
    Short answer: It is somewhere in-between.
    Long answer:
    The compiler doesn't know what VI will be called, but it does have a hint:
    the reference wired into the Call By Reference node. It uses that to get the "Prototype" for the call. So for the best performance, use a prototype that has the same "in-placeness characteristics" as the called VI. That being said, users don't know what the "in-placeness characteristics" are.
    Before I go into the details, I should say that the overhead of these copies shouldn't matter much unless it is a large data structure (an array with a lot of elements, or a cluster/class with many fields or containing large arrays etc.).
    Example 1:
    If the prototype does not modify the data then the compiler assumes that the Call By Reference node will not modify the data. However at run-time a check is made to see if the actual called VI will modify the data. If so, then a copy is made and passed in so that the original data can remain unmodified.
    Example 2:
    If the prototype contains an input that is wired through to an output in such a way that both the input and output terminals can use the same memory buffer, but at run-time a check determines that the actual called VI's input and output do not share a buffer, then a copy will be made from the actual call's output to the original VIs (combined input and output) buffer.
    I should also mention that even with this "attempt to agree with the prototype" behavior, it's not always possible to get as good performance as a regular SubVI call. For instance if you have a situation where the prototype does not modify the data and passes it through to an output then the compiler must assume that the data is modified (because as in example 2, there exist VIs that may modify it even if the actual VI called does not).
    And there are some caveats:
    1) This "using a prototype" behavior was new to 2009. Before that we used a more naive way of passing data that assumed all inputs will be modified and no outputs share a buffer with an input.
    2) This behavior is subject to change in future versions, if we find further optimizations.
    3) This behavior is the same as we use for dynamic dispatch VIs (when using LV classes)
    4) If you want to create a VI only to be used as a prototype, then you can use features of the In-Place Element Structure to control the "in-placeness characteristics" Namely the In/Out Element border nodes, the "Mark as modifier" feature of the border nodes (note the pencil icon on the In Element), and the Always Copy node.
    5) The prototype is only the first reference ever wired into the Call By Reference node. So if you do make a new prototype VI, you can't just make a reference out of it to wire to the Call By Reference node. I suggest deleting the Call By Reference node and dropping a new one.
    6) For remote calls, we always have to "make copies" by passing data over a network.
    I hope this helps, if you want any further information/clarification, then feel free to ask.
    2. Does the call by reference node execute in the UI thread? If the call is being made by a remote machine over ethernet, which thread does the host (the machine that makes the call by reference) execute on and which thread does the target (the machine that contains the VI file) execute on?
    In the local case, the Call by Reference node does not require the UI thread and can run in whatever thread the VI wants to execute in.
    When calling a remote VI, the Call by Reference node uses the UI thread (detailed below) on both the client and on the server.
    The client uses the UI thread to send the call request to the server and then again when the response comes back. The UI thread is not blocked during the time in between.
    The server receives the TCP message in the UI thread and then starts the call in the UI thread. The server also uses the UI thread to send the response back to the client. The UI thread is not blocked on the server during the execution of the VI.
    I hope people find this when they need it!
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction
    Solved!
    Go to Solution.

    I never use duct tape. I wrap my head in aluminum foil and thus get much better shielding from the aliens trying to tap my mind.
    Also easier to remove later, but why risk taking it off??
    LabVIEW Champion . Do more with less code and in less time .

  • Java is call by value or call by reference

    Hi! friends,
    I want to know,java is call by value and call by reference.
    Please give the the exact explanation with some example code.

    All parameters to methods are passed "by value." In other words, values of parameter variables in a method are copies of the values the invoker specified as arguments. If you pass a double to a method, its parameter is a copy of whatever value was being passed as an argument, and the method can change its parameter's value without affecting values in the code that invoked the method. For example:
    class PassByValue {
        public static void main(String[] args) {
            double one = 1.0;
            System.out.println("before: one = " + one);
            halveIt(one);
            System.out.println("after: one = " + one);
        public static void halveIt(double arg) {
            arg /= 2.0;     // divide arg by two
            System.out.println("halved: arg = " + arg);
    }The following output illustrates that the value of arg inside halveIt is divided by two without affecting the value of the variable one in main:before: one = 1.0
    halved: arg = 0.5
    after: one = 1.0You should note that when the parameter is an object reference, the object reference -- not the object itself -- is what is passed "by value." Thus, you can change which object a parameter refers to inside the method without affecting the reference that was passed. But if you change any fields of the object or invoke methods that change the object's state, the object is changed for every part of the program that holds a reference to it. Here is an example to show the distinction:
    class PassRef {
        public static void main(String[] args) {
            Body sirius = new Body("Sirius", null);
            System.out.println("before: " + sirius);
            commonName(sirius);
            System.out.println("after:  " + sirius);
        public static void commonName(Body bodyRef) {
            bodyRef.name = "Dog Star";
            bodyRef = null;
    }This program produces the following output: before: 0 (Sirius)
    after:  0 (Dog Star)Notice that the contents of the object have been modified with a name change, while the variable sirius still refers to the Body object even though the method commonName changed the value of its bodyRef parameter variable to null. This requires some explanation.
    The following diagram shows the state of the variables just after main invokes commonName:
    main()            |              |
        sirius------->| idNum: 0     |
                      | name --------+------>"Sirius"       
    commonName()----->| orbits: null |
        bodyRef       |______________|At this point, the two variables sirius (in main) and bodyRef (in commonName) both refer to the same underlying object. When commonName changes the field bodyRef.name, the name is changed in the underlying object that the two variables share. When commonName changes the value of bodyRef to null, only the value of the bodyRef variable is changed; the value of sirius remains unchanged because the parameter bodyRef is a pass-by-value copy of sirius. Inside the method commonName, all you are changing is the value in the parameter variable bodyRef, just as all you changed in halveIt was the value in the parameter variable arg. If changing bodyRef affected the value of sirius in main, the "after" line would say "null". However, the variable bodyRef in commonName and the variable sirius in main both refer to the same underlying object, so the change made inside commonName is visible through the reference sirius.
    Some people will say incorrectly that objects are passed "by reference." In programming language design, the term pass by reference properly means that when an argument is passed to a function, the invoked function gets a reference to the original value, not a copy of its value. If the function modifies its parameter, the value in the calling code will be changed because the argument and parameter use the same slot in memory. If the Java programming language actually had pass-by-reference parameters, there would be a way to declare halveIt so that the preceding code would modify the value of one, or so that commonName could change the variable sirius to null. This is not possible. The Java programming language does not pass objects by reference; it passes object references by value. Because two copies of the same reference refer to the same actual object, changes made through one reference variable are visible through the other. There is exactly one parameter passing mode -- pass by value -- and that helps keep things simple.
    -- Arnold, K., Gosling J., Holmes D. (2006). The Java� Programming Language Fourth Edition. Boston: Addison-Wesley.

  • How to get caller object reference from a method

    Hi,
    I am working a already existing Java Swing project, now I got a problem, in a method I need to get the caller object reference otherwise, I can't succeed this operation. So please tell me a way how to get the caller object reference from a method. that method would be static or regular method anything will do for me.
    Edited by: navaneeth.j on Jan 29, 2010 11:20 PM

    navaneeth.j wrote:
    Actually my doubt is, I have a method "addition" method, which is using by many classes so my requirement is in the addition method I want to write a code snippet which will identify and get the the caller object. Actually I tried Reflection.getcallerclass but there I am getting "CLASS" object not the actual object reference, but I want object reference.
    Actually we have a huge project which is writen plain JAVA, so in this project the authors written the Database connection package for single database transaction. so now we are using this project source code for JSF application in this web application the DB package has serve based on the dynamic db connection parameters, so if we want to change this package fully means need to solve the dependency problem in hundreds of classes, so my point is if I can access the caller object in the DB package when ever it gets called by any class from any where of the project. So actually I liked Reflection.getcallerclass, the way of implementation perfectly works for me but it is not giving caller object reference, if something gives the caller object then I can get the DB connection parameters then there is no need to pass the parameters in the hierarchy.You can add a parameter (of type Object) to your addition() method
    and everywhere you call the addition() method also pass this (which from the POW of the addition() method will be a reference to the calling class instance).
    There may be alternative solutions
    but none that require less effort.

  • Call by reference in weblogic

    hi all,
    i am using statful session ful bean ,where are i am using Vector ,when i retrieve
    the vector in to another Vector and do some manipulation on the new Vector ,but
    the Vector that is declared in the Stateful session bean remains unchanged , i
    had using the same thing with the main site , and my local site ,it is working
    on the localsite but not on the main site.
    e.g Vector test = m_sessionfulBean.getAllValue();
    when i do the changes it won't get reflected to the vector that it return.
    Can somebody help?

    The problem with the Vector (and almost all collections) is that while
    they clone the main object, the elements are not cloned so any
    modification to the elements will affect your original. That is why I
    said that you should clone the collection only if the caller would not
    modify the elements.
    Or the EJB method can also clone the elements and return a new Vector.
    The gain is performance since cloning is usually faster than serializing
    for local clients but the down side of this is that remote clients will
    have an overhead as for them the result will be serialized anyway so
    there was a cloning done with no need for it.
    Cheers,
    Dejan
    Byron Xiao wrote:
    See, I am not sure what he really means in his message. By the way, Vector also
    implements the Clonable interface. But the elements of the Vector may not implement
    the Clonable interface. If you clone the Vector and return the cloned Vector
    to the caller. There is no guarantee that the changes he made in the Vector elements
    will get clone properly. So in that case, you aren't really seeing the true "call
    by reference" behavior.
    Basically, I don't understand what his question was. Sorry for the confusion.
    "Deyan D. Bektchiev" <[email protected]> wrote:
    Not really true, if the Vector is serialized then it would have to
    serialize all of its elements and you'd get an exception that some
    elements were not serializable.
    The optimization that Sanjeev is seeing is a BEA optimization to allow
    calls by reference within the same enterprise application (parameter
    <enable-call-by-reference> in weblogic-ejb-jar.xml).
    By default the value is true so calls within the same EAR are just
    normal Java calls.
    If you set it to false then the parameters and return value of the EJB
    call will be serialized and the object that the EJB has will not be
    affected by any change that the caller does to it.
    Another way to get out of this situation is to clone the Vector (if that
    is acceptable since it would not clone the elements the Vector contains).
    --dejan
    Byron Xiao wrote:
    I don't know if I understand your problem 100%, but it seems like you
    manipulated
    the elements in your vector, which is a class member variable in your
    stateful
    session bean, and passing the vector back as the return parameter to
    the caller
    via the remote interface. And you don't see the changes in the "elements"
    of
    the vector, is that correct?
    Well, remember all parameters and the return value of the remote calls
    are Serializable.
    In this case, Vector indeed is serializable. But the ELEMENTS inside
    the vector
    may not be serializable objects. In this case, the container will use
    the default
    serialization mechanism to serialize / deserialize the elements into
    the persistent
    store or through the RMI I/O stream, which is just using a bit-wise
    dump of your
    Vector and all its elements object references to the persistent store
    or RMI I/O
    stream.
    So the solution is to declare all the objects in your Vector elements
    to implement
    the java.io.Serializable interface. If all the Objects in your vector
    elements
    only contain primitive data types, you don't need to do anything extra.
    If some
    objects in your vector elements contain other object types that don't
    implement
    the java.io.Serialiazable interface, then you will need to write your
    own writeObject
    and readObject method to serialize /de-serialize those objects. You
    can look
    up many tutorial on Sun's website on how to do this. Hope it helps.
    "sanjeev" <[email protected]> wrote:
    hi all,
    i am using statful session ful bean ,where are i am using Vector ,when
    i retrieve
    the vector in to another Vector and do some manipulation on the new
    Vector
    ,but
    the Vector that is declared in the Stateful session bean remains unchanged
    , i
    had using the same thing with the main site , and my local site ,it
    is
    working
    on the localsite but not on the main site.
    e.g Vector test = m_sessionfulBean.getAllValue();
    when i do the changes it won't get reflected to the vector that it
    return.
    Can somebody help?

  • Run VI versus Call by Reference

    I noticed that when you do Run VI you have the option of specifying whether or not you want to wait until the VI is done. I need to pass in a parameter so I'm using the Call by Reference node instead but I can't find the property that will allow me to specify if LabVIEW should wait until the sub-VI is completed or not. In this case I don't want it to. Is there a way around this?
    Message Edited by Gary D on 07-11-2005 09:27 AM

    Dennis Knutson wrote:
    You have to use the Run invoke node and pass parameters to the VI using either the Set Control Value or Set Control Value [Variant] method.
    I just tried that and I'm not sure if I set it up correctly. I'm now getting Error 42 at the invoke node. Its reason is listed as a General Error.
    Using the Variant thing works more. I get no errors but I also don't see my VI (have show FP on load and call wired as true). I think I can figure the rest out on my own. Thank you.
    Message Edited by Gary D on 07-11-2005 10:02 AM
    Message Edited by Gary D on 07-11-2005 10:02 AM

  • The buttons in main the vi get locked after opening a vi reference in a subpanel and using buttons within the subpanel.

    I am trying to open a reference to a vi in the subpanel of the main vi. However after the vi opens in the subpanel and after pressing a few buttons in the subpanel the buttons in the main vi get locked, i.e. I can't even close the main vi or control anything else. Is there any way how I can avoid this happening?

    > The buttons in main the vi get locked after opening a vi reference in
    > a subpanel and using buttons within the subpanel.
    >
    > I am trying to open a reference to a vi in the subpanel of the main
    > vi. However after the vi opens in the subpanel and after pressing a
    > few buttons in the subpanel the buttons in the main vi get locked,
    > i.e. I can't even close the main vi or control anything else. Is there
    > any way how I can avoid this happening?
    This is most likely happening because in either the top or sub panel,
    there is an event structure that is queuing events, and is set to lock
    the panel until the events are handled, and because of the logic in the
    diagram, the events aren't being pulled from the queue.
    So, you have a deadlock. You are waiting
    on the panel. The panel is
    waiting on the diagram. And the diagram is waiting on something else.
    So, if there are indeed event structures involved, determine where in
    the diagram things are delaying. Also, if you do not need the panel to
    lock until the event is handled, you can change the setting in the
    events dialog on the structure. But the events will still be queued
    until the diagram starts executing.
    Greg McKaskle

  • Translating call-by-reference from Fortran

    I have been asked to translate some Fortran code to Java with minimal redesign.
    I believe Java uses call-by-value and not call-by-reference, right?
    What are my best options for translating the many call-by-reference subroutines and functions?

    If you insist, then you can wrap objects up in a sort-of container, which can get you PBR-type semantics, but it's clunky. Eg
    class StringRef  {
      private String payload;
      public String toString() { return payload; }
      public void setPayload(String string) { payload = string; }
    public void passMeAString(StringRef string) {
      // do stuff;
    }You can reach into the StringRef object and change it's effective value. But then all code dealing with it, whether it needs PBR semantics or not, is either coupled to this StringRef class, or is peppered with code to lift the actual string in and out of StringRef objects. Or you could deal with single-element arrays everywhere, which isn't really any better.
    Messy, a maintenance nightmare, a haven for bugs. I'd really be looking at solving the problem without using pass-by-reference, if you don't want to have a nervous breakdown.
    Another thing to consider is that simply shoehorning your existing Fortran through a Java compiler means you're also inheriting all the bugs and the convoluted messy code from fixing bugs that you'd probably rather not. I seriously wouldn't try to do this, just infer the requirements from the Fortran code and start again. You might well even find that there already exist Java libraries that can replace some of your code.

  • HT2527 iphone locked after receiving call

    My iphone locked after receiving call. On screen only appears busy alert.

    Hi tavaresjx,
    If you haven't already done so, you may want to restart or reset the iPhone:
    iPhone, iPad, iPod touch: Turning off and on (restarting) and resetting
    http://support.apple.com/kb/HT1430
    Restarting your iOS device
    1. Press and hold the Sleep/Wake button for a few seconds until the red "slide to power off" slider appears, and then slide the slider.
    2. After the device has turned off, press and hold the Sleep/Wake button until the Apple logo appears.
    Resetting your device
    If your device stops responding, you can reset it by pressing and holding both the Sleep/Wake and Home buttons for at least ten seconds, until the Apple logo appears.
    If the above does not resolve your issue, the next best step will be to restore your iPhone using a computer with iTunes. Please be sure to backup your iPhone first.
    Choosing an iOS backup method (Should I use iTunes or iCloud to back up my iOS device?)
    http://support.apple.com/kb/HT5262
    iTunes: Restoring iOS software
    http://support.apple.com/kb/HT1414
    Thanks,
    Matt M.

Maybe you are looking for