Invoking method on different thread

Hi
I'm developing an addin a application. The addin runs on the main thread. However I need to perform some blocking system calls, which can't be called from the main thread, since it also blocks the application. Therefore, I have a worker thread which performs the blocking call. When the blocking call returns, I need to invoke a method on the main thread. The method must be executed by the main thread, because the method uses some of the applications api functions. If these api functions are called from any other thread than the main thread, the application will crash.
My problem is that I dont know how to invoke a method on a different thread. I guess I need to do the same thing as the SWING package, where gui components should be modified from the event dispatcher thread.
Simplyfied, my code looks something like this:
public class Main
    public static void main(String[] args)
       Main m = new Main();
       m.Test();
    public void Test()
        //runs on main thread here
        //start a new thread which blocks while waiting for user input (simulate my service)
        ThreadClass tc = new ThreadClass();
        new Thread(tc).start();
        while (true)
           //perform normal work on gui thread
           Thread.yield();         
   public void MethodNeedsToRunOnMainThread(int c)
       //Do something on main thread here
public class ThreadClass implements Runnable
    public void run()
        ThreadFunction();
    public void ThreadFunction()
        int c = System.in.read(); //blocking call
        //Invoke method on main thread here!   
        MethodNeedsToRunOnMainThread(int c);
    }Hope some of you might point me in the rigth direction!
\Bjarne

pdm wrote:
Using a BlockingQueue, the main thread will block while waiting for something to be put in the queue by the worker thread. This will block the program in which my add-in runs, since the main thread is responsible for gui updates etc. Therefore, this is not an option.
Maybe it is simply not possible to what I need.
\Bjarnedepending on what kind of responsiveness you need, you could make your add-in periodically check for these events. call poll() instead of take(), and then continue on with your add-in if poll() returns nothing. the frequency with which your code polls the queue will determine the lag between queueing from the other thread and executing on the main thread.

Similar Messages

  • Invoke Method: Run VI produces error when run as an application

    Hello,
    I have upgraded from LabView 7.0 to 2009. One test program uses Run VI Invoke Method to start the main UI. On LabView 7.0 it works OK , when build as an application, but with LabView 2009 it gives error 1003: Invoke Node xxx.vi <APPEND> VI Path: xxx. (I have checked that the path to "Open VI Reference" is correct.)
    When run on LabView 2009 development environment (.vi) - no problem. I used the "Convert built script.." tool to convert to LabView 2009 built specifications. I have tried numerous different variations building application with LabView 2009 (including main UI files, different setups, etc.), but no luck. If someone has any ideas...
    -timo

    Maybe it helps you for debugging:
    I checked the property for the broken arrow. You need a property node and go Select Class 'Vi Server'->'VI' (skip this in your Application but navigate to the VI via the server and feed it to the node). Then it is Execution->State.
    I need to draw some code to do it for me as well, once I'm done I'll post it here.
    Felix
    www.aescusoft.de
    My latest community nugget on producer/consumer design
    My current blog: A journey through uml

  • RFC - Java Proxy (Synchronous) invoking method

    Hi,
    I have problems to call my inbound java proxy.
    My scenario consist of send RFC -> Java Proxy (Synchronous)
    Proxy this registered
    http://hcp095.intra.csc.es:50100/ProxyServer/register?ns=http://csc.es/xi/rca&interface=Z_RCA_SCS&bean=ZRCASCS_PortTypeBean&method=zRCASCS
    ejb-jar.xml:
    <ejb-jar>
        <description>EJB JAR description</description>
        <display-name>EJB JAR</display-name>
        <enterprise-beans>
            <session>
                <ejb-name>ZRCASCS_PortTypeBean</ejb-name>
                <home>com.sap.aii.proxy.xiruntime.core.AbstractProxyInboundHome4</home>
                <remote>com.sap.aii.proxy.xiruntime.core.AbstractProxyInboundRemote4</remote>
                <local-home>com.sap.aii.proxy.xiruntime.core.AbstractProxyInboundLocalHome4</local-home>
                <local>com.sap.aii.proxy.xiruntime.core.AbstractProxyInboundLocal4</local>
                <ejb-class>es.csc.xi.rca.ZRCASCS_PortTypeBean</ejb-class>
                <session-type>Stateless</session-type>
                <transaction-type>Container</transaction-type>
            </session>
        </enterprise-beans>
    </ejb-jar>
    Class Impl:
    package es.csc.xi.rca;
    public class ZRCASCS_PortTypeImpl extends AbstractProxy implements ZRCASCS_PortType {
    public ZRCASCSResponse_Type zRCASCS(ZRCASCS_Type parameters) throws ZRCASCSException_Message_Exception, SystemFaultException,  ApplicationFaultException{
            //throw new RuntimeException();
            Rca_ws a = new Rca_ws();
            return a.zRCASCS(parameters);
    Error: XI_Monitor 
    <SAP:Category>XIAdapterFramework</SAP:Category>
      <SAP:Code area="MESSAGE">GENERAL</SAP:Code>
      <SAP:P1 />
      <SAP:P2 />
      <SAP:P3 />
      <SAP:P4 />
      <SAP:AdditionalText>com.sap.aii.af.ra.ms.api.DeliveryException: Error invoking method zRCASCS of proxy bean $Proxy305: cannot assign instance of com.sap.guid.GUID to field com.sap.aii.proxy.xiruntime.core.MessageSpecifierImpl.guid of type com.sap.guid.IGUID in instance of com.sap.aii.proxy.xiruntime.core.MessageSpecifierImpl: com.sap.aii.proxy.xiruntime.core.XmlInboundException: Error invoking method zRCASCS of proxy bean $Proxy305: cannot assign instance of com.sap.guid.GUID to field com.sap.aii.proxy.xiruntime.core.MessageSpecifierImpl.guid of type com.sap.guid.IGUID in instance of com.sap.aii.proxy.xiruntime.core.MessageSpecifierImpl</SAP:AdditionalText>
      <SAP:ApplicationFaultMessage namespace="" />
    Error: defaultTrace
    #hcp095.intra.csc_XID_19271950#ANGUZMAN#ec20b7f019f611de98340011259e6830#
    SAPEngine_Application_Thread[impl:3]_36##0#0#Error##Plain##
    #com.sap.aii.proxy.xiruntime.core.XmlProxyException: Error invoking method zRCASCS of proxy bean $Proxy366:
    cannot assign instance of com.sap.guid.GUID to field com.sap.aii.proxy.xiruntime.core.MessageSpecifierImpl.guid
    of type com.sap.guid.IGUID in instance of com.sap.aii.proxy.xiruntime.core.MessageSpecifierImpl
         at com.sap.aii.proxy.xiruntime.core.XmlProxyJ2EE.call(XmlProxyJ2EE.java:192)
         at com.sap.aii.proxy.xiruntime.core.XmlProxy$ProxyBeanCaller.call(XmlProxy.java:225)
         at com.sap.aii.proxy.xiruntime.core.XmlProxy.processRequest(XmlProxy.java:194)
         at com.sap.aii.proxy.xiruntime.core.XmlInbound.processRequestMessage(XmlInbound.java:126)
         at com.sap.aii.proxy.xiruntime.core.XmlInbound.processMessage(XmlInbound.java:83)
         at com.sap.aii.proxy.xiruntime.sbeans.JPRBean.onMessage(JPRBean.java:158)
         at com.sap.aii.proxy.xiruntime.sbeans.JPRLocalLocalObjectImpl0_0.onMessage(JPRLocalLocalObjectImpl0_0.java:175)
         at com.sap.aii.af.ra.ms.impl.ServicesImpl.deliver(ServicesImpl.java:276)
         at com.sap.aii.adapter.xi.ms.XIEventHandler.onDeliver(XIEventHandler.java:1049)
         at com.sap.aii.af.ra.ms.impl.core.queue.RequestConsumer.onMessage(RequestConsumer.java:119)
         at com.sap.aii.af.ra.ms.impl.core.queue.Queue.run(Queue.java:850)
         at com.sap.aii.af.ra.ms.runtime.MSWorkWrapper.run(MSWorkWrapper.java:56)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(AccessController.java:180)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:102)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:172)
    If somebody can help me.
    Thank you very much

    Solved!!!
    to assign library references to the project application-j2eeengine.xml
    com.sap.aii.proxy.xiruntime
    com.sap.aii.messaging.runtime
    com.sap.xi.util.misc
    com.sap.guid

  • Cannot invoke method "setMessageListener" within the J2EE container.

    I use TopicSubscriber.setMessageListener method to convert messages to my own type, but oc4j jms throws following exception:
    javax.jms.JMSException: TopicSubscriber[Oc4jJMS.Consumer.ypchang-cn.12da4a6:111d4f12137:-8000.94,Topic[CreatedSponsorTopic],null,null,false]: cannot invoke method "setMessageListener" within the J2EE container.
         at com.evermind.server.jms.JMSUtils.make(JMSUtils.java:1072)
         at com.evermind.server.jms.JMSUtils.toJMSException(JMSUtils.java:1152)
         at com.evermind.server.jms.JMSUtils.toJMSException(JMSUtils.java:1123)
         at com.evermind.server.jms.JMSUtils.assertNotContainer(JMSUtils.java:1538)
         at com.evermind.server.jms.EvermindMessageConsumer.setMessageListener(EvermindMessageConsumer.java:217)
         at com.firepond.bcmf.bus.BusSubscriberImpl.setMessageListener(BusSubscriberImpl.java:397)
    OC4J JMS doesn't support user defined MessageListener?????!!!!!!!!!!
    Who can help me out?
    Thanks!

    Hi,
    I am facing the same problem did you got any solution for it.
    I am getting the following error message too:
    Exception in Constructor
    javax.jms.JMSException: QueueReceiver[Oc4jJMS.Consumer.ssipl-wrkst-139.-7dd2dd24:1122873d95f:-8000.269,Queue[360Transaction]]: cannot invoke method "setMessageListener" within the J2EE container.
         at com.evermind.server.jms.JMSUtils.make(JMSUtils.java:1072)
         at com.evermind.server.jms.JMSUtils.toJMSException(JMSUtils.java:1152)
         at com.evermind.server.jms.JMSUtils.toJMSException(JMSUtils.java:1123)
         at com.evermind.server.jms.JMSUtils.assertNotContainer(JMSUtils.java:1538)
         at com.evermind.server.jms.EvermindMessageConsumer.setMessageListener(EvermindMessageConsumer.java:217)
         at com.skillnetinc.storehub.connector.pos.publisher.ejb.publishTransactionWithSalesAudit.PublishTransactionWithSalesAuditBean.<init>(PublishTransactionWithSalesAuditBean.java:94)
         at PublishTransactionWithSalesAuditBean_RemoteProxy_1dpbn83.OC4J_createBeanInstance(Unknown Source)
         at com.evermind.server.ejb.StatelessSessionBeanPool.createContextImpl(StatelessSessionBeanPool.java:37)
         at com.evermind.server.ejb.BeanPool.createContext(BeanPool.java:418)
         at com.evermind.server.ejb.BeanPool.allocateContext(BeanPool.java:244)
         at com.evermind.server.ejb.StatelessSessionEJBHome.getContextInstance(StatelessSessionEJBHome.java:25)
         at com.evermind.server.ejb.StatelessSessionEJBObject.OC4J_invokeMethod(StatelessSessionEJBObject.java:86)
         at PublishTransactionWithSalesAuditBean_RemoteProxy_1dpbn83.invoke(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.rmi.RmiMethodCall.run(RmiMethodCall.java:53)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)

  • How to invoke method dynamically?

    hai forum,
    Plz let me know how do we invoke a dynamically choosen method method[ i ] of a class file by passing parameter array, para[ ].The structure of my code is shown below.. How will i write a code to invoke the selected method method?Plz help.
    public void init()
    public void SelectClass_actionPerformed(ActionEvent e)
    //SELECT A METHOD method[ i ] DYNAMICALLY HERE
    private void executeButton1_mouseClicked(MouseEvent e) {
    //GET PARAMETERS para[ ] HERE.
    //METHOD SHOULD BE INVOKED HERE
    }//end of main class

    Often,a nicer way would be to create an interface like "Callable" with one single "doMagic()" method, and different classes implementing this interface, instead of one class with different methods. Then simply load the class by name, call newInstance(), cast to Callable and invoke doMagic(). Keeps you away from most of the reflection stuff.

  • Javax.jms.JMSException:TopicConnection ( can't invoke method setClientID )

    07/02/19 11:21:47 javax.jms.JMSException: TopicConnection[Oc4jJMS.Connection.dsc
    p18056.3b2816fc:110d886e29f:-8000.35]: cannot invoke method "setClientID" within
    the J2EE container.
    07/02/19 11:21:47 at com.evermind.server.jms.JMSUtils.make(JMSUtils.java:1
    034)
    07/02/19 11:21:47 at com.evermind.server.jms.JMSUtils.toJMSException(JMSUt
    ils.java:1114)
    07/02/19 11:21:47 at com.evermind.server.jms.JMSUtils.toJMSException(JMSUt
    ils.java:1085)
    07/02/19 11:21:47 at com.evermind.server.jms.JMSUtils.assertNotContainer(J
    MSUtils.java:1500)
    07/02/19 11:21:47 at com.evermind.server.jms.EvermindConnection.setClientI
    D(EvermindConnection.java:254)
    07/02/19 11:21:47 at oracle.otnsamples.oc4jjms.ChatSubscriber.createSubscr
    iber(Unknown Source)
    07/02/19 11:21:47 at oracle.otnsamples.oc4jjms.GetMessage.doGet(Unknown So
    urce)
    07/02/19 11:21:47 at javax.servlet.http.HttpServlet.service(HttpServlet.ja
    va:743)
    07/02/19 11:21:47 at javax.servlet.http.HttpServlet.service(HttpServlet.ja
    va:856)
    07/02/19 11:21:47 at com.evermind.server.http.ServletRequestDispatcher.inv
    oke(ServletRequestDispatcher.java:719)
    07/02/19 11:21:47 at com.evermind.server.http.ServletRequestDispatcher.for
    wardInternal(ServletRequestDispatcher.java:376)
    07/02/19 11:21:47 at com.evermind.server.http.HttpRequestHandler.doProcess
    Request(HttpRequestHandler.java:870)
    07/02/19 11:21:47 at com.evermind.server.http.HttpRequestHandler.processRe
    quest(HttpRequestHandler.java:451)
    07/02/19 11:21:47 at com.evermind.server.http.HttpRequestHandler.serveOneR
    equest(HttpRequestHandler.java:218)
    07/02/19 11:21:47 at com.evermind.server.http.HttpRequestHandler.run(HttpR
    equestHandler.java:119)
    07/02/19 11:21:47 at com.evermind.server.http.HttpRequestHandler.run(HttpR
    equestHandler.java:112)
    07/02/19 11:21:47 at oracle.oc4j.network.ServerSocketReadHandler$SafeRunna
    ble.run(ServerSocketReadHandler.java:260)
    07/02/19 11:21:47 at oracle.oc4j.network.ServerSocketAcceptHandler.procCli
    entSocket(ServerSocketAcceptHandler.java:230)
    07/02/19 11:21:47 at oracle.oc4j.network.ServerSocketAcceptHandler.access$
    800(ServerSocketAcceptHandler.java:33)
    07/02/19 11:21:47 at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptH
    andlerHorse.run(ServerSocketAcceptHandler.java:831)
    07/02/19 11:21:47 at com.evermind.util.ReleasableResourcePooledExecutor$My
    Worker.run(ReleasableResourcePooledExecutor.java:303)
    07/02/19 11:21:47 at java.lang.Thread.run(Thread.java:595)

    This is a J2EE 1.4 restriction.
    See section: J2EE.6.6 Java Service (JMS) 1.1 Requirements
    "The following methods may only be used by application components
    executing in the application client container:
    javax.jms.Connection method setClientID"
    For in-container connections, you should set clientID via the .xml.
    -Jeff

  • Run sql query on a different thread

    Hello,
    I have a swing app that queries an MS SQL database and it works fine and everything happens in the same thread. However for improved performance and to avoid freeze ups, I want the SQL queries themselves to execute on a different thread as a different class, other than the swing app class. The query results (Result Set) I want them back to my swing app so I can present them on a JTable.
    Here is an example of what I am trying to accomplish:
    - Press button in my swing app.
    - Call class that implements Runnable
    - In the Run method of the new class do the following (this code will execute in a new thread):
    url = "jdbc:sqlserver://ServerName:1433;databaseName=Database;user=UserName;password=password";
    try{
         Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
         Connection con = DriverManager.getConnection(url);
         Statement stmt;
         ResultSet rs;
         stmt = con.createStatement();
         String queryString = "select * from databaseName";
         rs = stmt.executeQuery(queryString);
          con.close();
    catch(Exception em){
          em.printStackTrace();
         JOptionPane.showMessageDialog(null,em.toString());
    }- Get the ResultSet rs back from the class
    - Work with the results back in my swing app and present them in the JTable
    while(rs.next()){
                //do some stuff
         }Any help or hints are greatly appreciated.
    Thanks,
    Chris

    Two suggestions:
    -- Take a look at SwingWorker for taking care of the threading issues
    -- Keep all database handling code together. Collect the records into a Collection -- most likely ArrayList -- and return that. This way you can close the Connection and RecordSet within the same method that opens them.
    Just my 0.02.
    db

  • Awful Java applet performance -- never mind, being handled in a different thread

    Awful Java applet performance -- never mind, being handled in a different thread.

    Here's some more info that may be of use ... The Applet is signed and this particular problem only occurs with Safari. It has not been seen as of yet when using Firefox. And it definitey does not occur on Windows platforms with IE or Firefox. It's been observed across multiple versions of the applet and appears to have become an issue around the time of Leopard 10.5.6/Safari 3.2.1. I don't know if it has anything to do with the problem, but the html that starts the applet is dynamically generated from javascript. A user clicks a thumbnail image on a web page, the javascript opens a dojo dialog, and within the div that contains the dialog, another div is inserted containing the html that starts the applet. The applet also does a number of liveconnect calls to call javascript methods. When a "close" button is clicked on the Applet, the inverse occurs. The javascript clears the html that contained the applet. The applet's destroy method is called and there are no apparent memory leaks.
    The problem never seems to occur the first time the applet is started. It's always on a subsequent instantiation. Frequently, when it occurs, the applet is only partially painted and I sometimes see paint related calls on the stack trace of the awt thread.

  • Simpletagsupport invoke method

    I am confused about the interface SimpleTagSupport. My j2sdk1.4 compiler gives an error when I call the method invoke(java.io.Writer, java.util.Map) with 2 parameters. I found this in a wrox book I am using called Beginning J2EE 1.4 . Our sun java site http//java.sun.com/j2ee/1.4/docs/api/javax/servlet/jsp/tagext/SimpleTagSupport.html says that this method only acceps a single parameter. I found other sites on the web which gave me a different definition of this interface(I searched for this method on google). http://ganymed.informatik.uni-augsburg.de/doku/java/j2ee/api/javax/servlet/jsp/tagext/JspFragment.html
    Gives another implementation of this method which matches with the way it is used in my book. Now how is this possible? Please help me understand this issue.

    I am sorry guys. I meant the JspFragment class. The invoke method is of this class. But the problem I mentioned is there.

  • Is there a way to run two different threads indefinitely

    I have two different threads and they both are doing different tasks.... I want them to be running indefinitely....
    i want the threads to run indefinetly passing the control between one another( anyway, passing the control is unpredicatable)
    I dont want the tasks to be run in a infinite loop but the threads itself, which are doing their respective tasks.....

    vinney_143 wrote:
    anyway, with respect to what i understood, this is what i tried.............. i thought of calling the start() methods within a loop but it should be throwing illegalThreadStateException. so, i came to this forum to seek some help on this.
    If i am gonna put the loop inside the threads, i dont think that serves my purposes of calling two threads indefinitely and not doing a task in each thread indefinitely........Threads have states: NEW, RUNNABLE, BLOCKED, WAITING, TERMINATED. When you create a thread (as an instance of thread) it is in NEW state. When you call start() on the thread instance it goes into RUNNABLE state. Process scheduler chooses a thread in runnable pool and runs it on the processor. When a thread goes to RUNNABLE etc states it can not go to NEW state (thats illegal). From a RUNNABLE state thread can only go to BLOCKED, WAITING or TERMINATED states. You can't call start() on the thread more than once. Once a thread is terminated (TERMINATED state) it can't go to NEW state either. Once start() is called the thread is started and you write logic that determines when the thread is terminated. Thats the reason why you got an IllegalThreadStateException.
    while(true) {
        thread.start(); // throws IllegalThreadStateException
    }Heres one way to keep thread running till a certain condition is met.
    class MyThread extends Thread {
        public void run() {
            while(true) {
                boolean condition = //
                if(condition) {
                    return; // terminates thread because run() returns
    }Hope this helps.

  • Report Generation Toolkit producing error -2147417842, "The application called an interface that was marshalled for a different thread."

    Hi everybody,
    I've got an application that logs data to an Excel spreadsheet using the Report Generation Toolkit.  My VI's have worked fine in the past using Excel XP, but since I've upgraded to Excel 2007, I am getting COM errors like this one:
    "Error -2147417842 occurred at The application called an interface that was marshalled for a different thread. in Excel_Insert_Text.vi"  That is the exact wording, even with the weird punctuation and capitalization.
    The first occurrence of the error is not determinate.  Sometimes, up to 10 logging sessions, involving a new .xls file, can occur before this error pops up.  Once this error occurs, I must quit LabVIEW to resolve it.  If I try to do anything with Excel, I always get this error, although sometimes it comes out of different source VIs.  Excel_Open.vi is another.
    These logging VIs have worked just fine until upgrading to Excel 2007.  I checked, and I was using a really old version of the Report Generation Toolkit, v1.0.1.  I read the documentation and had a big sigh of relief when I realized I needed to upgraded to v1.1.2 to get Excel 2007 support.  However, even after upgrading, I'm still getting the same errors.  I'm using LabVIEW 8.0.1, and I'm also building these VIs into an application.   The error occurs both in the LabVIEW IDE and in the built application.  Does anybody out there have any idea what I can do to fix this?  I googled a little, and discovered this is a COM error, but I can't find any references to the Report Generation Toolkit specifically.
    Thanks,
    Phil
    Solved!
    Go to Solution.

    Hi Christian,
    I do not see that exact option listed, do you mean "user interface"?  I recognize the "Run in UI Thread" option, it's on the Call Library Function Node.
    I checked, and my top-level VI has "same as caller" set, and I believe all my VIs are set to "same as caller".  Are you suggesting I change my top-level VI preferred execution environment to "user interface", or just the logging sub-VIs that use the Report Generation Toolkit?
    Thanks,
    Phil
    Attachments:
    VI_properties.png ‏15 KB

  • Error -50400 occurred at Invoke Method: FIFO.Read in Host.vi

    Hey there,
    we have sensors on an Engine which are connected to a NI cRIO 9014 board (with a NI9411 6-channel digital input modul) and go from there via network to a host computer.
    cRIO board: the cRIO board collects the data from the engine and stores it in a buffer, this is because the network is to slow for the magnitude of data
    host computer: the host computer reads over the network the buffer on the cRIO board, on the host computer it takes out specific portions of the data to create pressure graphs of the engine
    Error: 
    Error -50400 occurred at Invoke Method: FIFO.Read in Host.vi
    Possible reason(s):
    The transfer did not complete within the timeout period or within the specified number of retries.
    This error occurs in the following scenario:
    - engine is running
    - cRIO is running
    When I press the start button (boolean 3) in the host.VI to start the reading of the data from the board AFTER I pressed the run button of the host VI. 
    The Error would not occur if I pressed the start button (boolean 3) BEFORE I pressed the run button of the host VI.
    We tried to increase the time out, but it still did not work, the error occurs!
    We would be really happy if you could look over it and help us in this case! If you need further informations or if we need to clarify some specific portion, please let us know!
    We included the VI's in the attachement!
    Thanks in advance!
    Solved!
    Go to Solution.
    Attachments:
    Host.vi ‏152 KB
    C_RIO.vi ‏92 KB
    Cyl_Pres.lvproj ‏196 KB

    Chrisse,
    There are a few things wrong in your application, if I may offer some suggestions.
    First, your while loops are not running in parallel.  In fact, they are in while loops with a true constant wired to them. I am not sure if this is by design for debugging, or on accident.  I would put the Polling(read pulling zero elements) outside your main while loop.
    Your second nested while loop (the one polling the # of elements and then pulling them out) is going to run just once, and may pull only a few samples.  I don't think that is what you are looking for here, and there are a couple ways we can go here.  You could continuously poll until you have 0 elements available for x amount of time, then you know you have no more samples available and you can process all the data OR you can put all of your data processing as part of that loop and just always write to file immediately as x samples are pulled.
    Also, your main loop's stop condition is (i <= 3) Therefore, it will run once and then stop.  Maybe you mean >=3?
    Also, you have 'append to file' disabled on your write to spreadsheet, so everytime you write you are overwriting old data.  If you want to continuously write, you will be losing data.  This can be cured by either setting this to true(requiring a new file name or programatically deleting the old spreadsheet every time you run the vi) OR you can collect all of your data in a shift register, and only write to file once you have all your data available.
    The error you are seeing is because you try to close your FPGA reference twice.  You only need to close it once.
    After seeing your overall picture, I think this can all be cured by simply hardwiring your Read to get your 1440X4 elements, but as we have seen, this does not work.  Something is happening in your system....this is what I want you to do...run just the following code...and let me know how many elements remaining it gives you...Once the number has settled(I hope it does and your engine doesn't keep running), hit stop, and all the values will be put on a graph for you.  My broken wires are because I do not have the FPGA VI.
    Message Edited by Robbob on 04-21-2009 01:48 PM
    Rob K
    Measurements Mechanical Engineer (C-Series, USB X-Series)
    National Instruments
    CompactRIO Developers Guide
    CompactRIO Out of the Box Video
    Attachments:
    numelements.jpg ‏39 KB

  • Failed to invoke end componentFailed to invoke method error

    I am getting this error while invoking a web service in weblogic.
    What is root cause of this error...?
    Error Description:-
    <remoteFault xmlns="http://schemas.oracle.com/bpel/extension">
    -<part name="code">
    <code>Server
    </code>
    </part>
    -<part name="summary">
    <summary>Failed to invoke end componentFailed to invoke method
    </summary>
    </part>
    -<part name="detail">
    <detail>
    <detail><bea_fault:stacktrace xmlns:bea_fault="http://www.bea.com/servers/wls70/webservice/fault/1.0.0"
    xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"/>java.lang.NullPointerException
         at org.tcs.billingeai.ws.allocateBillCycle.AllocateBillCycle.allocateBillcycle(Unknown Source)
         at org.tcs.billingeai.ws.allocateBillCycle.BillCycleService.invokeAllocateBillCycle(Unknown Source)
         at sun.reflect.GeneratedMethodAccessor496.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at weblogic.wsee.component.pojo.JavaClassComponent.invoke(JavaClassComponent.java:91)
         at weblogic.wsee.ws.dispatch.server.ComponentHandler.handleRequest(ComponentHandler.java:68)
         at weblogic.wsee.handler.HandlerIterator.handleRequest(HandlerIterator.java:127)
         at weblogic.wsee.ws.dispatch.server.ServerDispatcher.dispatch(ServerDispatcher.java:84)
         at weblogic.wsee.ws.WsSkel.invoke(WsSkel.java:60)
         at weblogic.wsee.server.servlet.SoapProcessor.handlePost(SoapProcessor.java:66)
         at weblogic.wsee.server.servlet.SoapProcessor.process(SoapProcessor.java:44)
         at weblogic.wsee.server.servlet.BaseWSServlet$AuthorizedInvoke.run(BaseWSServlet.java:124)
         at weblogic.wsee.server.servlet.BaseWSServlet.service(BaseWSServlet.java:53)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:225)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:127)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:272)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:165)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3153)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:1973)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1880)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1310)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:179)
    </detail>
    </detail>
    </part>
    </remoteFault>
    </fault
    Edited by: 911694 on Jun 25, 2012 1:02 PM

    This is a very convinient feature of Weblogic startup service - if your class
    does not implement T3StartupDef it will look for (using introspection)
    public static void main(String[] args) in your startup class, and, if it is
    there it will execute it.
    Ricky Wong <[email protected]> wrote:
    It works, many thanks !
    However I still have one more question out of my head - I found that my
    startup class doesn't need to implement the T3StartupDef and it still
    works, however my shutdown class must implement the T3ShutdownDef
    (otherwise I'll get ClassCastException).
    In article <[email protected]>, [email protected] says...
    Most likely the HubDevicePool does not have a public default constructor.
    Ricky Wong <[email protected]> wrote:
    In what situation I'll get the error "Failed to invoke startup/shutdown
    class" as below :
    java.lang.InstantiationException:
    dsb/eBanking/backOffice/connect/HubDevicePool
    at java.lang.Class.newInstance0(Native Method)
    at java.lang.Class.newInstance(Compiled Code)
    at weblogic.t3.srvr.StartupThread.runStartup
    (StartupThread.java:180)
    at weblogic.t3.srvr.StartupThread.doWork(Compiled Code)
    at weblogic.t3.srvr.PropertyExecuteThread.run
    (PropertyExecuteThread.java:62)
    I'm pretty sure that the class HubDevicePool has been coded (e.g.
    implement T3xxxDef interface, with either the startup() or shutdown()
    method) properly as I've another startup classes which work perfectly.
    The class has been compiled without error, but it just cannot run when I
    put it as either a startup or shutdown class for WebLogic.Dimitri
    Dimitri

  • IPhone sending texts to two different threads

    I have an iPhone 4S running iOS 6.1.3 and I'm on the Sprint network.
    To preface, way earlier this summer I sent out a message to several people, all with iPhones with iMessage enabled. Turned out that the contact info I had for one of the contacts on my phone, let's call him Friend 1, was wrong (I somehow had an 8-digit phone number for him, I guess I had just entered the information incorrectly and never texted him before). The texts were obviously going to everyone except Friend 1. So I corrected his contact info with his correct number, made a new group thread, and all was better.
    Then two days ago, another one of my friends (Friend 2) in the same group thread turned off his iMessage because he's got a different bug on his phone that makes it freeze up every time he sends an iMessage. Anyway, as I expected, every message I send in the group thread is now green, being sent as an SMS. But everyone else in the thread is still able to send iMessages to it, which Friend 2 receives, despite having turned off iMessage on his phone.
    However, whenever I try to send a message, I'm almost always only able to send an SMS. One of my other friends (Friend 3) informs me that all my SMSes sent since Friend 2 turned off his iMessage have been going to a different thread, the one from months ago with Friend 1's number entered incorrectly. I can see every message that everyone else sends in the thread, including those of Friend 1, whose contact info is still correct. Occasionally when I open the thread I'll be able to send an iMessage, which everyone receives, but most of the time I'm only able to send SMSes, which go to the broken thread that everyone except Friend 1 can see. On my phone, though, it looks like I'm sending and receiving every message in the same thread with all the info correct, and every message that any of my friends send in either thread comes into the one thread on my phone with Friend 1's number entered correctly.
    Whenever I text Friend 1 individually or in any thread that doesn't have Friend 2 (who turned off iMessage) in it, everything works perfectly. I have no problem in any other iMessage conversation. But the thread with all of us in it together presents these problems where any time I'm not able to send iMessages, the SMSes appear to me to be sent in the same thread, but for everyone else (except Friend 1 who can't see them at all) they go into the old broken thread.
    To clarify, whether or not I'm able to send iMessages seems to turn on and off arbitrarily between texts, that is to say, it doesn't seem to be corrolated to whether or not anyone in the thread is or isn't connected to the network.  I'll send a few SMSes in the thread, which go to the broken one, and then my phone will be able to send one iMessage, and I can wait as long as I want to send it- the capability doesn't go away with time, but as soon as I send the one iMessage I can't send any more. That iMessage goes to the good thread, and then it'll turn back to SMS for either a random period of time or a random quota of SMSes sent, I can't tell.
    Basically I can't understand how this could be happening. I don't get how I could be sending these texts to a number that I don't have in my phone. I don't get why iMessage seems to turn on and off arbitrarily for me alone in this one group thread. I also don't understand how someone (Friend 2) with iMessage turned off can be receiving iMessages in a group thread but can't send them himself or receive them when someone texts him alone, but that's not a problem, just a related curiosity.
    I know this is a huge explanation, but I just wanted to be as thorough as possible. If any clarification is needed just let me know. Thank you guys for any help you can provide.

    No problem. However, like I said earlier, music is a sync, no problem since that content is on a computer. Contacts and calendar is a sync, no problem since that content is on a computer as well. Just make sure there is a file backup of those components. The next thing is to save pictures and other data. I suggest you have a sync of both computers to the phone, and then do a backup on your personal computer. I would also import the pictures to the personal computer as a bakup, however you can keep them in the Camera Roll if you want after you have imported them. This ensures you have data backed up. Restore the new phone to the backup on your personal computer. Make sure it is set to only sync music.You should get your data, and then it can resync the music. Make sure the work computer is only setup to sync manually and to sync just contact and calendar data and nothing else. Connect the phone to that computer and sync. You should get your contacts and calendar. Now you might get a warning box saying the iPhone is synced to another library, but don't worry since the work computer is not setup to sync music. Now remember, this is my 2cents worth based on what information you provided. You cand decide if you want to do this or not and you make your choices on your own.

  • Double contacts as "iPhone"...my phone saves the same number twice, once with a 1 before the area code and one without it. It causes two different threads in my texts even of they're saved as the same contact

    my phone saves the same number twice, once with a 1 before the area code and one without it. It causes two different threads in my texts even of they're saved as the same contact

    My wife is having the same problems as a reciever. She works in a school as a teaching assistant and her teacher sends messages that are mixed with previous texts from ages ago.
    Can anyone shed some light on this problem or is it only her and this poster?
    2m42s

Maybe you are looking for

  • Which version of Windows (XP, Vista, 7?) is best for MacBook 2.2Ghz Intel Core 2 Duo, OS 10.6.8 when using boot camp?

    Hi all, I am about to install boot camp, and I was wondering which version of Windows works best for my Mac. Many thanks for your help. Francesco

  • IMac-Green light nothing more....

    I work for a large school district and am having the same issue with several iMac machines. I get a green light and nothing more, no chime, no HD activity, nothing... Here is what I have done. Reset PMU, changed battery, swapped with known good RAM,

  • Black 1st screen on movie made in Iphoto

    Hello. I have just created my first Quicktime movie in Iphoto. I have imported it into my Iweb website that I am creating, but the first thing you see is a blank screen. How can I have the first image in my movie be what you see before you press play

  • MySQL SQL Question

    OK fellas. Gentle on the newbie. I have my datasource set up, I have the MySQL Query Browser working and I'm poking around a bit with the World dB tables. I can't seem to get why this: SELECT * FROM countrylanguage c; ORDER BY IsOfficial; isn't doing

  • LabView Runtine Engine Corrupted

    I have a computer that had LVRTE 8.2.1 installed on it at one point.  We have subsequently uninstalled it, but it is not gone.  We have installed a new version of our software with LVRTE 9.0.1 and everytime we start it up, the 8.2.1 MSI fires up and