08-10-2005 05:56 AM
08-10-2005 06:47 AM
08-10-2005 07:11 AM
Both the application builder and the save for previous option only save the VIs which are explicitly called.
If you call a VI dynamically, you need to include it in the build in the source files tab of the app builder.
For the save for previous, you need to open and save each dynamically called VI seperately. You can save all of them into a single LLB, but it will take a few steps.
LLBs are good for passing complete applications from one place to another. They are not good if you want to have functions which will be used by many programs and are subject to change.
You should note that when you build an EXE, the EXE is actually an LLB with all your files inside it, so if you had a VI in c:\bar.vi it will now be c:\foo.exe\bar.vi (for example). This means that if you rely on the VI path to get the other VI path, you need to do an extra strip path when running an EXE. You can check for it using the Application.Kind property. You can also download the OpenG File VIs which also do this.
10-24-2006 01:12 PM
Hi Kimjansen,
I seem to have a similar situation as this post and I am not sure if I understand how you have solved the problem. Here is my scenario:
I have a main VI which calls a subVI based on an event (button click). The subVI is configured such that it opens its FP when called and closed afterwards.
I am unable to pass data continuously from my main VI to the subVI. I have to use event based structure because my program demands that. I have attached a simulated version of my code. I'd appreciate your response.
Thanks in advance
KM
10-24-2006 02:04 PM - edited 10-24-2006 02:04 PM
Using a local variable is incorrect. The value of the local is set when you first call the subVI and since a local variable doesn't exist outside of the VI (hence the term 'local'), the subVI cannot keep reading it as it changes. You could instead write to a GLOBAL variable and have the subVI read that. You could also write to a control in the main VI and pass a reference of it to the subVI. The subVI would then do a Value property read. In the subVI, you also need to do the read with the variable/reference inside of the timeout event. Putting it outside means that the subVI will read it once and then will not update anymore. The image shows a regular LabVIEW global variable but it's probably better to use a LV2 style functional global as it's called. Do a search for taht and you'll find some complete explanations but it's basically a regular VI with an unitialized shift register.
Message Edited by Dennis Knutson on 10-24-2006 01:05 PM
10-24-2006 03:55 PM
Dennis,
Thank you for the quick response. I guess I should have explained my application in more detail. I tried with the Globals before posting. Here is my actual scenario:
I am continuously reading and parsing data via TCP/IP in my Main VI. I have a subVI which is event driven to configure settings. This subVI opens its FP when the "Configure" button sees a value change. There are several configuration settings in my Configure VI, which are event driven. I'd like to pass the TCP read data from the Main VI to the Configure VI continously. It works fine if I don't open my SubVI. But if I open it, then the data doesn't get updated on my SubVI.
I have attached my code. It is very messy right now as I am still in the development stages.
I'd appreciate any advise. Thanks
10-24-2006 04:36 PM
10-24-2006 06:15 PM
10-24-2006 10:05 PM
10-25-2006 12:59 PM
Hi Dennis,
Thank you for being so responsive. I guess I am not explaning my situation the best way. i totally understand your recommendations, but that is not meeting the requirements. I have re-posed the "simple" code again with some modifications.
My question: How do I pass the current value from A (in the test main.vi) to B2 (in the test sub.vi)? The test sub.vi is configured to open its FP when called and close afterwards.
Thank you in advance
km