LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

using pixelink software development kit with labview

hi,
i am currently using the pixelink camera pl b741 f, however i am facing a problem when i use the "get frame dll" in labview.
my program works when in highlight execution mode, however when i run it in normal mode i get the following message:

Labview: an exception occurred within the external code called by a library node function node. This might have corrupted labview's memory. Save any work to a new location and restart labview. VI "amol_getimage.vi" was stopped at node "" at a call to "MEPU- acquisition-getframe .vi"

can you please help me!

thanks

amol

 

0 Kudos
Message 1 of 12
(4,359 Views)


@amolchoudhary wrote:
hi,
i am currently using the pixelink camera pl b741 f, however i am facing a problem when i use the "get frame dll" in labview.
my program works when in highlight execution mode, however when i run it in normal mode i get the following message:

Labview: an exception occurred within the external code called by a library node function node. This might have corrupted labview's memory. Save any work to a new location and restart labview. VI "amol_getimage.vi" was stopped at node "" at a call to "MEPU- acquisition-getframe .vi"

can you please help me!



It's simple! You made an error in the configuration of your Call Library Node. It could be a number of reasons but the two most likely ones are that you get a variable wrong to be passed by Value while it should be by Reference or vice versa, or that you call the function which expects a buffer it can write in the results (the image frame is a likely candiate) and didn't create a large enough buffer in LabVIEW to be passed to the function.

I actually think this last one is by far the most likely reason here and in fact the number 1 error done by most people that try to interface to a DLL through the Call Library Node. DLLs come from the C world and want to be called like that and one important rule there is that memory buffers to be filled, must always be created by the caller. This is different in LabVIEW itself since LabVIEW manages all the memory for you and allocates it whenver necessary but this can't work for calling DLLs as LabVIEW has ABSOLUTELY no way to know what a DLL function might need as memory buffer.

You can create such a buffer by either executing the Initialize Array function with the correct parameters or in LabVIEW 8.2 you can directly configure array and string parameters in the Call Library Node configuration to create the necessary buffer. I prefer the Initialize Array variant since the other one is a LabVIEW 8.2 only feature and creates a fixed size buffer while for your frame buffer you will likely have to allocate a memory buffer whose minimum size depends on the bitmap format and bitmap size the function is going to return.

Rolf Kalbermatter

Message Edited by rolfk on 06-29-2007 07:27 PM

Rolf Kalbermatter
My Blog
Message 2 of 12
(4,352 Views)
Dear Rolf,
 
Thanks for your help. I will try using a buffer the next time.
 
Regards,
 
Amol
0 Kudos
Message 3 of 12
(4,306 Views)
Hello, I join the finished conversation because I'm using the PL-B742U-BL Pixelink camara with the SDK. I can vizualise the motion but I would like to capture it in a "Image" in my VI and not in a window. I'm excavating in the VI's but I can't find the good exist on witch I could conect my wire of my image indicator.
 
Can you help ?!
0 Kudos
Message 4 of 12
(4,180 Views)
Hi Nicobono,

Thanks for posting on the NI forums! Could you post a screenshot of your code so I can see the VIs you are using? If you are using the IMAQ VIs, you can just right click in the Image output of the acquire VI and select create >> indicator. That will create an image indicator on the front panel.

Regards,
Maclean G.
Applications Engineering
National Instruments
0 Kudos
Message 5 of 12
(4,153 Views)
Thank you for your answer, in fact I don't have the access to an graph or an image indicator at the exit of a VI. My output is only a raw of number. I think this raw is my image but I can't work with such a representation...here is a print sreen of my VI.
0 Kudos
Message 6 of 12
(4,111 Views)
Hi Nicobono,

If you have the array representing an image, you can use the IMAQ Array to Image VI to convert the array into an image.  To use the VI, you will have to create an image buffer (IMAQ create VI), and wire that into the array to image VI.  The array to wire is circled below.



I hope this helps!

Message Edited by Maclean on 09-18-2007 01:29 PM

Maclean G.
Applications Engineering
National Instruments
0 Kudos
Message 7 of 12
(4,100 Views)
Tank you for the answer. Unfortunatly the VI Array to Image uses a 2D array, my array is 1D it does not work like that. Do you have another solution ? I send you a print sreen of my error and my VI's I got with the SDK.
 
Thanks a lot.
 
Nicolas
Download All
0 Kudos
Message 8 of 12
(4,086 Views)


@nicobono wrote:
Tank you for the answer. Unfortunatly the VI Array to Image uses a 2D array, my array is 1D it does not work like that. Do you have another solution ? I send you a print sreen of my error and my VI's I got with the SDK.
 
Thanks a lot.
 
Nicolas


An image contains rows and columns. This can be flattened to a single 1D array which is what you have but in order for the IMAQ functions to know how to format the data it needs to know the height and width of the image. You can do this very simple by resizing your 1D array into a 2D array. All you need to do is simply get the actual width and height for your image somewhere from your pixellink software.

Rolf Kalbermatter

Message Edited by rolfk on 09-19-2007 04:05 PM

Rolf Kalbermatter
My Blog
0 Kudos
Message 9 of 12
(4,073 Views)
Hi Nicolas,

Attached is an example VI to show you how to resize the Array and create an image out of it.

Hope this helps,
Maclean G.
Applications Engineering
National Instruments
0 Kudos
Message 10 of 12
(4,059 Views)