LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

source behaves differently from executable

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?

0 Kudos
Message 1 of 13
(3,621 Views)

You can get more information about that in Darren's Artisan Blog

-----

The best solution is the one you find it by yourself
0 Kudos
Message 2 of 13
(3,602 Views)

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.

0 Kudos
Message 3 of 13
(3,571 Views)

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

 

0 Kudos
Message 4 of 13
(3,552 Views)

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.

Wes Pierce
Principal Engineer
Pierce Controls
0 Kudos
Message 5 of 13
(3,545 Views)

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

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 6 of 13
(3,514 Views)

the controls that are feed into this VI are from a front panel open to the user

0 Kudos
Message 7 of 13
(3,486 Views)

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...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 8 of 13
(3,480 Views)

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.

0 Kudos
Message 9 of 13
(3,447 Views)

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

0 Kudos
Message 10 of 13
(3,416 Views)