jgcode Posted October 20, 2010 Report Share Posted October 20, 2010 Howdy I am trying to implement an X-Control that has a parallel Process and communicate between them. The Process is a User Interface that I want to run in parallel so it can be interacted with and the X-Control can continue to do its own thing (non-blocking). I have written separate code before which is easy but I am using an X-Control as I want to encapsulate both the Control and parallel User Interface into a single entity. In trying to communicate from the parallel Process back to the X-Control I had the X-Control register for Dynamic Events which will come from the Process. With the idea being the X-Control will receive a message/data and e.g. Update These events are getting queued, but they are not executing when I fire the event. They are getting executed when the next standard event (e.g. Data Change) occurs (hence I know they have been queued). Anyone have a workaround for this or a better way to do the above? Cheers -JG Quote Link to comment
Olivier Jourdan Posted October 20, 2010 Report Share Posted October 20, 2010 Anyone have a workaround for this or a better way to do the above? This is definitely not a better way to do but maybe a workaround to try (I've implemented this solution in this XControl): Create an hidden cluster with a string and a variant in your facade VI Create an event case on Cluster "Value change" Give cluster reference to your parallel process Do "Value (signaling)" using the cluster reference to "fire event" Process action in the event case create in 2. String and variant allows you to implement multiple action and different data to process in your facade VI. Hope this can work for you. Regards Olivier 2 Quote Link to comment
jgcode Posted October 20, 2010 Author Report Share Posted October 20, 2010 Hi Oliver Thanks for the reply - I will give this a shot. I like the datatype you have suggested too. Cheers -JG Quote Link to comment
Yair Posted October 20, 2010 Report Share Posted October 20, 2010 The Facade VI is only run when one of the XControl's events occurs. You can also trigger one of the other events by calling a property or method for the XControl. Quote Link to comment
jgcode Posted October 21, 2010 Author Report Share Posted October 21, 2010 This is definitely not a better way to do but maybe a workaround to try (I've implemented this solution in this XControl): Create an hidden cluster with a string and a variant in your facade VI Create an event case on Cluster "Value change" Give cluster reference to your parallel process Do "Value (signaling)" using the cluster reference to "fire event" Process action in the event case create in 2. String and variant allows you to implement multiple action and different data to process in your facade VI. Hope this can work for you. Regards Olivier [LV2009] Hi Oliver I tried your method but I still am having a problem. Nothing happens when writing to the value-signalling property in the dynamicVI the first time. Subsequent writes cause an event to be fired but I get data from the previous event! I have tried with different styles of dynamic processes just to see if that changes anything - but I get the same results launching a non-reentrant VI/reentrant VI/VI template with a static or dynamic reference. Any thoughts? FWIW: The Value Signalling PN works fine when it is on the X-Control. And the above runs fine when the dynamicVI is separated out of the X-Control. Cheers -JG Quote Link to comment
Olivier Jourdan Posted October 21, 2010 Report Share Posted October 21, 2010 You can also trigger one of the other events by calling a property or method for the XControl. As far as I know, if the dynamic process is part of the XC, you cannot use property or method owned by the XControl itself. [LV2009] Any thoughts? FWIW: The Value Signalling PN works fine when it is on the X-Control. And the above runs fine when the dynamicVI is separated out of the X-Control. More than a long text in a "crappy" english, I've attached a quick sample code (apologize for the messy G code, but it works) demonstrating what I've understood from your need. open the xctl file drop it in the New VI Front panel click on "Load // process" button send message from window to Xcontrol Let me know if it helps you. Regards XC.zip 1 Quote Link to comment
jgcode Posted October 25, 2010 Author Report Share Posted October 25, 2010 I've attached a quick sample code (apologize for the messy G code, but it works) Thanks Oliver. I still can't work out out what was happening before with the old data (RE: last post). But I have now managed to get the comms going between the processes on a new example. Cheers for your posts -JG Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.