05-08-2009 01:25 PM
05-08-2009 02:38 PM
05-11-2009 01:01 PM
05-12-2009 04:01 AM
Hello!
It seems that I'm having same kind of problem. I have a DLL that reguires passing a HANDLE type interface in calls which are done in a chain. How shoul I do it in LabVIEW using CallLibraryNode? LabVIEW does not need take care of memory management or anything else. Just be able to pass the opened handle as an parameter in a chain.
Following is the chain I need to do:
1. Open(HANDLE &interface) //Opens the interface for proceeding functions to use
2. SetParameter(HANDLE &interface, string parameterName, int parameterValue) // Changes the parameter in the interface
3. Close(HANDLE &interface) //Close the connection to the interface
I currently have an state machine where in Initialize state I call the Open function. For the HANDLE parameter I have set the type into Adapt To Type which seems to make it as an unsigned 32 integer. After the call I receive an integer which seems to a valid one. This value is then set into ShiftRegister. However during the next call with same setup for the interface parameter the function call fails as the interface handle is not a valid one. The value I'm receiving from the Shift register still seems to be a valid one.
How should the LabVIEW work in this kind of case?
05-12-2009 07:18 AM
Something special like a handle example would be a queue node pointer built into Labview or a task. They essentially do the samething right. Right now my program is treating the pointer as an unsigned in32, and it's a little confusing. Maybe I'll throw it into a cluster.
cyberias, I did Open(Handle *pointer) and pass it that way using c++. Labview threads *pointer as an unsigned int32
05-15-2009 01:32 AM
Hello!
Yes I got that one working with the unsigned integer. However I did come a cross with a new problem. The function tries to return image buffer information in a char* table which should be allocated in LabVIEW not in the dll. The function prototype is as follows:
Capture(Handle ifaceHandle, char* buffer, int sizeX, int sizeY)
I have tried to allocate memory in the LabVIEW using initialize array and for loop but no success so far. The DLL says that it does not get the allocated memory buffer.
How should the allocation be done?