05-17-2012 02:17 AM - edited 05-17-2012 02:17 AM
Is possible to program a VI from some type of file automatically? (.CSV for example).
The general purpose is to import information from electrical schematics.
Is there any better method for this purpose?
Is possible to create programming objects automatically within a vi from a file?
Vi can be created from another VI automatically by importing a file?
I attached a sample diagram image.
Thanks.
Solved! Go to Solution.
05-17-2012 02:52 AM
05-17-2012 05:15 AM
Thanks, I'll try to create controls dynamically in this way:
05-17-2012 08:12 AM
In post #12 of this thread I commented on the Idea of creating controls on the fly
(Artwork courtesy of Christian Altenbach)
And include a link to where I posted this code
Which was part of a community project to help us manage emoticons for use in posting to this site (I still use this on my home machine).
As it stands now it will read in a set of images as defined by a configurtion file and populate the Picture Control with images of the emoticons. If you click on any of them, it will figure out what emoticon you clicked and copy the URL of the emoticon into you clipboard so you can paste it into the dialog for inserting images on this forum.
So it has the following abilities;
File driven set of images
Asssociation of image with info
Abilisty to import new
Automatically fits the controls to the picture.
Now don't dismiss this off-hand because it uses emoticons. The image can be anything you want. Using the image you get from an "invoke node >>>Get image" will work fine and can save you a lot of work since you do not have to code up the functionality of the control.
Now if you can limit the types of controls to a fixed set you can get another advantage to help you "make the controls work" by doing the following.
1) Mouse down picture .... find associated control type
2) Use off-screen hidden control of that type and move it to where the image is in the picture (over top of the picture) and make it visable and give it key focus.
3) Let user interact with the real LV control that is over-top of the image.
4) On enter or mouse leave of the control, get the new image, stuf it in the picture... hide the control that was previously hidden.
I can not leave this topic without again saying that "Controls on the Fly" application carry a large development effort to get them to work correctly.
Here is an image of one of my extreme versions of Controls on the Fly developed explicitly for touch panle interfaces (there are two shown, in this image)
Have fun!
Ben
05-17-2012 08:29 AM
Re:
What I should have mentioned is the above was developed using LVOOP so I can add new controls to the application "On the Fly" by adding additional LVOOP objects to the folder where the exe lives.
I suggest anyone else approaching a challenge like this seriously concider using LVOOP since there are many shared opeartions for controls that can be realized by inheriting from the parent class.
Ben
Ben