LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Code for the LV dotNet "NET Event Callback for DataWatcher.vi" example

Hi Dave,

Actually the documentation for .NET with LabVIEW is really good so you might start there. Refer to the topic
Using .NET with LabVIEW in the LabVIEW Help. There are also several shipping examples that you can review found under Help >> Find Examples; then browse to Communicating with External Applications >> .NET.

After reading through that material, if you start having specific questions, just call/email us or post on the forums with that question.

Best Regards,

Jonathan N.
National Instruments
0 Kudos
Message 11 of 13
(1,138 Views)

Dave,

I'm a little confused by the discussion as to exactly where the problem is...however, focusing on "What I am seeing now is that LabVIEW “sees” all of the Interface properties and methods, but no any of the other public properties and methods specific to, say CommandA, verse CommandB."

Think of To More Specific, etc as simple .NET cast operators. Thus if you have a variable of type ICommand, you can't see anything not defined in ICommand - same in LV and .NET.

For the most part, the same abilities and restrictions apply to both languages.

0 Kudos
Message 12 of 13
(1,132 Views)

Brian,

>I'm a little confused by the discussion as to exactly where the problem is...however, focusing on "What I am seeing now is that LabVIEW >“sees” all of the Interface properties and methods, but no any of the other public properties and methods specific to, say CommandA, >verse CommandB."

The problem is one of understanding - mine - on how LabVIEW treats the object from .NET. I think I have that pretty much under control now, however.

>Think of To More Specific, etc as simple .NET cast operators. Thus if you have a variable of type ICommand, you can't see anything not >defined in ICommand - same in LV and .NET.

Understood. However, I need to know which command "type" is passed into LabVIEW to act on it. In .NET or any other OO language, I would simply call one of the exposed methods in the command (using one of the exposed interface methods - e.g. "Execute"). However, since this command is passed into LabVIEW, I can't call a method of the "type" to invoke action in LabVIEW (I suppose I could in a round about way). So, the way I am handling command is to dynamically dermine the "type" and execute in a case structure.

It's hard to get the full picture of what I am doing. The overall project is complex, and I have it 99% running fine now. It's just the paradigm shift from a "text-based" environment to LabVIEW. With suggestions made here, reading through the help (Jonathan - I have been reading the help 🙂 and it is pretty good in the area of .NET), I've been able to overcome my initial roadblock. More than likely in time and experience with LabVIEW, I will find tune (read improve) the application.

0 Kudos
Message 13 of 13
(1,128 Views)