05-08-2017 04:35 PM - edited 05-08-2017 04:36 PM
Hi there,
I am having a problem where a static VI reference will break my entire executable in LV 2011. (I put a diagram disable structure around the reference and the problem stopped). It only becomes a problem when I build the executable, but works fine in the development environment. This was originally a LV 2012 project which I saved for LV 2011. The offending piece of code looks like this:
Does anyone know why this is happening or a work around?
Thank you,
Gregory
Solved! Go to Solution.
05-08-2017 05:19 PM
For an asynchronous call, the VI refnum has to be strictly typed. Right click the constant, Select VI Server Class, Browse and select your VI. I'm not sure what the red star means in your picture. I've seen it before but not sure what it means.
05-08-2017 05:35 PM
Hi aputman,
The red star does signify strict type definition I believe.
05-08-2017 05:47 PM
If so, then the problem is going to be with file location. In IDE mode, the VI is loaded in memory and so it operates fine but in EXE mode, it is not found because you're supplying absolute path with the property node. Instead, specify a path relative to the calling VI.
05-08-2017 05:52 PM
I see, but the odd thing is that it works fine in a LV 2012 built executable. And the code you posted above should run in an executable too, no?
05-08-2017 08:43 PM
Use VI name instead of VI path. Does that change anything? The VI is already loaded in memory by the static reference, so no need to specify the whole path to the Open VI Reference.
05-08-2017 10:13 PM
Thank you Rolf, I can try that, but the executable reports that the VI is broken with the Static VI reference in there, so I think it will still be a problem. I will give it a try in the morning though,
Gregory
05-08-2017 11:10 PM
Gregory,
I haven't tried this in LabVIEW 2011, but I've been using this method for "cloning" VIs for a while. I do agree with Rolf, however -- I always use the VI Name property, not the VI Path, and it works in both Development and Execution mode.
Bob Schor
05-09-2017 02:31 AM
As Rolf suggest using the name would certainly work and we are using it with no issue.
05-09-2017 02:31 AM
Is the Main added as Always include in the project? It should understand it's supposed to since it's static, but won't hurt. 🙂
/Y