| Customize Help

MIL Function Development module

The MIL Function Development module allows programmers to define custom (user-defined) MIL functions to extend MIL's functionality. Using this module, you can implement functions or scripts, and integrate them directly into the MIL library, where they behave like standard MIL functions (for example, respecting error handling and tracing). The MIL Function Development module also allows programmers to group related user-defined MIL functions together into user-defined modules. This is useful to create high-level packages on top of MIL and to extend the MIL library function set (for example, by adding new functions with specialized algorithms).

Using a user-defined MIL function, you can integrate functions or scripts written in C, C++, C#, Python, or Visual Basic .NET into MIL. You can also integrate functions/scripts written in other .NET languages or language versions (for Python) but you will need to develop an additional DLL to use these other languages. User-defined MIL functions based on C or C++ functions (embedded in a DLL) are referred to as C-based user-defined MIL functions. User-defined MIL functions based on a function or script that require an interpreter or the Microsoft .NET framework to be present at runtime are referred to as script-based user-defined MIL functions.

To allow for the remote execution of user-defined MIL functions and the ability to run scripts, user-defined MIL functions are composed of two parts: a master function and a slave function/script. The master function performs the parameter registration and transfers the information to the slave function/script. The slave function/script receives the parameter information and performs the data processing operations of the user-defined MIL function. When a remote processor is available, the slave function/script of a user-defined MIL function that meets certain criteria can be executed remotely. For the purposes of this chapter, the processor that executes the master function is referred to as the master processor and the processor which executes the slave function/script is referred to as the slave processor. When no remote processor is available, the master and slave processors are the Host processor.

The MIL Function Development module also provides a framework in which you can define your own objects and associate them with MIL identifiers. Such associations can be useful when designing objects, within a user-defined MIL function, whose data members should not be accessed directly and whose data structure has specific requirements.

When designing a function, or set of functions, the MIL Function Development module puts at your disposal all the tools necessary to create custom error codes and error messages that are treated as regular MIL errors which can in turn be managed using the Mapp...() functions.