08-10-2018 06:54 AM
Hi,
I'm new here and I need help. Thank you
08-10-2018 07:19 AM
You should include more information. How far did you get before getting stuck? Are you seeing some errors? Maybe attach your VI and DLL files so other people can download to debug the problem.
08-11-2018 01:44 PM
Posting a pic instead of both the C code and actual VI is definitely not very helpful. But I can tell you at least that you are already doing some things wrong.
The calling_file and error_string parameter is a string and passing it as array of 8-bit chars will make it impossible for your C code to properly use it. Strings are in C NULL terminated, in LabVIEW not (the length of the array is a separate attribute of the string). In order to make them be passed as NULL terminated C strings you have to configure the parameter as String, pass as C String Data Pointer. That way LabVIEW will perform the right conversion and append a NULL byte to the end of the string before passing it to the DLL.
Your Session structure is NOT going to work like this! You do NOT want to pass arrays and or strings inside a cluster to a C DLL. The resulting arrays are LabVIEW string or array handles, not C data pointer. Only a DLL specifically written to expect these LabVIEW data handles can deal with them properly. Instead pass strings and arrays as an additional parameter to the DLL. However an array (1 or more dimensional) of strings will also not work. Each string in the array is again a LabVIEW handle.
08-13-2018 08:54 AM
Thank you for all replies. Sorry, it's a part of the larger DLL and I can't post it here due to the copyright ...
I'll try to break it down to a single function and post it.
Thanks again.