Characteristics of LabVIEW-Built Shared Libraries

LVDLLStatus Function

All DLLs built from LabVIEW, in addition to the functions you export, contain an exported function called LVDLLStatus, with the following prototype:



MgErr LVDLLStatus(CStr errStr, int32 errStrLen, void *module)

The calling program uses this function to verify that the LabVIEW DLL loaded correctly. If an error occurs while loading the DLL, the function returns the error. Pass a string buffer to the errStr parameter to receive additional information about the error. Set the errStrLen parameter to the number of bytes in the string buffer passed as errStr. You can use the module parameter to retrieve the handle to the LabVIEW Run-Time Engine being used by the DLL. Typically, you can leave this parameter as NULL.

The LVDLLStatus function blocks the execution if LabVIEW calls this function while the LabVIEW Run-Time Engine is still loading.

Note  If you call a LabVIEW-built DLL from within LabVIEW, LabVIEW automatically calls the LVDLLStatus function for you.

SetExecuteVIsInPrivateExecutionSystem Function

All DLLs built from LabVIEW, in addition to the functions you export, contain an exported function called SetExecuteVIsInPrivateExecutionSystem, with the following prototype:



Void SetExecuteVIsInPrivateExecutionSystem(Bool32 value)

Use this function to specify whether LabVIEW executes VIs in a multithreaded execution system when you call LabVIEW-built shared libraries to applications in other languages. If you pass 1 to the value parameter, LabVIEW executes VIs in a multithreaded execution system when you call LabVIEW-built shared libraries to applications in other languages. If you call this function, the value parameter of this function overrides the value of the Execute VIs in private execution system checkbox in the Advanced page of the Shared Library Properties Dialog Box.

(macOS) To build part of a shared library in LabVIEW, Application Builder must use gcc, the standard command-line compiler for Unix and macOS operating systems. Use Xcode, the standard development environment for Apple computers, to install gcc. You can download Xcode for free from the Mac App Store.

Memory Allocation

To manage memory allocation for LabVIEW array types exposed as handles, the LabVIEW-built shared library provides Allocate, Deallocate, and Resize functions for each array type exposed as a handle. Open the generated header file to view the function prototypes specific to the generated shared library.