Jump to content

Programmatic References to XControl methods


Recommended Posts

I have developed a XControl that includes several internal methods. I would like to programmatically invoke these methods from outside the XCtl but I can't find a way to programmatically obtain an appropriate XCtl reference (i.e. one that allows access to these methods). Among other things, I have tried using the OpenG VI "Open VI Object Reference" which gives the correct reference but no access to the internal methods (probably cos it doesn't recognize XCtls as an allowable vi object class).

Any help or suggestions would be greatly appreciated.

Andrew

Link to comment

Andrew,

I don't see a problem on my machine (LV 8.0.1 on Win XP). I can right-click on the XControl's terminal and select Create Reference. I can wire that reference into a subVI. In that subVI, I can wire the reference terminal into an Invoke Node. I can click on that Invoke Node to see a list of methods. My custom XControl methods appear at the bottom of the list under a separator line.

Link to comment
I would like to programmatically invoke these methods from outside the XCtl but I can't find a way to programmatically obtain an appropriate XCtl reference (i.e. one that allows access to these methods).

Just to be sure, you're creating your custom methods for your XControl by right clicking on the XControl in the Project Explorer and choosing New > Method, correct?

Link to comment
Andrew,

I don't see a problem on my machine (LV 8.0.1 on Win XP). I can right-click on the XControl's terminal and select Create Reference. I can wire that reference into a subVI. In that subVI, I can wire the reference terminal into an Invoke Node. I can click on that Invoke Node to see a list of methods. My custom XControl methods appear at the bottom of the list under a separator line.

Joe,

Thanks for your suggestions. The steps you suggest also work for me however my problem is a little more complicated. To elaborate a little: I'm wanting to create and manipulate multiple instances of the same Xctl at run-time. I want to manipulate these Xctls by calling their internal methods (and properties) using a control references. I can instigate multiple XCtls just fine but referencing them after that hasn't been possible so far. Essentially, I need a programmatic way of "I can right-click on the XControl's terminal and select Create Reference".

Also using LV 8.0.1 on Win XP.

Thanks

Andrew

Just to be sure, you're creating your custom methods for your XControl by right clicking on the XControl in the Project Explorer and choosing New > Method, correct?

Yes.

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.