Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Document Type: Example Program
NI Supported: Yes
Publish Date: Sep 6, 2006

Passing Strings to External Code Using Memory Manager Functions

0 ratings | 0.00 out of 5
Print

Downloads

Filename: strings.zip
Requirements: View

This example demonstrates how to use some of LabVIEW's manager functions to manipulate LabVIEW's memory space from external code. The Call Library Function calls a DLL that takes in the same string in three different ways: as a CStr, as a byte array, and as a LabVIEW string handle (LStrHandle).

The default string value contains NULL characters. The CStr and byte array are passed back to LabVIEW with no modifications, except that LabVIEW truncates the original CStr string at the NULL value if the string does not pass through the byte array.

LabVIEW modifies the LStrHandle string data before returning the string.


Function Prototype:

void StringTest(char cstr[], char ByteArray[], long ByteArrayLength, LStrHandle lstr);


This example uses the following LabVIEW manager functions.

-DSSetHandleSize
-MoveBlock
-StrLen

Download the attached ZIP file and open the Example.vi in LabVIEW 8.0 or later to view this example.


Related Links:
See the Using External Code in LabVIEW manual for more information on the LabVIEW manager functions.

Requirements


Filename: strings.zip

Software Requirements


Application Software: LabVIEW Base Development System 8.0
Language(s): LabVIEW, C

 
0 ratings | 0.00 out of 5
Print

Reader Comments | Submit a comment »

 

Legal
This example program (this "program") was developed by a National Instruments ("NI") Applications Engineer. Although technical support of this program may be made available by National Instruments, this program may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this program with each new revision of related products and drivers. THIS EXAMPLE PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).