Example Code

Using Windows DLL

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Description

Overview:

This example calles Windows DLL's to get the currently logged in user's name. and highlights how to call a DLL from LabVIEW and select the appropriate

LabVIEW datatypes.

 

Description:

In LabVIEW you can call DLL's by using a Call Library Function Node.  Once you drop the VI onto your block diagram, you need to double click it to configure it to run the above function. 

 

Requirements:

  • LabVIEW 2012 (or compatible)

 
Steps to Implement or Execute Code

  1.  Run the vi. 

 

Additional Information or References

LabVIEW handles strings differently than C/C++, and so special care must be taken when working with strings, otherwise your LabVIEW code WILL crash due to memory management problems.  The following exerpt is from the article: "Using Arrays and String in the Call Library Function Node".

Configuring the Call Library Function Node

 

Front Panel

 FP.PNG

VI Snippet

BD.png

 

 **This document has been updated to meet the current required format for the NI Code Exchange.**

 

Systems Engineer
SISU

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.