12-11-2012 05:04 PM
Still missing type defs and subs of the sub
try zipping the project folder (assuming no dependancies not in the folder heirarchy)
12-12-2012 09:01 AM
I cannot send it all because it belongs to our customer. I removed the case structure from the vi, and it started compiling every time. Then I added a similar case structure around the place where that function is called, and guess what? Now the calling function will not compile sometimes. It seems that LV has a problem with case structures that have a constant input, in my case False. True always works, but False fails sometimes. I have two instances where I comment out the same vi using this method. Only one of them fails with a False input. I attached the pictures here, though there is not much to see. Is this a know issue? Maybe there is a better way to easily comment out code?
12-12-2012 09:28 AM
Yes, Conditional disable structures and project (or target within project) Symbols
12-12-2012 09:54 AM
Okay, I found that setting an indicator to False and then using a local variable at the structure input is acceptable to LV.
Thank you very much for your help, and I hope that NI can address the issue of constant inputs to case structures being another causation of the dreaded 1502 error.
12-12-2012 10:06 AM
As has been previously stated in this thread the solution is "never write unreachable code"
(A good practice in any language) Unfortunately you can't just "//" in front of Block diagram objects! So, those case structures driven by constants look like a good idea to disable code although they are not ideal. Use disable or conditional disable structures to truely "Comment out" code.
Although, I have seen block diagram free text lables like "//I am a comment written by a former C programmer" that use the "//" to warn the compiler to ignore the text.
12-12-2012 07:30 PM
03-28-2017 08:38 PM
Thank you for posting this! I couldn't get my RT executable to build because of error 1502. I removed a case structure that I had left in for debugging purposes that had a constant wired to it. Removing the non-executing code did the trick.
Thanks again!
03-28-2017 10:05 PM
It's been a long time and this thread is still rolling, which is pretty sad because this error is incredibly frustrating. That being said, several years ago I think I came across the answer to this by happenstance at a local dev day. If I am not mistaken, the way to reliably get rid of this error (if this is the same one) is to actually clear your compiled cache and close and reopen LabVIEW. Silly, but really simple. I have not had any major issues like I did before since I discovered this neat little trick.
03-29-2017 06:35 AM - edited 03-29-2017 06:36 AM
Thank you cirrusio. For completeness (and to save me time looking for how to do it), how does one clear their compiled cache in LabVIEW? I've never done that before, or I have and I don't know that is what it was called. Thanks again!
03-29-2017 05:12 PM - edited 03-29-2017 05:13 PM
In any window, go to Tools->Advanced->Clear Compiled Cache. This will throw a dialog pop-up asking you if you want to do this and showing you the size of the current cache. You can also delete the object cache folder. On Windows, this might be in LabVIEW Data, but I am not certain. This has been successful for me. Let me know if it works for you.