fieldrndservices / logger

A Log4j-like library for LabVIEW
http://sine.ni.com/nips/cds/view/p/lang/en/nid/215388
5 stars 2 forks source link

File Start throws error when used in EXE #1

Closed fuzzy-focus closed 5 years ago

fuzzy-focus commented 5 years ago

Setting a control value via invoke node does not work when used as a sub-VI in the EXE as the frontpanel is usually removed.

Fix: replace static VI ref with strictly typed static VI ref and use "Start Asynchronous Call" Vi.

fix

volks73 commented 5 years ago

Thank you for the bug report. I have investigated implementing the solution/fix you provided. In fact, I was almost ready to push an update with your proposed fix when I discovered that the Start Asynchronous Call is only supported back to LabVIEW 2015. This would break compatibility for LabVIEW 2009 to 2014, which the invoke node does support. I would like to avoid breaking compatibility since I know some people are running and developing on versions older than LabVIEW 2015 with this package.

With that said, I do like the proposed fix and would suggest either not running the logging in the background like in the Simple example for your executable, or you can create your own start VI like so:

Asynchronous Start Example

This is essentially the same thing, but you can use it on newer versions of LabVIEW.

fuzzy-focus commented 5 years ago

Ah I hadn't considered backwards compatibility.

I will use the solution you suggested in the VI snippet, thanks!