04-19-2017 08:51 AM
Hi everyone, I'm building a labview program and I'm encountering something strange I haven't seen before. I'm using LV 2016 student edition.
I usually throw my program together pretty quickly and then go through the error list at the end to just tidy up the errors/etc I've made, usually forgetting to add a tunneling variable for each case, stuff like that, etc. So I'm going through the one I just made, and I have a long list of errors, like so:
So I double click on the first one, for example, and it shows me where on the block diagram the error is. And... it looks like this:
And you can notice that the thing that's actually causing the error, the thing with the dotted outline, is not the select structure I have there.
At one point I copied and pasted some code, so maybe that caused it...
But what is this and how can I get rid of them? I pressed delete when that one was selected and it goes away, and so does the error, but there are a ton of them so this wouldn't really be practical.
I tried "clean up diagram" but apparently my PC is too slow/the program is too large, because it crashed LabVIEW. Thanks for any advice.
Solved! Go to Solution.
04-19-2017 09:13 AM
If LabVIEW crashes on a cleanup, this is an indication that your VI is WAY too large. I'm guessing that this is why you are getting the highlighting issue, too.
It's NI's way of telling you to refactor your code. 😉
04-19-2017 09:14 AM
The first thing that I would suspect is that there is broken code behind some structure you are working in. I usually recommend doing a cleanup because it will make sure code doesn't overlap but you could try manually moving the structures to see if the broken things are hidden behind loops or structures.
The only other time I have seen this type of thing are when using VI Macros if you were messing with them in your code at all. It's more of a "hidden" feature so if you don't know whether or not you are using them, you aren't.
04-19-2017 09:19 AM
If I had to bet...
You duplicated code more than once over top of itself.
Revert and try it again.
Ben
04-19-2017 09:40 AM
hi, thanks for the reply. When you say "too big", in what sense? Too many variables or just too many functions/general stuff?
Right now the code is one state machine that has 9 states, and then a few of those states have a kind of sub-state machine in them that have 3 or 4 states... There are a lot of variables I guess, probably 50 or so (it's setting the parameters for several machines).
04-19-2017 09:48 AM
@Jacobson-ni wrote:
The first thing that I would suspect is that there is broken code behind some structure you are working in. I usually recommend doing a cleanup because it will make sure code doesn't overlap but you could try manually moving the structures to see if the broken things are hidden behind loops or structures.
The only other time I have seen this type of thing are when using VI Macros if you were messing with them in your code at all. It's more of a "hidden" feature so if you don't know whether or not you are using them, you aren't.
Hm, so I just tried the cleanup on a smaller selection (as opposed to having nothing selected and then it tries to clean up the whole diagram, which might understandably take a long time). I selected only a really dinky multiplication thing, like:
(that's actually a pic of it after cleaning that selection), and it still takes 3-4 seconds... so maybe my PC just sucks? Because I imagine it would scale way nonlinearly with a more complex block diagram.
04-19-2017 09:50 AM
@Jacobson-ni wrote:
The first thing that I would suspect is that there is broken code behind some structure you are working in. I usually recommend doing a cleanup because it will make sure code doesn't overlap but you could try manually moving the structures to see if the broken things are hidden behind loops or structures.
The only other time I have seen this type of thing are when using VI Macros if you were messing with them in your code at all. It's more of a "hidden" feature so if you don't know whether or not you are using them, you aren't.
Welp! Sorry to bother you all, but I'm an idiot!
Like several of you suggested, it was indeed identical code behind this code... messy mouse-ing strikes again.
Thank you all!