Showing results for 
Search instead for 
Did you mean: 

Show dialog from .NET assembly?

I'm just diving into the LabView demo to see what it is capable of. In particular, I am wondering if LabView is capable of allowing me to write simple test applications that exercise methods in my .NET interface, which is used to control various kinds of hardware. After floundering about on the net, I've been able to figure out how to piece together a VI that seems to be syntactically correct. I have a factory class with a method called GetInstance that returns an interface for the hardware that I want to control. Via this interface, I am able to call Initialize. Then I call my Diagnostics method, which should display a modal dialog on the screen. The problem is, even though it looks like the method is called as I single-step through my VI, nothing appears. Can anyone tell me if this is even possible in LabView? Thanks!
0 Kudos
Message 1 of 7
Have you wired your error in and error out terminals together sequentially, with an indicator at the end of the chain to see if an error occurs? Is there any error from any of the .NET functions? Have you connected a debugger to your .NET assembly while it's running in LabVIEW to confirm that the functions execute? Can you share your LabVIEW code?
0 Kudos
Message 2 of 7
I haven't tried using the error outputs yet, but I will give that a try next. Thanks! What do I need to do to share my labview code -- just attach the .VI?
0 Kudos
Message 3 of 7

Yes, you can attach your VI. In some cases it may be more convenient to post a "snippet" - a PNG image with embedded LabVIEW code - which you can create by selecting all or a portion of the block diagram, then selecting Create Snippet from the Edit menu. That allows a forum user to see your code without opening LabVIEW (or if they don't have at least as new a version as you), but doesn't work well when there are subVIs.


Did you have any luck finding the problem?

0 Kudos
Message 4 of 7
What I did this time was connect multiple error-outs to a merge error block, then send its output to a simple error VI. I set the dialog type to OK and attached a message readout to the message output. I didn't get any errors.
0 Kudos
Message 5 of 7

It's easier to chain the error wires than merge them (the error out from one node connects to the error in of the following node). This is also a common way to dictate execution order in LabVIEW. Most (but not all) functions that accept an error input do nothing when an error is present on the input; the exceptions are generally functions that you would want to execute even if there's an error, such as functions that dispose of resources.


That said, were you able to solve the problem? If not, can you put a debugger on the .NET assembly while it's being called from LabVIEW? Can you share your LabVIEW code? Do you have working example code in another language that we can compare to your LabVIEW code?

0 Kudos
Message 6 of 7
Whoops, forgot to try to debug the assembly. If that doesn't tell me what's going on, I'll post up my VI and the assembly and its dependencies. Thanks!
0 Kudos
Message 7 of 7