Polymorphic VIs and executables
I have recently created a polymorhic VI for a project. Now when I tried to convert it to an executable I was told by LabVIEW that "You cannot include a polymorphic VI in the Startup VIs or Dynamic VIs and Support Files listboxes." and the help file stated that "Use an instance of the polymorphic VI instead."
What does "Use an instance of the polymorphic VI instead." mean? Can anyone translate it into a simple langusge that may be understandable by me?
I'll be grateful!
Have a nice weekend!
Hi C.DOT,
every polymorphic vi consists of different vi´s. You can´t use the real polymorphic vi, because it only describes which other vi´s are part of it. You can only use instance (the "subvi´s" from the polymorphic vi) in your program. If you don´t wanna start your program with the polymorphic vi and don´t want to load it dynamically, then you don´t need to think about it while creating an executable.
Hope it helps.
Mike
Similar Messages
-
Project libraries, polymorphic VIs, and access scope
I'm trying to be good and arrange all my VIs appropriately in project
libraries*, marking each VI as public or private as I go. But I have
found that, when a polymorphic VI is called from outside a project
library, LabVIEW uses the access scope (public/private) from the
instance VI, not the polymorphic VI. It seems that the scope for the
polymorphic VI is simply ignored; you can even call a private
polymorphic VI, as long as the instance VI is public. I assume this has
something to do with how the actual instances are dropped on the
diagram via the polymorphic VI. Is this the intended behavior? It just
doesn't seem like the way things should be, at least not in my head.
The attached example contains a project library (Case Lib.lvlib) with three VIs:
Poly (private)
Case DBL (public)
Case I32 (private)
There
is also a Use Case DBL VI that calls Case DBL via Poly and a Use Case
I32 VI that calls Case I32 via Poly. Use Case DBL runs fine. Use Case
I32 has a broken arrow.
Originally, I had made a library with a
public polymorphic VI and private instances, because that's what makes
intuitive sense to me. Calling the polymorphic VI from another VI
didn't work because the instances were private.
(Cross-posted from LAVA.)Good observations, these are all issues we are working on addressing in future versions of LabVIEW. Ultimately the behavior we are going for is having the library scope checking be on the poly VI and not the instances, but I can't say at this point in which version of LabVIEW you would be able to see this changes. Thank you for the feedback.
-
How can i include Polymorphic VIs while building an executable?
Hi,
am trying include polymorphic Vis while building a stand alone application. It is giving me error. If i use instances of the polymorphic VI instead of using it as library, i am able to build application. is there any way to use the library directly in the process of building stand alone application. Am using LabVIEW 8.0
Thanks
AnilWhat are the errors that you are getting? Polymorphic VIs should have no problem in a built application - it would be a major issue if they did because NI makes extensive use of polymorphic VIs in their driver code.
Mike...
Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion
"... after all, He's not a tame lion..."
Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps -
Building Application Without Distributing Polymorphic VIs
Hi all,
We're currently deploying several LabVIEW applications that use polymorphic VIs. I have no problem building these applications (apart from one known issue with LV8.6.1 and a bad dsoffset error - so we use LV2010 for that app).
My issue arises with the deployment of these systems. At present, the polymorhpic VIs are copied to relevant subdirectories and deployed as they stand. To my mind, this is messy. It would be better if they were packaged inside the executable.
I'm sure one of the Application Builder controls allows this, but it's not obvious how to do it. The manuals don't seem to tell me much more than the online help, either.
Any tips?
Regards,
Geoff
Geoff Field, BE, CLAD, MIEAust
Professional geek, amateur stage-levelling gauge
Solved!
Go to Solution.Thanks Tst.
Of course! It was the compatibility mode flag.
Mike: The clue was that I was working mostly in LV8.6. When using Application Builder with LV 8.6, any polymorphic VIs are packaged separately to the EXE file, as extra files in subdirectories under the EXE's directory. Thus, you might have:
EXE
Module1
Polymorphic VI1
Polymorphic VI2
Module2
Polymorphic VI1
Polymorphic VI2
etc.
Under LV2010, of course, the EXE packaging deals with polymorphic VIs a lot more cleanly.
Regards,
Geoff
Geoff Field, BE, CLAD, MIEAust
Professional geek, amateur stage-levelling gauge -
LV 8.2 won't associate with VIs and uses 7.1 RTE?!?!
Hi,
I'm in the process of creating a new exe of our project. A strange thing keeps happening and I don't know what's wrong. I had LV 7.1 installed on the machine, as well as LV 8.2 to transition to the new version. I created an .lvproj and built a new .exe of our application. Lo and behold, it flashes the LV 7.1 flash screen and then asks me to select the VI I want to run, when i select the main VI of the application, it simply gives me an Error 9 message and says that that vi is compiled in version 8.2 of LV and won't open. I tried right-clicking on a vi and trying to force it to associate with 8.2, that didn't work. I uninstalled 7.1 and the 7.1 RTE entirely and when I try to run my LV 8.2 built exe it STILL manages to use the 7.1 run time from somewhere.
After that I tried to re-associate them with 8.2 yet again to no avail. When i run my exe it just tries to open them in the non-existing 7.1 RTE and re-associates them all with 7.1. Please help, i think this is a bug.Justin,
Thanks for the reply. I do understand how bizzare this must seem to you, I had the same reaction. I know perfectly well the behavior of LV built exe, been using it for 5 years. The problem here is the bizzare behavior of the .exe (any in fact, i've built several test vis and exes) on 3 different machines.
I'll try to explain what's happening:
1) I create a new project
2) I add my Test.vi to the project
3) I set my Test.vi as the startup vi (Test.vi simply calls my main vi via the vi reference).
4) I build the exe and execute it
5) Upon execution, an LV 7.1 splash screen pops up for a brief second and I get an Open VI file dialog box asking me to select a VI I want to open, all the VI files inside that window take on the appearance of LV7.1 icons, instead of 8.2. If I try to select a VI from that window, I get LabView load error 9: VI version (8.2) is newer than LabView version (7.1).
I'm used to that error after you recompile a 7.1 vi to 8.2, but I don't even have LV7.1 installed. It seems like the exe is trying to use LV7.1 RTE to run itself instead of 8.2. I though I have 8.2 RTE automatically installed by LV Dev, but I guess not since it doesn't show in Add/Remove Programs menu, but it DOES show up in MAX under software, go figure. I wish I could get someone in NI to look into this. I've never had a problem like this, it is happening on 3 PCs here and is taking up a lot of work time. I have source code I can send as well as a short video of what's happening on my machine. -
How is it possible to get list of VIs from executable?
Hi!
Simple question.
I have executable (builded with LabVIEW, of course).
In LabVIEW 8.0.1 - based application I able to get list of VI inside of executable (with ..\LabVIEW 8.x\vi.lib\Utility\libraryn.llb\Get VI Library.vi)
But if application was builded with LabVIEW 8.2 it seems to be impossible, because error 13 occurred (file is not a resource file).
How is it possible to get list of all VIs from executable which was generated with LabVIEW 8.2?
I do not prefer to build application with llb.
Theoretically I can "convert" exe to llb, and then get list of VIs, but this is "undocumented" way and not preferred.
Any other (better) ideas how to do this?
best regards,
Andrey.Hi Andrey;
Just happened to be browsing for a different problem, but an alternative method (assuming I understood the question correctly) may be to use the "List Folder" vi to create a list of all VIs contained within your .exe application. From this list, you could further use a "Match Pattern" vi to do further sorting.
For example, if any constructed VIs contained the phrase "SubVI" within the file name, use "Current VI Path" followed by a single "Strip Path" (to eliminate the active VI name), use a "List Folder" to extract the vi names contained within the .exe, and match pattern for something like "*SubVI.vi" to get a listing of all VIs with the phrase "SubVI.vi" in the file name.
Hope it helps.
DJH -
Use buffering and psp with datasocket-VIs and without any binding and shared variable node
Hello,
I'm using LV 8.5.
I'm trying to develop a multiplatform (windows and mac os x) and multi-computer application. II want to get executables running on each device, communicating through the network. Communication process includes datas (such as images) and events messages (something like "Hello, I got an error" or "youyou, my work is done" or "I'm hereeeee!!!!...."). I do need a communication without any loss of data.
I worked a lot and wanted to test a psp-based design, without any binding nor shared variable node (mac os...) using data socket VIs and SVE buffering.
I managed to :
- deploy shared variable library dynamically (even in an executable)
- communicate between two PCs with datasocket VIs
However, I never managed to enjoy buffering (even locally with one VI doing the deployment and writing datas and another one for reading).
I worked hard (dynamic buffering setting, dynamic buffering watching like in http://zone.ni.com/reference/en-XX/help/371361D-01/lvconcepts/buffering_data/ and in the example "DS send image" and "DS receive image" in the labview examples, trying to use "?sync=true" in the URL, etc...) but no way to get things work.
I attached a jpeg of an example of receiver and sender. I use wait commands in both receiver and sender to test buffering
Receiver do receive datas (the last written) but buffering doesn't work.
Did somebody did that before ? (better than me...)
Thanks
Bo
Attachments:
Sender.JPG 87 KB
Receiver.JPG 96 KBHello,
Indeed my problem has been solved. My error : in the While loop of the receiver VI, I always reactualize the PacketsMaxBuffer and OctetsMawBuffer parameters, what resets the buffer and make it appears ineffective.
I now set the PacketsMaxBuffer and OctetsMawBuffer values only once at the begining of the VI and the psp buffering works perfectly.
Sorry for the desagreement...
Bo -
Thanks !
Kudos always welcome for helpful postsRe: I have a VI A. I want A to call another VI B and execute. After B executes, I want it to close automatically and go back to A. Is this possible ? I tried using open reference and those methods, but I am not able to do it. Can someone help me ? Thanks !Hi Stephan ! Thanks ! I guess I explained my question not so right. I've created a customized menu and at the instance of me selecting a menu, a VI should load itself dynamically. I am using call by reference. Sometimes it works and sometimes it won't. In short, what I want to achieve is load VIs dynamically and close them dynamically once they finish executing. Thanks !
Kudos always welcome for helpful posts -
Question regarding Polymorphic VIs
Let's use Read Key as an example (from the Configuration File VIs).
I want to wrap Read Key (which is Polymorphic) so that some other code always runs right before Read Key. However, to do this, it seems I have to make an instance of the wrapper VI for each output type that Read Key supports if I want it to support all the types. This is disappointing since in C++ or Java you'd just use a template or generic and you wouldn't need to do all this extra work. Is there a way around this when working with Polymorphic VIs?
The alternative is to always remember to put this code right before Read Key. Another less than optimal solution. If I want tightly connected and cohesive code, I want one VI and not a half dozen of them!
Anyways, this is almost certainly not possible so I guess this is more of a complaint haha.
Solved!
Go to Solution.Vote up this idea in the LabVIEW Idea Exchange:http://forums.ni.com/t5/LabVIEW-Idea-Exchange/Provide-a-better-way-to-implement-a-polymorphic-VI/idi...
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines -
Is there such thing as a "compile and execute statement" in Java?
I wanted to know if there's any way to compile and execute a program "within" another program.
Yes, but the classes to do so aren't officially supported by Sun as far as I know.
And you must be able to assume a thing or two about the stuff you compile, such as existing constructors or factory methods etc, otherwise it gets hairy.
Here's some example code (haven't tried it, so excuse any spelling errors etc) to compile the source code in a file called MyClass.java:
ByteArrayOutputStream baos = new ByteArrayOutputStream();
new sun.tools.javac.Main(baos,null).compile("MyClass.java");
String theMsg = baos.toString();
if (theMsg.length() > 0)
// NiftyErrorHandlingHere
}After that, you can load it with a simple ClassLoader.loadClass() call and create instances of it.
It must be compiled with the tools.jar file in the classpath, to find the sun.tools.javac.Main class.
However, for any such dynamically compiled class to be of any use to you, you must be able to assume something about it, such as implementing interfaces or whatever, otherwise it's a kind of pointless exercise.
HTH,
F -
Problem with MS Access Files and executable files migrateds
Hi all.
We are migrating an old Netware 6.0 server to new SLES 10 SP3 with OES 2 SP2a. I already migrated one volume and in this weekend well migrate the last, and most important, volume to new OES 2 server.
The problem is about some MS Access databases that are very very used for all users and some executable applications that was writed using fisical path like \\OLDSERVER\VOL\PATH\APP.EXE or some links to libraries, databases, images, etc.
The old NW 6.0 server will be removed from the tree in 2 or 3 weeks and in this time the two servers will co-exists. I want to know if it is possible redirect NCP requests to OLDSERVER to NEWSERVER without users rewrite all of MS Access and executable applications. Is it possible?
Tks
Alan Cota.AlanCota wrote:
>
> Hi all.
>
> We are migrating an old Netware 6.0 server to new SLES 10 SP3 with OES
> 2 SP2a. I already migrated one volume and in this weekend we´ll migrate
> the last, and most important, volume to new OES 2 server.
>
> The problem is about some MS Access databases that are very very used
> for all users and some executable applications that was writed using
> fisical path like \\OLDSERVER\VOL\PATH\APP.EXE or some links to
> libraries, databases, images, etc.
>
> The old NW 6.0 server will be removed from the tree in 2 or 3 weeks and
> in this time the two servers will co-exists. I want to know if it is
> possible redirect NCP requests to OLDSERVER to NEWSERVER without users
> rewrite all of MS Access and executable applications. Is it possible?
>
> Tks
>
> Alan Cota.
>
>
Have you considered trying to use a dns alias to it. I have not tested with
MS access specifically but many other apps it works perfectly for. This is
how I get around those issues. Of course your issue is that you still
havethe existing server in the tree. How much will there still be on the
old server. You could rename the old nw server and than update its info in
dns to resolve this. -
hello
I have problem with regist my visa and I cannot buy from store
the message came in the end of form is says
the phone number must be a 7-digit number
and I have writed but not accepted
iam from saudi arabia
my mobile is 966504850992
pls answer
thanks
dfr aldossaryWow, Karan Taneja, you've just embarrassed yourself on a worldwide support forum. Not only is your post ridiculous and completely inappropriate for a technical support forum, but it also shows your ignorance as to whom you think the audience is. Apple is not here. It's users, like you.
If you would have spent half the time actually reading the Terms of Use of this forum that YOU agreed to by signing up to post, as you did composing that usesless, inappropriate post, you (and the rest of us on this forum) would have been much better off. -
How to create and execute PL/SQL program or Procedure from Java (JDBC)
hi all,
user will enter the Pl/Sql program from User-Interface. that program has to be create in DB and execute that.
due to some confusions, how to execute this from Java, i (user) entered the same logic through a Procedure.
my Java code is
Statement st = con.createStatement();
Statement.execute(procedure_query); // procedure name is myPro
CallableStatement cs = con.prepareCall("{call myPro}");
(as given in SUN docs - http://java.sun.com/docs/books/tutorial/jdbc/basics/sql.html)
but its not creating the procedure.
and i tried to run a procedure (which is already created) with CallableStatement, and this is also not working.
how to get this.
thanks and regards
pavanHi,
SInce the PL/SQL block is keyed in dynamically, you probably want to use the anonymous PL/SQL syntax for invoking it:
// begin ? := func (?, ?); end; -- a result is returned to a variable
CallableStatement cstmt3 =
conn.prepareCall(“begin ? := func3(?, ?); end;”);
// begin proc(?, ?); end; -- Does not return a result
CallableStatement cstmt4 =
Conn.prepareCall(“begin proc4(?, ?); end;”);
SQLJ covered in chapter 10, 11, and 12 of my book furnish a more versatile dynamic SQl or PL/SQL mechanisms.
Kuassi
- blog http://db360.blogspot.com/
- book http://db360.blogspot.com/2006/08/oracle-database-programming-using-java_01.html -
Whats the difference between VISA and GPIB?
The reason i am asking this question stems from a problem i am having.
I am using an MXA N9020A to aquire Burst Power measurements and i'm using labview to automate and issue the commands. If i connect to the device using VISA (which is how i pretty much have connected to other devices) and i issue a command :INIT:TXP it will start the burst power and then freeze the measurement disallowing me from changing channels to measure other channels' burst power. If i use the GPIB VI instead it will not do this and I am capable of channel hopping to measure other channel powers. I really dont have a reason to use VISA other than to keep it uniform with everything else in the application but why is this?Hi Brent,
Thank you for your quick response. This should not be happening, as the VISA VIs merely make calls to the NI-488.2 DLLs. Which version of NI-VISA and NI-488.2 are you using? Could you also attach both of your VIs (the 488.2 one that works and the NI-VISA one that doesn't)? Also please perform one NI-Spy capture for each VI, and attach the two resulting screen shots. If you need assistance performing the NI-Spy capture, you can find more details here.
Regards,
Todd V.
National Instruments
Applications Engineer
NI Prototyping Community -
How can i disable a submit button and execute submit_action method on click
Good Day,
On my page I have a submit button that execute the submit_action method of the page backing bean that submit data captured on the page into a database and activate another class that send mail at the same time on a click of the submit button,the mail process takes a while before returning back to the page.I was able to disable the submit button to prevent the user from keep click while the process is running but the issue is on clicking the submit button it only disable the submit button without executing the submit_action method of the page backing bean.How can i disable the submit button and execute submit_method of the backing bean at the same time.
Thanks in advance.I tried this out on one of my pages to see if it works.
First, I added the following JavaScript to my submit button's onClick event:
this.disabled=true; return true;When I clicked the submit button, it was disabled but the form was not submitted.
I deleted the JavaScript from the onClick event and added the following JavaScript to the form's onSubmit event:
var button = document.getElementById("form1:submitButton"); button.disabled=true; return true;When I click the submit button, it was disabled and the form was submitted but the button's action method was not called.
The next thing I tried was to change the onSubmit event code:
var button = document.getElementById("form1:submitButton"); setTimeout("button.disabled=true", 500); return true;This seemed to work. The difference was that I added a 1/2 second delay before disabling the button.
See if that works for you. If not then I'm fresh out of ideas.
Maybe you are looking for
-
My Ipod Nano 6th generation is no longer recognized by iTunes & my computer. I did all troubleshooting steps. After checking for changes and reinstalling legacy software in device manager I keep getting an error 10 message (device can't start). My de
-
Can't get iTunes to open - rage building!!!!!
I just got an iPod and connected it to my pc. Connected to iTunes and it appeared to be downloading the songs. it said it was done and it could be disconnected. So I did. Then I got a Do not disconnect warning and now, when ever i try to open itunes,
-
Let's say I have a bunch of open windows on my desktop, and they're all overlapping each other. When I use Expose's F9 to show all windows, it takes every open window on my desktop and arranges them so I can see them all at once. But it's just an ill
-
Console Upgrade addon for Rev52.1 customers
HANA One team is happy to announce new addon "Console Upgrade" for Rev52.1 customers. Features: New Console changes for better usability (screenshots provided below) Console Upgrade will enable future releases of HANA License update. Packages support
-
Adobe Illustrator CS4 No enough memory
i have problem in opened large pdf file in illustrator cs4, process with edit/modify and save. but the system hang when save the file. The operation cannot complete because there isn't enough memory(RAM) available. and the program quit. System spec.