From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

retrieve camera data using pointers and activeX

Solved!
Go to solution

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

 

Certified LabVIEW Developer

0 Kudos
Message 1 of 5
(2,562 Views)

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 : )

Certified LabVIEW Developer
There are only two ways to tell somebody thanks: Kudos and Marked Solutions

GCentral
0 Kudos
Message 2 of 5
(2,527 Views)

Hi Emboar,

 

Thanks for the response. My question is more regarding to how to use pointers in labview when you do not have a DLL available. Thanks for the link thought!

 

-S

Certified LabVIEW Developer

0 Kudos
Message 3 of 5
(2,501 Views)

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!

Francine P.
Applications Engineering
National Instruments
0 Kudos
Message 4 of 5
(2,491 Views)
Solution
Accepted by topic author SergeB

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

Certified LabVIEW Developer

0 Kudos
Message 5 of 5
(2,418 Views)