Jump to content

.NET refnums: scope using tab control


Recommended Posts

Greetings,

On one tab I provide the user with two buttons: (1) Connect/disconnect a motion controller on another computer and (2) Manually jog an axis. On the second tab, the user clicks a button to run experiments, during which the motion axis is successively jogged: move, take some measurements, move, measure, ...

All the motion code resides in .NET DLL. To provide the 'connect' capability, I using a .NET constructor and invoke methods to connect up. If everything's cool, I use a .NET refnum to hold on to a reference to the DLL. To provide the 'jog' capability, I create a local variable that holds the .NET refnum; I can then use the local as the reference to the DLL and make use of the motion capability provided by the DLL.

Where I'm running into problems is on tab 2. Here I want to make use of the same motion capability 'jog' uses; therefore, I figured I'd create another local pointing to the .NET refnum (i.e. RMB the .NET refnum and choose 'Create local' from the popup menu) and paste that onto tab2. That way, I could use the motion system as part of an automated experiment. When I paste, however, I get another .NET refnum along with the local. I'm dazed and confused; could someone suggest the correct or a better way to accomplish my objective? I've tried moving the .NET refnum 'outside' the tab control...my lame attempt at widening the scope...but that was not successful.

I'd be tickled to provided any additional info that might be useful. I'm running Labview Express...I think that means 7.0...on a win2k box (hey, I'm just a contractor doing maintenance!). Using a DLL for the motion is mandated, but everything else is up for grabs. As always, thanks for your time in reading this.

Regards,

John K.

Link to comment

I'm not sure exactly what you're doing.

Tabs are UI objects. They should have nothing at all to do with how your code is structured. You should not need to place a .NET reference control on your front panel and using local variables for references is a recipe for troubles. Usually, you can transfer the reference using a shift register.

I suggest you read some basic LV tutorials to get started and look at the .NET examples in the example finder (Help>>Find Examples).

As for the answer to your specific question (I think) - you can copy a local by ctrl-dragging it.

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.