How to compile VIs for different targets with compile flags in LabVIEW?

时间:2015-06-25 09:57:26

标签: continuous-integration labview build-script build-tools

I have five RT targets that run almost equal code. I don't want to copy the VIs around to every target. Obviously because I don't want to recopy everything when changes happen. My prefered way would be that I write one VI with some conditional disable or case structures where the desicion whether it's enabled or not should be made with a build file/script.

To achive the case switching I'd like to define string constants in a build script and the dead code elemination should remove the unused cases after compilation.

What are the right tools to achive that? And how would you combine that with CI?

1 个答案:

答案 0 :(得分:1)

今天没有API可以从构建中执行此操作,但我建议您使用条件禁用结构。有关LV想法交换的一些想法请求此功能。

一些选项:

  1. 我相信您可以设置每个目标的条件值,因此您可以为每个构建设置一个目标,并为每个目标设置不同的值。或者,您可以拥有多个项目,并为每个项目设置不同的值。
  2. CDS应具有目标条件。我不确定你能做多么详细,因为我很少使用目标。
  3. 虽然没有合适的API,但您可以调用预构建VI并使用标记以编程方式在项目/目标中设置条件值。 Haven自己做了这个,但有一些例子herehere
  4. 我不确定这如何适用于CI,因为我不做自动构建。我猜测它曾经是构建规范的一部分,只需在调用构建规范时执行。