LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading a line from a third party software using call dll function.

Hi,

I am using a third party software in Lab VIEW.
I am having trouble using one of the functions defined in the dll.

I have the VI attached here, As u can see in the VI I am not sure how to use the function
LCOM_MasterGetLine in the fourth sequence.....

This has three parameters and they are

(int ID,char*Buffer,int Length)

What basically happens with this function is this...

/* ROUTINE LCOM_MasterGetLine
It Reads line of maximally Length characters from Slave ID into Buffer and the parameters are

* ARGUMENT(S) ID ... Slaves ID
* Buffer ... Where do you want chars (at least Length+1 in size)
*Length ... How many at most (should be less than LCOM_MAXLEN)


Can
any one help me how to define the input parameters for this function, for example in the fourth part of the Vi attached here.

What I understand from the function is that, the third party software when it sends a line, that line is stored in the input parameter...buffer ...that is defined to the dll.

Can any one help me how to then read what line has been sent from the third party software.

I am including the dll file and also the header file here.
Thanks a lot,
Ajit
0 Kudos
Message 1 of 4
(2,791 Views)
Ajit,

Please find attached corrected version of your vi. The parameter is passed by the pointer which means that the function can modify a memory pointed by this parameter. The output value will be available in the string. Is the problem solved ?

Arkadiusz Roszczewski
National Instruments
0 Kudos
Message 2 of 4
(2,791 Views)
Hi,

The modified VI doesnt seem to work, itz not reading the line from the third party software, is there any other way to do this.

Ajit
0 Kudos
Message 3 of 4
(2,791 Views)
One problems with your solution:

LCOM_MasterGetLine(int ID,char*Buffer,int Length)

You should allocate a buffer large enough in LabVIEW and pass it to the Call Library Node. The dll function needs som space to actually scribble in whatever it wants to do.

Check out the attachement this should more or less be what you will need.
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
Message 4 of 4
(2,791 Views)