Jump to content

XControl & .NET Framework


Recommended Posts

Hi together.

I am currently developing a main application standard for testmachines.

It would be nice to have a XControl with a main menu, logo and some general functions implemented. I have planned

to use this XControl as a standard for each application. So if i want to develop a new test bench, i would drop the XControl into

a blank VI and I will have the main menu (which can be modified by properties) at the right side, the logo at the top and

some properties and methods to save or read parameters from file or network or something like this.

1. Problem:

Implementing .NET Components into XControls.

The .NET Framework has great components, which I want to use for the main menu. I think about the

menu in the Windows Setting Folder. (see atached jpg-file)

Ok, so in a single VI, this all is working fine (VI_works.vi - as an example with a simple progressbar) but if I want to implement the functionality into a XControl I will get an error "Cannot pass a GCHandle across a AppDomain" (VI_doesntworks.vi). Any other .NET Component (also non-Microsoft Components) doesn

Link to comment
Hi together.

I am currently developing a main application standard for testmachines.

It would be nice to have a XControl with a main menu, logo and some general functions implemented. I have planned

to use this XControl as a standard for each application. So if i want to develop a new test bench, i would drop the XControl into

a blank VI and I will have the main menu (which can be modified by properties) at the right side, the logo at the top and

some properties and methods to save or read parameters from file or network or something like this.

1. Problem:

Implementing .NET Components into XControls.

The .NET Framework has great components, which I want to use for the main menu. I think about the

menu in the Windows Setting Folder. (see atached jpg-file)

Ok, so in a single VI, this all is working fine (VI_works.vi - as an example with a simple progressbar) but if I want to implement the functionality into a XControl I will get an error "Cannot pass a GCHandle across a AppDomain" (VI_doesntworks.vi). Any other .NET Component (also non-Microsoft Components) doesn

Link to comment
It sounds like you want a VI template rather than a XControl. These are easy to create. Simply create a VI that has all the generic functionality you want, then rename or save the file with a .vit extension. It also lets you get around your ".net control inside a xcontrol" issue. I use a VIT to provide myself and my group with a standard place to start off an application. We include our state machine layout and standard set of states, prepopulated with our own particular setup.

I know that professional applications have been built in LabView, mostly because I consider what I create to be professional applications (note: professional does not have to mean perfect). But if you want to move beyond "my" work, you can look at LabView itself, which has several major pieces written in G. You could also check out VIPM which is IMO a professional application written entierly in LabView (8.0.1 if I'm not mistaken).

Hi!

First, thanks for your answers!

Yes i thougt about the option to do this with a VI template. But i want to outsource the code into a xcontrol. If i do that with a VI template, the user of my visualization standard will see the wireing and coding. This could be hidden with an XControl.

I know the VIPM and it

Link to comment

I didn't understand what you were trying to do, thanks for the picture. It sounds like you can't use a .net component in an XControl in LV8. IF you don't want to upgrade and have access to OpenG Tools you might take a look at some of the buttons there, specifically the "Load" button, its similar to the "New" and "Open" buttons in the LV 7 and 7.1 start up screen. These buttons have a menu associated with them. In LV 8 you also (finally) have access to the right click menu on controls, you might consider using that. If all else fails, you can always do what you want with the most underutilized LV control, the picture control.

Your choice of programming languages is just that, your choice. In this case you will have to weigh the options, since you haven't told us all that you are trying to accomplish.

Good Luck.

Link to comment
It sounds like you can't use a .net component in an XControl in LV8.

You can't use a .Net refnum as the data type of the XControl, nor pass such refnums to/from the host VI through Properties of the XControl. Using .Net functionality purely internal to the implementation of the XControl should work fine. If you can't get that to work, I suggest posting to ni.com to get feedback from some of the .Net folks -- neither XControls nor .Net are my typical domain.

Link to comment
:question: How do you build large applications with a userfriendly and ergonomic interface which can be used as a template?

:question: Am I on the wrong track or what do you think?

Thanks, and have a nice day!

Joachim

Template at run or edit time? At runtime you can use .vit and at edit time just a simple VI that you save somewhere and copy/rename when you start a new app

Link to comment
Template at run or edit time? At runtime you can use .vit and at edit time just a simple VI that you save somewhere and copy/rename when you start a new app

Template at edit time. It would be a posible way to copy/rename a VI when I start a new app.

I want to build a complex template, which includes many functions and layout settings.

Thats the reason that I want to outsource the code into a XControl. All the wireing and coding would be hidden, and other programmers will have

a easy template for building apps.

Link to comment
Template at edit time. It would be a posible way to copy/rename a VI when I start a new app.

I want to build a complex template, which includes many functions and layout settings.

Thats the reason that I want to outsource the code into a XControl. All the wireing and coding would be hidden, and other programmers will have

a easy template for building apps.

Maybe some sub-panels with VI's where the BD is removed?

Or use a good framework with sub-vis where the more advanced stuff is done.

Ton

Link to comment
Template at edit time. It would be a posible way to copy/rename a VI when I start a new app.

I want to build a complex template, which includes many functions and layout settings.

Thats the reason that I want to outsource the code into a XControl. All the wireing and coding would be hidden, and other programmers will have

a easy template for building apps.

I have built a template "copier" in the past. My template was a hierarchy of VIs with type defs and ...

It renamed everything to what i wanted using tags...

I beleive there is something similar built in know in 8.0 called source distribution...

Link to comment

Hi PJM_Labview

Wow, your example is realy fancy, compliment! Very very nice work. :D

For my luck you have down convertet to LV 8.01.

Thank you for the example.

As soon as I have time, I will try to enhance the picture control.

Is any one intrested in building a little framework?

I think this navigation control would give every application a very professional and userfriendly style.

Greets Joachim

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.