Compiler directives enable and disable features. LEP_ x _ScriptCompiler.vi passes the directives to the compiler from the command line. The Build Specification Properties dialog box exposes the implementation of the compiler directives.
The macros in this section define how to compile generated and external C code. The LabVIEW Embedded Development Module example targets compile each generated C file by scripting the C compiler from LEP_ x _ScriptCompiler.vi, which is a plug-in VI located in the following directory:
![]() | labview\Targets\Embedded\os\os_LEP_TargetPlugin |
where os is the target operating system. Some example targets include the target name in the subdirectory.
LEP_ x _ScriptCompiler.vi can directly execute the C compiler by calling the System Exec VI. You also can use a batch file to directly execute your C compiler. Use a batch file if you need to set compiler-specific system variables before the compiler can execute. For example, the VxWorks example targets use a batch file because you must set the Tornado system variables before the C compiler executes.
When a user builds an embedded VI into an embedded application, LEP_ x _Build.vi calls LEP_ x _ScriptCompiler.vi for each generated source file. The VxWorks and eCos example targets do not have pre-compiled run-time libraries, so you must compile the run-time source files along with the generated and external C files. LEP_ x _Build.vi executes the default implementation of LEP_ x _ScriptCompiler.vi unless you override the default implementation and create a custom LEP_ x _ScriptCompiler.vi. You can override the default implementation by wiring a LEP_ x _ScriptCompiler.vi VI reference to the Compiler Script input of LEP_ x _Build.vi. Your custom implementation of LEP_ x _ScriptCompiler.vi must have the same connector pane as the default implementation. Refer to the Axiom CMD565, VxWorks RAM Image target for an example of how to override the default implementation.
For most targets, the base target provides a complete, tools-aware embedded OS build framework with the default implementation of LEP_ x _ScriptCompiler.vi. You can use the base target default implementation of the build framework and LEP_ x _ScriptCompiler.vi and override just the necessary features.
The VxWorks CMD565 example target uses a subtarget-specific implementation, which is located in the following file:
![]() | labview\Targets\NI\Embedded\vxworks\cmd565\vxworks_cmd565_LEP_TargetPlugin\LEP_vxworks_cmd565_Build.vi |
This custom implementation overrides the default implementation of LEP_x_ScriptCompiler.vi, LEP_x_ScriptLinker.vi, and LEP_x_Config.vi. Notice the Case structure with target-specific VIs in this custom implementation. The VIs in the Case structure never execute, but are always loaded into memory. Because the VIs are loaded into memory, the Open VI Reference function can refer to VIs by name instead of absolute path.
![]() | Note Defining unsupported features can result in compiler errors or run-time errors. |