12-17-2012 06:24 PM
I have a subVI that runs into an endless loop in the executable version but not the development version. I have determined that the cause is that the property needed (BindingPath) for the check to end the loop has no value. As a matter of fact there is no value for CaptionText, BindingPath, or Label.Text. All the controls collected in the array have these values set by the developer prior to runtime. Why, in the development version, do values exist for all these properties, but not in the executable version?
12-17-2012 11:07 PM
You can get more information about that in Darren's Artisan Blog
12-18-2012 11:49 AM
Well that was both frightening and enlightening. However, I discovered that the Caption.Text, BindingPath, and Label.Text do exist for at least some period of time. The Ctr Refnums array initially has 81 elements. The loop successfully process 2 elements in executable mode and reduces the size of the array to 79. It only loses the property values afterwards. Any ideas how the property values got lost? The subVI has not been completed. Only 2 iterations of the For Loop have passed.
12-18-2012 03:52 PM
Hello Faustina,
Thanks for posting at NI forums! My recommendation would be debugging the executable in order to open its block diagram and checking what seems to be changing in the target computer. This will allow you to narrow better what is the cause of the problem. I’m linking a knowledge base that explains how to debug an executable.
KB Remotely Debugging Executables in LabVIEW
Best Regards,
Alina M
12-18-2012 04:17 PM
I know this doesn't directly address the issue, but it would be a good idea from an error handling point of view to create code for a timeout error. That way instead of sending you into an infinite loop, your program can return a user-defined error and continue to execute.
12-19-2012 06:24 AM
I assume it's a sub-vi where the front panel gets removed in compiled code due to optimization?
You can force front panel into memory by placing a vi ref.
If i'm way off, then nvm. 🙂
/Y
12-19-2012 12:37 PM
the controls that are feed into this VI are from a front panel open to the user
12-19-2012 12:59 PM - edited 12-19-2012 01:07 PM
What version of LV are you running?
If 2011, this might be related to a problem that I found and which has since been fixed in 2012. In my case reading the value of a control that was on a front panel that wasn't in memory failed the first time it was called. It returned the default values for the datatype.
Mike...
12-20-2012 12:30 PM
I am using LV 2011.
This subVI modifies controls on the user front panel according to a XML file. The array of clusters is the result of reading that file. The For Loop indexes the array of clusters while the While Loop searchs for the appropriate control based on the BindingPath property. The subVI in the While Loop was used to display the properties of the control from the front panel. The Add Indicator subVI does the actual modification of the control.
It was using the subVI in the While Loop that I determined that Caption.Text, BindingPath, and Label.Text 'disappeared' after 2 iterations of the For Loop ONLY in executable mode. In development mode there are no problems.
12-21-2012 04:58 PM
Hello Faustina,
Have you tried enabling debugging in the executable in order to open the block diagram and check what is occurring behind scenes?
Best Regards,
Alina M