John Kelly Posted July 11, 2007 Report Share Posted July 11, 2007 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. Quote Link to comment
Yair Posted July 12, 2007 Report Share Posted July 12, 2007 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. Quote Link to comment
John Kelly Posted July 13, 2007 Author Report Share Posted July 13, 2007 Hi Ven, Thanks for your suggestions. I freely admit I'm a newbie when it comes to Labview and will try things that don't make sense. I've been working through some of the LV examples supplied with the development system; still a lot to learn. Regards, John 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.