Jump to content

X-Control with Parallel Process


jgcode

Recommended Posts

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

post-10325-071705600 1287542962_thumb.pn

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

Link to comment

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):

  1. Create an hidden cluster with a string and a variant in your facade VI
  2. Create an event case on Cluster "Value change"
  3. Give cluster reference to your parallel process
  4. Do "Value (signaling)" using the cluster reference to "fire event"
  5. 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

  • Like 2
Link to comment

This is definitely not a better way to do but maybe a workaround to try (I've implemented this solution in this XControl):

  1. Create an hidden cluster with a string and a variant in your facade VI
  2. Create an event case on Cluster "Value change"
  3. Give cluster reference to your parallel process
  4. Do "Value (signaling)" using the cluster reference to "fire event"
  5. 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

Link to comment

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

  • Like 1
Link to comment

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

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.