05-08-2018 03:20 PM - edited 05-08-2018 03:23 PM
We have a customer who wants to use LabVIEW with our cameras. Our cameras are not standard cameras that follow Gige Vision protocol, so we cannot use off the shelf IMAQ. Our objective is to provide a LabVIEW VI (similar to a driver) to our customer. The SDK we have for this camera is based on ActiveX and we use ActiveX in LabVIEW to call methods.
I am trying to do the following but unsuccessful:
1. I create a (1) dimensional array that has the size equal to the width and height of the image (able to do this one)
2. I would like to create a pointer to this array, so when I call the activeX method called “write to short array”, the camera will write data to the array I defined in step (1). Right now, this array returns zeros.
I've only used pointers in LabVIEW with DLL calls. Since labview usually does all the memory allocation for me, not sure how to approach it here. I tried reading up on here on LabVIEW Memory Managing, which seems like the right direction (using DSNewPtr with LabVIEW shared library), but i'm still not clear on what to do.
I need to know which location in labview memory to point to so that i can view the camera data on my labview front panel.
Don't have code to post at the moment so hope this is making some sense.
thanks!
(using LabVIEW 2017, Windows 10)
- S
Solved! Go to Solution.
05-08-2018 10:35 PM
Hi SergeB, Im not famiilar with DLL pointer but there was no reply to your post, I posted.
Is this documents helpful for your objective?
Passing and Receiving Pointers with C/C++ DLLs from LabVIEW
I with your success : )
05-09-2018 04:10 PM
05-10-2018 09:46 AM
The closest thing to a C pointer in LabVIEW is a Data Value Reference. Here's some information on the Data Value Reference function and how to use it, including an example:
Reducing Memory with Data References
You can also check out this forum post which might provide some insight.
Hope this helps!
06-04-2018 04:43 PM
So after several phone calls with tech support, we figured that i was heading in the right direction. I needed to use two CLFN's. The first CLFN is used to create a pointer (DSNewPtr) to an appropriately size block of memory for my array.
Then, once i get the output pointer from my AcquireToShortArray function, I need to move that information into an actual array structure in LabVIEW, which is done with a 2nd CLFN and LabVIEW's MoveBlock function. With the "src" being my returned pointer, "dst" being the size of my desired output array and "size" being how much data i would like to move from the original memory block. That did it! ^_^
-S