Thang Nguyen Posted March 4, 2011 Report Share Posted March 4, 2011 (edited) Hi, I have a really weird case happen here. I minus a number by one and the result is -1. I attach my code here when it running with highlight and prob. I have the actual code below it. When I copy that code to another VI, it runs ok. I tried to replace that minus 1 by a minus block with a constant 1 and it still returns same result is -1. Please tell me what I did wrong. Best regards, Thang Edited March 4, 2011 by Thang Nguyen Quote Link to comment
Sparc Posted March 4, 2011 Report Share Posted March 4, 2011 VI corruption. The fact a copy/paste of the code works is a strong clue. I've had many inexplicable problems simply disappear by just copy and pasting entire block diagrams in to new VIs. It's almost at the level that the technique is a legitimate debugging step. To paraphrase a friend: "What? You've never seen LabVIEW do something stupid before?" Quote Link to comment
Thang Nguyen Posted March 5, 2011 Author Report Share Posted March 5, 2011 Haha, Thanks, I actually saw some stupid stuffs happened sometime. Quote Link to comment
Ton Plomp Posted March 5, 2011 Report Share Posted March 5, 2011 I can offer two options for this. it looks like you could have made a programming error, use the auto-clean-up (ctrl-u) to verify you connected everything correctly You could force a recompile on your VI (ctrl-click on the run arrow, if memory serves right) Ton Quote Link to comment
Aristos Queue Posted March 6, 2011 Report Share Posted March 6, 2011 You could force a recompile on your VI (ctrl-click on the run arrow, if memory serves right) Yes. Hold down the ctrl key and click on the Run arrow button. That will force a recompile. If that works, please don't save over the busted VI until you post the actual VI and its subVIs to the forums at ni.com so that we can investigate that code for a compiler bug. Quote Link to comment
Thang Nguyen Posted March 7, 2011 Author Report Share Posted March 7, 2011 (edited) I did recompile and the error is still there. I tried to copy that while loop into a blank VI, ran, and confirmed it work. Then I delete the case in my main VI, and build the case. Copy back the while loop, and error still happens. I have just tried to remove the -1 block from inside the while loop to outside the while loop and it works now. I am lucky that I don't have to rebuild the whole VI. I sent the VI to NI already. Best regards, Thang Nguyen Edited March 7, 2011 by Thang Nguyen Quote Link to comment
Minh Pham Posted March 8, 2011 Report Share Posted March 8, 2011 I did recompile and the error is still there. I tried to copy that while loop into a blank VI, ran, and confirmed it work. Then I delete the case in my main VI, and build the case. Copy back the while loop, and error still happens. I have just tried to remove the -1 block from inside the while loop to outside the while loop and it works now. I am lucky that I don't have to rebuild the whole VI. I sent the VI to NI already. Best regards, Thang Nguyen This is starting to freaking me out Quote Link to comment
Rolf Kalbermatter Posted March 8, 2011 Report Share Posted March 8, 2011 I did recompile and the error is still there. I tried to copy that while loop into a blank VI, ran, and confirmed it work. Then I delete the case in my main VI, and build the case. Copy back the while loop, and error still happens. I have just tried to remove the -1 block from inside the while loop to outside the while loop and it works now. I am lucky that I don't have to rebuild the whole VI. I sent the VI to NI already. Best regards, Thang Nguyen Looks almost like an implicit (and definitely not legal) I8 cast is done somewhere. This is something NI really will want to investigate, since such errors are a terror for any LabVIEW user. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.