LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Large Sub-Vi causes erratic behavior and crash?

Hey folks, this is Alpha from Penn State Behrend. I'm a "low-level intermediate" Labview user I've encountered an unusual problem.
 
I've been designing system to do u255 encoding for a Telecom lab, which essentially takes a voltage signal, converts it into 12-bit binary representations (11 data and 1 sign bit) and then converts that to a compressed 8-bit format. Then, it does the whole thing backwards to get the original input signal. Of course, because of the compression, the lesser significant figures are removed and there is some loss of accuracy.
 
Anyhoo, here's the problem. The decoding section, going from the compressed 8-bit format to an uncompressed 12-bit format involves lots of array manipulation, things of that nature. It's a pretty decent-sized program. If I can I'll upload a copy of the faulty program, but there is quite a few sub-VIs and such to dig though. Anyways, the thing I encountered was this: when the program was as-is and wasn't reduced to a Sub-VI, it operated perfectly. If I took the whole thing and crunched it into a single Sub-Vi, it would begin to act very erratic. One issue was that certain numbers would not come out right at all, and sometimes it would crash Labview and even throw out something about an "insane error." Yeah, it used that word - "insane."
 
Now here's the catch! I worked around it! Instead of creating one gigantic sub-VI, I slowly created several seperate Sub-VIs. My idea was try and capture where the error was occuring, but it never occured when I broke it into a few "sub-sub-VIs" and then combined those into a single Sub-VI. That had no errors. To sample a signal I just took these Sub-VIs and plunked them into a while loop to decode every voltage level on an incoming signal (not in real-time!)
 
It's not a terribly bad work-around, but I'm curious if anyone has ever seen something like this happen before.
0 Kudos
Message 1 of 3
(2,549 Views)

"....it never occured when I broke it into a few "sub-sub-VIs" "

It's a good practice to have more, modular subVIs than one "big subVI."  So, I would leave it as such.  As for the crashes and all, search for the error code on NI's support site.  There are fixes for some of those Insane Object errors. 

-Khalid

0 Kudos
Message 2 of 3
(2,540 Views)
Hey there K, yeah, this morning another guy in the class encountered a similar error, and I guess this referrs to a problem on the front panel that didn't involve any sub-VIs. He checked the error code and it appears to have something to do with a graphical object on the front panel, something wacky like that.
 
Oh man... Smiley Very Happy
0 Kudos
Message 3 of 3
(2,520 Views)