LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

importing cvi instrument driver and c string pointer

I want to export some plain C functions ro Labview VI. To do that I created fp file. When I imported this in LV7.1 it worked fine but when I Use LabVIEW Interface Generator for LabWindows-CVI version 1.1 I don't get string as output. I always get integer as output even if my prototype says it is string.
 
int STDCALL ReadLine_(int handle, char line_buffer[], int max_no_of_bytes)
{
      return ReadLine(handle, line_buffer, max_no_of_bytes);   
}
In above example, When it creates VI it shows line_buffer an integer array. It should be string.
 
I have attached both LV7.1 and LV8.0 cases.
In LV 7.1 I have imported this from Tools\Instrumentation\Import CVI instr driver
In LV8.0 I used LabVIEW Interface Generator for LabWindows-CVI version 1.1.
My source files/DLL are same for both of these cases.
 
Thanks.
CVI 2010
LabVIEW 2011 SP1
Vision Builder AI 2011 SP1
0 Kudos
Message 11 of 14
(764 Views)

Hello again Sheetal,

 

Have you opened the VI in 8 to see what the CLF node looks like?  The function returns a char[] which LabVIEW probably reads as a number.  I would change the CLF node in LabVIEW to have that parameter passed as ‘adapt to type’ and wire in a string to see if that fixes it up.  Also, if you can create a small FP instrument with one function which can replicate this problem myself or someone else in the community might be able to further assist.


Travis M
LabVIEW R&D
National Instruments
0 Kudos
Message 12 of 14
(752 Views)

Ok. I have attached my complete project.

My function is

char * STDCALL my_function(char *char_pointer, char char_array[], int *int_pointer);   

In LV 8 my return value is integer instead of string.  

In LV7.1 it is string.

I do not get any output for char_pointer and int_pointer.

Thanks.
CVI 2010
LabVIEW 2011 SP1
Vision Builder AI 2011 SP1
0 Kudos
Message 13 of 14
(743 Views)

Good afternoon Sheetal,

 

I apologize for the delay in the response to your last post.  I was able to replicate exactly what you are talking about.  I filed a corrective action request on it for R&D to examine (3Z9EN63A).  For now, the way to workaround these difficulties is to manually modify the CLF call created for the function to return a C string, or to continue use of 7.1 and save the VI drivers in 8.0.  I apologize for this; please let me know if you have any further question.

 

Thanks, and I do apologize for any inconvenience caused as a result of this behavior.

Travis M
LabVIEW R&D
National Instruments
0 Kudos
Message 14 of 14
(727 Views)