10-28-2012 10:14 PM
When calling the method "Save Instrument" from the main development context, the following works no prob:
Run this same code in the Project Provider context results in Error 1507 on the method. The workaround is to open an instance of the VI outside of the Project Provider Context, something like this:
When debugging this Error 1507, I kinda just reckoned that opening the VI in the project context would fix the problem -- and it did -- but I have no idea where this (learned?) intuition/hunch came from, or why exactly this fixes the problem. So, to formulate this into a few questions:
Thanks!
10-28-2012 11:07 PM
Remember to close all the references for the other application instance, if not you will be able to crash LabVIEW very easy.
I managed to crash LabVIEW 10 times yesterday, when working on my Project Provider.
Also remember that when you add/change something to a project, this might trigger another call to a Provider VI, and if you don't wait until this call is finished you will kill LabVIEW.
So maybe you application works fine, and then someone installed e.g. GDS, that gets called when your code is running, suddenly LabVIEW starts to crash.
My solution is to add lot of waits here and there in my code. 150ms is currently my value and it has been scientifically calculated of course, I could go through the math but I guess it might be too complicated so you just have to trust me.
Keep wiring the labs.
BTW I thought of you when I saw this image:
Cheers,
Mike
10-29-2012 01:41 AM
<unclosed refs> *blush*
+1 for the code review, and another +1 if I could for the cartoon
Finally, I've not gotten into a scenario where a Provider VI crashes during simultaneous calls -- but will look out for this.
10-29-2012 01:44 AM
Jack,
we found out the same in Application Builder Support; some builds could only be completed if they were run in the project context.
There were no crash but LabVIEW would just hang, and we had to force quit.
Mikael; sounds like your memory is getting very short... 😉
"...Remember to close all the references for the other application instance, if not you will be able to crash LabVIEW very easy.
I managed to crash LabVIEW 10 times yesterday..."
/J
10-29-2012 01:55 AM
Mellroth wrote:
we found out the same in Application Builder Support; some builds could only be completed if they were run in the project context.
If I might ask, how are you invoking the Build Specs? I have used "C:\Program Files (x86)\National Instruments\LabVIEW 2012\vi.lib\AppBuilder\AB_API_Simple\Build (project reference).vi" to invoke build specs (a few different kinds) with no prob (so far!) running in the Project Provider context; should I potentially watch out for hangs?
Oh, and for both Mike and Jonas -- I'm working in LV2012 right now, so it's *possible* that some of the issues you describe are now fixed and no longer problems.
10-29-2012 02:06 AM
We mainly used <LabVIEW>\vi.lib\AppBuilder\AB_API_Simple\Build.vi, the one you mention does not exist in my versions of LabVIEW (pre-2012).
If I remember correctly the FPGA builds were the ones causing us problem.
/J
10-29-2012 02:18 AM
Mellroth wrote:
We mainly used <LabVIEW>\vi.lib\AppBuilder\AB_API_Simple\Build.vi, the one you mention does not exist in my versions of LabVIEW (pre-2012).
If I remember correctly the FPGA builds were the ones causing us problem.
Good info, thanks -- if it's FPGA build acting up, I can defer this potential pitfall a little while longer... (I have built EXE, Installer, and Source Distribution with no problems)