What your problem with this is is the following assuming you declared
it as this:

static unsigned char MemoBuffer[MEMO_BUFFER_SIZE];

p4 = (int)&MemoBuffer;

hasp(MEMOHASP_READBLOCK, SeedCode, PortNum, Pass1, Pass2, &p1, &p2,
&p3, &p4)

First you assign to p4 a reference (pointer) to the pointer of the
memobuffer, and then you pass a reference to the reference to the
memobuffer to the function.

Unfortunatly there is no simple way you can do this directly in
LabVIEW. It is similar to a LabVIEW handle wich is also a pointer to a
pointer but LabVIEW will bark on returning of the Call Library Node as
the first four bytes will be filled in by some returned data but
LabVIEW expects an int32 in there telling it how many array elements
do follow.

The most simple solution is to just create a small wrapper C function
in a DLL or CIN to deal with this. Basically calling the Visual Basic
memory preparation routine would probably take care of that.
Another possibility might be to try to create such a reference to a
pointer with some LabVIEW magic. You could use a Call Library Node
with:

library: LabVIEW
function: MoveBlock
calling convention cdecl
return: void
param1: s (your uInt8 array as C array)
param2: t (a uInt32 passed by reference)
param3: len (an uInt32 passed by value with value 4)

Take the output of the t variable which is the pointer to your buffer
now. If the declaration of your buffer was as I did assume you would
have to repeat this trick  once more I would guess, and the returning
uInt32 can then be passed as an uInt32 passed by reference to the
function.

Tricky, trial and error and a little hard to explain like this.

Rolf K

Reply via email to