Well, good luck with that. I made numerous notes about my attempt:
LabVIEW can automatically create a set of VIs from a DLL such as pvcam32.dll, where each VI will contain a CLN corresponding to one function in the DLL, with the relevant input and outputs. This facility is available through the Tools menu of LabVIEW, under Import -> Shared Library (.dll). This import operation also requires a header (.h) file; to import pvcam32.dll, it is necessary to specify a single, temporary header file made by combining master.h and pvcam.h (in C:\Program Files\Photometrics\PVCAM\sdk\Headers). This file can be easily created by opening pvcam.h in Notepad, pressing CTRL-A and then CTRL-C, followed by opening master.h in Notepad and pressing CTRL-End and then CTRL-V.
This automatic import operation is not without problems, however. Specifically, some of the functions will take arguments of the "void_ptr" type, which LabVIEW may not interpret correctly. In general, a "void_ptr" should be a pointer to an array of unsigned 16-bit integers, although this may change depending on how the camera is configured. LabVIEW also completely fails to interpret the "void_ptr_ptr" type and will replace it with a cluster.
Unfortunately, the automatic import won't help you at all with the parameters. Let's look at this one as an example:
Function: pl_exp_setup_cont()
*/
enum
{ CIRC_NONE, CIRC_OVERWRITE, CIRC_NO_OVERWRITE };
This line indicates that a value of 0 is associated with CIRC_NONE, a value of 1 is associated with CIRC_OVERWRITE, and CIRC_NO_OVERWRITE is associated with a value of 2. Just supply the appropriate integer when calling the function. (Alternatively, you can construct a LabVIEW enum constant manually.)
Another thing you might be confused by is something like
#define PARAM_PREMASK ((CLASS2<<16) + TYPE_UNS16<<24) + 53)
In this case "<<" is the "bitwise shift" operator. You can find the LabVIEW equivalent on the Numeric palette somewhere. Earlier in the header file you'll find something like
#define CLASS2 2 /* Configuration/Setup */
#define TYPE_UNS16 6
So, take the value of 2 and shift it by 16 bits, take the value of 6 and shift it by 24 bits, and add 53 to the sum of those two values to get the number you'll use in functions to access PARAM_PREMASK.
Message Edited by kehander on
06-12-2008 09:30 AM