ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW and DLL

Hi

 

I'm making a project based on video acquisition with NI-IMAQdx. The goal here, is to grab images from an USB webcam, converting the images to arrays of pixel values, and then exporting those arrays to a buffer, which is implemented in C. Due to that, I have the idea to sending those arrays of pixel values continuously to a DLL file as an output, so I can catch them continuously with an external C-program and directly export the arrays to the buffer from the DLL file. As can be seen in the block diagram, I managed to export the arrays continuously to a .csv file, and I want exactly the same procedure to a DLL file, but don't know how to do it.
Untitled.png

Best regards

Oesen
0 Kudos
Message 1 of 9
(4,258 Views)
Do you have the dll written and compiled. Does the dll accept a 2D array of U32?

There is the wizard that allows you to import a dll as long as you have the .h file with the exported functions.
0 Kudos
Message 2 of 9
(4,244 Views)

Hi Dennis

 

I have builded a DLL file by creating a project from this VI, and then choosing "Shared library DLL" from the build specifications. I only want the arrays in this DLL file. I have figured out, that I also can use those two blocks in the block diagram shown on the picture. What is the benefits of using them ?.

 

Untitled.png

Best regards

Oesen
0 Kudos
Message 3 of 9
(4,224 Views)

Sorry but you are not making any sense. You can make your subVi that you posted into a dll but you can't then call that dll from the same  VI like you asked. I have no idea what you are trying to do now. 

 

Those images are senseless to me. You should know the function names.

0 Kudos
Message 4 of 9
(4,216 Views)

The main purpose with this VI, is to send or export 5 frames (arrays of pixel bytes) per second to a c-code. That's why I will created this DLL file. I don't want to call that DLL file from a VI. I have to call it from my c-code.

Best regards

Oesen
0 Kudos
Message 5 of 9
(4,201 Views)
The image in your first message shows you with a call library function node. That means you wanted to call a dll from the VI. If you want to call that VI from a c program, then build it but you have to modify it and eliminate the while loop like I already told you in a previous thread.

You still haven't said what those functions are in your other image.

In yet another thread you started, you were told the c program could call the imaq functions and you could skip LabVIEW. Why aren't you doing this?
0 Kudos
Message 6 of 9
(4,191 Views)

Hi Dennis

 

That call library function node was just a confusion, it shouldn't be there, sorry. The other problem is that, I use the while loop to adjust the captured frames per second with the grab function. If I eliminate it, I can't adjust it anymore.

 

In the other thread, they suggested me to call the IMAQdx functions from C, but video acquisition seems to be difficult in C compared to LabVIEW. That's why I used this solution instead

Best regards

Oesen
0 Kudos
Message 7 of 9
(4,184 Views)
The while loop stops when you have an error or when the stop button is pressed. You need to determine another way.
0 Kudos
Message 8 of 9
(4,173 Views)

I have tried a lot and concluded that I'll transmit the arrays by using the TCP/IP method instead.

Best regards

Oesen
0 Kudos
Message 9 of 9
(4,152 Views)