Codes can be shared through DLL. There are many DLL built-in to the window operating system. In this example, we will demonstrate how to access the built-in DLL for Windows.
We will create a program that can access C-based DLL in a loop:
Build the following block diagram. It has two loops. The top loop contains a case structure that executes the
GetSystemPowerStatus
function within thekernel32.dll
. The bottom loop executes theBeep
function withinkernel32.dll
with frequency and duration input set to100
ms.The input cluster for the
GetSystemPowerStatus
function is shown in the following screenshot:The False case of the loop is shown in the following screenshot. It displays the battery life percentage in an indicator.
To set up the
Call Library Function
node for theGetSystemPowerStatus
function within thekernel32.dll
, see the following screenshot. The Run in UI thread is selected. Under this option, theCall Library Function
nodewill leave the thread that...