tushar Posted October 23, 2007 Report Share Posted October 23, 2007 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 Quote Link to comment
Ton Plomp Posted October 23, 2007 Report Share Posted October 23, 2007 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 LabVIEWif 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 Quote Link to comment
Aitor Solar Posted October 23, 2007 Report Share Posted October 23, 2007 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 Quote Link to comment
Ton Plomp Posted October 23, 2007 Report Share Posted October 23, 2007 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 Quote Link to comment
Ton Plomp Posted October 24, 2007 Report Share Posted October 24, 2007 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 LabVIEWif 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 And http://forums.ni.com/ni/board/message?board.id=170&message.id=279433&jump=true' target="_blank">cross-posted to the NI forums. Tushar, could you give us an update (or a code-part)? Ton Quote Link to comment
Olivier Jourdan Posted October 24, 2007 Report Share Posted October 24, 2007 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 Quote Link to comment
Norm Kirchner Posted October 27, 2007 Report Share Posted October 27, 2007 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. Quote Link to comment
Norm Kirchner Posted November 2, 2007 Report Share Posted November 2, 2007 Please checkout http://forums.lavag.org/LVx-Exported-LV-Fu...tml&p=37874 the example shows how you can register an EXE for a non exe based event. but you can use the same methodology to register the xControl for an external event or Register a program for an event within the xcontrol. 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.