04-08-2010 06:58 AM
This is LV2009 with no patches or updates. I am calling buffer.vi by static reference with an invoke node set to Run VI. I don't have an incredibly good reason for doing this, but just don't want that code on the block diagram. I hate to put alot of effort into this since I can just drop the code on the main diagram and I'm sure it will work, but I don't understand why it gives me the error 1000: VI not in a state compatible with this operation?
In the EXE, when I check the execution state of the buffer.vi before I tell it to run, it comes up bad. Same code in the VI, comes up idle. I also tried replacing the static VI reference with an open VI reference using the name of the buffer and received the same error. I have the buffer VI included in the build under always included.
Solved! Go to Solution.
04-08-2010 07:38 AM
Please post some images at least.
04-08-2010 08:32 AM
You did not compile the vi to be in the EXE, did you?
If not, the VI includes subvis. So this is expected behavior.
The Runtime Engine is not capable to dynamically load the hierarchy from modules not part of the EXE. So you have to prepare the module to be executable in the runtime even without being part of the EXE. You can achieve this by creating a Source Distribution (doesn't matter if you select LLB or not....) from your VI.
hope this helps,
Norbert
04-08-2010 09:03 AM - edited 04-08-2010 09:04 AM
"You did not compile the vi to be in the EXE, did you?"
I'm not sure what you mean. I have included buffer.vi and all of its sub VIs in the build as Always Included. I am investigating creating a source distribution. Never done that before. I will let you know if it works.
I attached snippets of the caller and buffer.vi itself. I was playing around with the caller, trying to abort if running and such...
Edit: Sorry if its confusing, what I'm calling buffer.vi is actually Waveform FIFO AE.vi
04-08-2010 09:20 AM
I put buffer.vi and its subs into Always Included in a Source Distribution. I then rebuilt the EXE (not sure if this was necessary) with no change. I then removed buffer.vi and its subs from the EXE build, rebuilt, still no change.
I don't see any place to tell the EXE to use the Source Distribution. Am I missing something, or is it automagical?
04-08-2010 09:23 AM
If you want to include buffer.vi in the EXE and it is not linked statically (as a static subvi), you have to add buffer.vi to the "Always Include" part of the source files.
Additionally, it would help if you could post the whole project in this post.
Norbert
04-08-2010 11:47 AM
So I was building an example project because I didn't want to post the whole thing, trouble was the example EXE did not error out. WTF. Then I realized I had another invoke node in the startup sequence. OOPS. I put that in there thinking the only way it would error out was if the VI was running before it got called, in which case I wanted to abort it. Turns out it also errors out (1044 VI locked) when running in an EXE, even though the help for that particular node says it works with Run Time Engine. SO, it was trying to abort a VI that was not running. The original error, 1000, just said not in a state compatible with invoke node, didn't say which one.
So, sorry for the trouble, and thanks for the help. Maybe someday I'll figure out the problem that led me to guessing at this, which is the fact that I can't debug EXEs. I sort of think it has something to do with an XControl I always use because they always show up as corrupted right before the debugger fails. Anyway, thanks again, I'm going to go plug this in on the real system and see what else doesn't work.