From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
09-09-2017 03:46 AM
09-09-2017 05:27 AM - edited 09-09-2017 05:28 AM
It's not a TCHAR. TCHAR is the Win32 API name for a character code point that could be either Unicode or ASCII depending on preprocessor magic. Because your API specifically specifies that it is Unicode and Visual Basic Strings are Unicode anyways by default it is an array of WCHAR's.
This is basically an array of uInt16 integers. And you will need in addition to use some ASCII to Unicode conversion library to convert your LabVIEW strings to Unicode strings in order to pass them to this function.
The function name you need to set in the Call Library Node configuration is most likely called lmcl_initial2 and not Initialize, which is only a Visual Basic alias to use in the Basic program.
09-09-2017 08:04 AM
What I mean is how to define the parameters of the library function"strEzCadPath"type
thanks a lot !
09-09-2017 08:55 PM
Array of 16 bit integers passed as C string pointer.
09-10-2017 02:58 AM
I am sorry! I still did not understand, you can not say the details of the point.
such as:
Name: strEzCadPath
Types of:?
constant:?
type of data:?
Data Format:?
thank you very much!
09-10-2017 03:00 AM
rolfk 已写:
Array of 16 bit integers passed as C string pointer.
I am sorry! I still did not understand, you can not say the details of the point.
such as:
Name: strEzCadPath
Types of:?
constant:?
type of data:?
Data Format:?
thank you very much!
09-10-2017 09:33 AM
@NJ_yang wrote:
rolfk 已写:
Array of 16 bit integers passed as C string pointer.
I am sorry! I still did not understand, you can not say the details of the point.
such as:
Name: strEzCadPath
Types of:?
constant:?
type of data:?
Data Format:?
thank you very much!
Name: irrelevant for the functionality, only for documentation
Type: Array
Constant: checked if it is an input parameter to the DLL function, not checked if the DLL writes something into it for the caller to use, but if you leave this unchecked it is always safe just may prevent LabVIEW to do some extra optimizations
Data Type: (signed or unsigned) 16 bit integer
Dimensions: 1
Array format: Array Data Pointer
Minimum size: <None> if it is an input parameter to the function, otherwise the number of elements the array should provide for the function to write into, according to the documentation for the parameter for this function.
09-11-2017 07:45 AM
Dear rolfk, thanks for your help to let me have a new direction.
I would also like to ask how 16-bit integer array can include (TCHAR * strEzCadPath, BOOLbTestMode, HWND hOwenWnd) type, is not to convert the input parameters into 16-bit integer array?
thanks a lot
09-11-2017 09:08 AM - edited 09-11-2017 09:23 AM
It doesn't include all those parameters, only the first!!
And you need to convert LabVIEW strings into Unicode strings in order to pass it to this parameter. LabVIEW strings are 8 bit Multibyte Code Sequences (ASCII for most western locales).
There are routines to do that, namely here! you can also download this with VIPM under the name ni_lib_unicode-2.0.0.4.vip or maybe a newer version.
09-11-2017 09:22 AM - edited 09-11-2017 09:30 AM
The other parameters are:
Name: bTestMode
Type: Numeric
Constant: checked
Data Type: (signed or unsigned) 32 bit integer
Pass: Value
Name: hOwenWnd
Type: Numeric
Constant: checked
Data Type: (signed or unsigned) pointer sized integer
Pass: Value