Jump to content

Can I create User Event for XControl


Recommended Posts

In VB if i write my own ActiveX Control then in addition to Properties and Methods i can Define my own custom events. is there any similar thing availale For X Controls written in LabVIEW

if yes then how can i write my custom events.

i dont want to generate the event based on instance of Xcontrol. but i would like to Embed an user event in Xcontrol which i can handle in event structure outside XControl

Thanks

Link to comment

QUOTE(tushar @ Oct 22 2007, 10:40 AM)

In VB if i write my own ActiveX Control then in addition to Properties and Methods i can Define my own custom events. is there any similar thing availale For X Controls written in LabVIEW

if yes then how can i write my custom events.

i dont want to generate the event based on instance of Xcontrol. but i would like to Embed an user event in Xcontrol which i can handle in event structure outside XControl

Thanks

Let me see if I understand you.

You want to trigger a user event in the containing VI from within the XControl? This means your XControl is tight to the owning VI, but it can be done.

First you have create a user event in the owning VI.

Then send the user event into the XControl via a property node (so you need a custom property).

Trigger the user event somewhere in the XControl.

Register for the user event in the owning VI somewhere.

Good luck!

To me this sounds rather silly because IMHO an XControl is a standalone piece of software that should be able to run standalone. But I think it should work

Ton

PS If you want to do it the other way around (triggering an event in the XControl from the outside world) you can execute a property node. Inside the facade VI 'Display State Change' event is triggered if a property is executed

Link to comment

QUOTE(tcplomp @ Oct 22 2007, 01:09 PM)

To me this sounds rather silly because IMHO an XControl is a standalone piece of software that should be able to run standalone.

I think it can run standalone. Create the user event in the XControl (for example in the initialization) and store it in the State, then add a property or method for retrieving the user event reference and register it in the owning VI. The XControl will work on its own, and if you don't need the event, don't use it.

Saludos,

Aitor

Link to comment

QUOTE(Aitor Solar @ Oct 22 2007, 02:19 PM)

I think it can run standalone. Create the user event in the XControl (for example in the initialization) and store it in the State, then add a property or method for retrieving the user event reference and register it in the owning VI. The XControl will work on its own, and if you don't need the event, don't use it.

Saludos,

Aitor

One thing, don't forget to destroy the user event in the Uninit ability

Ton

Link to comment

QUOTE(ptit bras @ Oct 23 2007, 01:50 AM)

Hi,

I'm a bit scared about user event in XControl. In my experience user event are processed by facade VI, only when a "standard" event is handle... but I'm interseted by any new solution to improve XControl use, so I'll read this topic with many attention :)

Bye

It is quite true, the XControl only runs when a pre-defined set of events are fired. In order to accomplish what you are looking to do, you must have a background routien running that is registered for this event and when it happens, it passes the information to a method of the XControl, preferrablly of the data type of the event.

So it's a bit round about, but you'll start a background process, that has an input of the user event reference, within the process, register for that event and within the event case for that event, fire a user created method that takes the data from the event and passes it to the XControl, possibly w/ a command that the data is associated with.

Sounds like a prime candidate for Objects.... wait.... I've already created this.... hmmm. called LVx

A demo and the code is complete but the demo is not descriptive enough and bundling it up for distribution sucks ###### from the project.

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
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.