Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Question on the parameter type of DLL functions

I am trying to develop an interface to control a laser with LV8.2  I am planing to use the VI “Call Library Function Node” to call the DLL and set the exact same parameters of functions in the DLL.
According to the DLL manual of the laser, there are six functions.  One of the prototypes is:  function getstatuspointer : pointer. I don't know how to set this parameter for the function. Is there anyone who can give some hints? Thanks!
 
BTW :The following is a description of the function:
This function returns a 32 bit pointer to the STATUS data structure (Tstatusrec). In the 32 bit DLL, every application is using its own copy of the data structure (local
memory). The data structure is a packed structure. "packed" means that the fields in the structure are not aligned on word or double-word boundaries.
Tstatusrec = packed record
                        size : word;
                        initstat : byte;
                        queuefill : byte;
                        anzapp16 : word; (not used)
                        anzapp32 : word;
                        anzdock16 : word; (not used)
                        anzdock32 : word;
                        dll16ver : tchararray; (not used)
                        dll32ver : tchararray;
                        excimerver : tchararray;
                        excimer : TExcimerStatus;
                  end;


Message Edited by huangjack on 02-08-2008 04:55 PM
0 Kudos
Message 1 of 5
(4,090 Views)
Hi

This means that you need to define a memory package that has the exact same size in LabVIEW.
Best is a U8 array. and then typecast that to a record that matches this size.

The problem is that TCharArray is not known by me but seems a pointer (how many bits) to a string or byte array (in C this is the same)
greetings from the Netherlands
0 Kudos
Message 2 of 5
(4,079 Views)
Hi,
 
Thank you for the explaination.
The TcharArray is a char string with a size of 50 byte. And the TExcimerStatus is another data structure.
 
But I wonder whether a U8 array is enough?  
Since the data types of each parameter within the data structure are different, should I define a cluster instead of a U8 array?
 
Thanks.
 
 
0 Kudos
Message 3 of 5
(4,065 Views)

It seems that I cannot wire a cluster to a Call Library Function Node.

So how can I define an array of which the elements' types are different?

Thanks

 

0 Kudos
Message 4 of 5
(4,062 Views)
Hi Huangjack,
 
You could set multiple parameters as inputs to the Call Library Function Node. There is more detail about this in the LabVIEW Help. If you search "Call Library Function Node" on the Index tab, both the "creating parameter list" and the "using arrays" subcategories will be helpful.
Regards,

Hillary E
National Instruments
0 Kudos
Message 5 of 5
(4,055 Views)