LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I create Custom Event for XControl

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

Tushar Jambhekar
tushar@jambhekar.com

Jambhekar Automation Solutions
LabVIEW Consultancy, LabVIEW Training
Rent a LabVIEW Developer, My Blog

Message 1 of 11
(5,458 Views)
Hi,
X controls are not my strongest subject but there is no way I know of to create custom events.  Not sure if you can do what you ask or not.  I will try to do some research to find out for sure.
Eric A.
National Instruments
Distributed I/O Product Support Engineer
0 Kudos
Message 2 of 11
(5,436 Views)
Does anyone have the answer to this question?  It would be really nice feature if we could do this
- James

Using LV 2012 on Windows 7 64 bit
0 Kudos
Message 3 of 11
(5,301 Views)
You can certainly have an XControl create and generate user events. The only thing you'll have to think of is an appropriate way to export the User Event refnum to the host VI so that it can register for the event. Two ways to do this are to have the XControl's actual terminal value be the User Event refnum (I've prototyped this successfully), or you could just have a custom Property Node or Invoke Node that exports it.
Jarrod S.
National Instruments
Message 4 of 11
(5,299 Views)
Thanks for the quick reply.  I think I will use a custom property and handle registering for the user event in my main app.


Thanks!
- James

Using LV 2012 on Windows 7 64 bit
0 Kudos
Message 5 of 11
(5,296 Views)
Here's an example (sounds like you don't need it, but I whipped one up before I saw your reply). Hope this helps!

Saved in LV85.
Jarrod S.
National Instruments
Message 6 of 11
(5,292 Views)
Jarrod is right, a (read-only) property is the best way to do this.
The property execution will trigger the 'Display State Change' event.

If you use some special signalling routine inside the 'State' control you will be able to do everything you want.

Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 7 of 11
(5,267 Views)
Can someone look at this xcontrol for me and tell me why one indicator works different from the other?

the project is called gauge_project.lvproj

the concept for the xcontrol is to provide an array of clusters to many indicators and they will show different data depending on the element selected from the drop down menu inside the indicator

it is supposed to have the ability to handle labels that change from the data array and also handle new elements and removed elements.


What is happening is that it works ok in the beginning then after adding and deleting array elements and/or changing the labels one gauge acts correctly and the other one does not respond the same way but they are the same xcontrol?




Message Edited by James R on 04-03-2008 12:49 PM
- James

Using LV 2012 on Windows 7 64 bit
0 Kudos
Message 8 of 11
(5,250 Views)

Hi James,

Can you tell me a bit more about the differences that you are seeing with the two X controls? I am running the VI but I'm not noticing any differences between the two. Maybe telling the exact steps to do to reproduce the problem can help tell me what to look for. Thanks!

 

National Instruments
Applications Engineer
0 Kudos
Message 9 of 11
(5,214 Views)
Run the VI

select "Laura" from the control on the right by selecting from the dropdown menu

add an element to the array

on the gauge on the left select the element that you added

now try to select the new element on the right gauge

now stop the vi and run again and the gauge on the right has the correct value

then delete an array element and notice the dropdowns after stopping the vi a couple of times


Message Edited by James R on 04-07-2008 10:10 AM
- James

Using LV 2012 on Windows 7 64 bit
0 Kudos
Message 10 of 11
(5,204 Views)