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: 

DLL Pointer within a Cluster

Solved!
Go to solution

Nathan,

 

I tried your solution but it kept crashing. I left it over the weekend and rebooted today. It crashed immediately, then worked the second time (from restarted labview) around, seemed quite stable, but later it started crashing again. It makes no sense 😞

I am going to install a basic labview on another computer, see what that brings me.

 

Thanks for all your help sofar!

 

BR,

Frank

 

0 Kudos
Message 21 of 35
(1,494 Views)

fdewit wrote:

I tried your solution but it kept crashing. I left it over the weekend and rebooted today. It crashed immediately, then worked the second time (from restarted labview) around, seemed quite stable, but later it started crashing again. It makes no sense 😞

I am going to install a basic labview on another computer, see what that brings me.


If you attach your code I'm happy to take a look at it.  It's easy to make a mistake with pointers, especially if you haven't used them in C.

0 Kudos
Message 22 of 35
(1,492 Views)

I tried my code on two computers (LV2011). It would crash sometimes at either, usually when run the first time after booting then starting the labview environment and opening the project. However, when it runs it works fine. I ran a set of 2400 files through it without any problems, no  apparent memory leaks, nothing.

 

I've written a batch converter on top of it, this will export your choice of TDMS and/or FLD (array of single precision floating point scaled to the approproate engineering units).

To be able to test these files I've added two tools and I've also made an installer for the project (first run the executable builder, then the installer builder).

 

Note that this version only takes the first history group from the Yokogawa WDF file and only does 'normal' mode.

 

Anyways, here is the project, hopefully it will be of use, and I would be grateful if somebody could figure out why it crashes sometimes.

 

Best Regards and thanks for the help,

 

Frank

0 Kudos
Message 23 of 35
(1,481 Views)

Hi;

 

Can you send file in LabVIEW 2009 version?

 

thank

0 Kudos
Message 24 of 35
(1,404 Views)

Hi Nathan,

 

I'm trying to debug my application as weel, which uses flycapture and triclops dlls to perform image acquisition from a point grey bumblebee 2 camera and then perform stereo processing using the triclops dll. After going through the posts in this forum, I'm still not able to receive any data from the dlls. I have set them up exactly the way people have recommended in this forum, but i still haven't had luck.

 

I'm having trouble with "flycaptureGrabImage2" function that is supposed to get the image from the camera, and then store the image data as a pointer. But when I call the function, I'm not receiving any data. I have attached my VI and also the API.

 

Triclops sdk: http://www.cs.ucdavis.edu/~amenta/3dphoto/triclops.pdf

Flycapture sdk:http://www.cs.unc.edu/Research/stc/FAQs/Cameras_Lenses/PtGrey/pgrFlyCaptureManual-v1.4.pdf

 

The prototype looks like:

PGRFLYCAPTURE_API FlyCaptureError PGRFLYCAPTURE_CALL_CONVEN
flycaptureGrabImage2(
       FlyCaptureContext   context,
       FlyCaptureImage*   pimage );
 

typedef struct FlyCaptureImage
{
   // Rows, in pixels, of the image.
   int iRows;
   // Columns, in pixels, of the image.
   int iCols;
   // Row increment.  The number of bytes per row.
   int iRowInc;
   // Video mode that this image was captured with.  This member is only
   // populated when the image is returned from a grab call.
   FlyCaptureVideoMode videoMode;
   // Timestamp of this image.
   FlyCaptureTimestamp timeStamp;
   // Pointer to the actual image data.
   unsigned char* pData;
   //
   // If the returned image is Y8, Y16, RAW8 or RAW16, this flag indicates
   // whether it is a greyscale or stippled (bayer tiled) image.  In all
   // other modes, this flag has no meaning.
   //
   bool bStippled;
   // The pixel format of this image.
   FlyCapturePixelFormat pixelFormat;
   // This field is always 1 for single lens cameras.  This field is
   // used to indicate the number of images contained in the structure
   // when dealing with multi-imager systems such as the Bumblebee2
   // or XB3’
   int iNumImages;
   // Reserved for future use.
   unsigned long  ulReserved[ 5 ];
} FlyCaptureImage;
0 Kudos
Message 25 of 35
(1,320 Views)

Can you save back to LabVIEW 2012? I don't have 2013 installed on the machine in front of me. If not, I'll try to remember to take a look at it later when I do have access to LabVIEW 2013.

0 Kudos
Message 26 of 35
(1,316 Views)

Here is the 2012 version. Please let me know if you'd like to have the dll files too.

0 Kudos
Message 27 of 35
(1,304 Views)

Hm, that still seems to be saved in 2013.

0 Kudos
Message 28 of 35
(1,298 Views)

My Bad, here it is:

0 Kudos
Message 29 of 35
(1,294 Views)

I don't have a definitive solution, so instead here are a bunch of comments.

 

- Don't try to move more bytes than you allocate for the destination. You configured MoveBlock to move 1572864 bytes, but the destination array is only 40 bytes. That is likely to cause a crash.

 

- Clean up your code! There is no need for the sequence structure. The clusters should be type definitions, so you don't have to duplicate bundling them and so if there's an error in one of them, you only have to change it once.

 

- Make sure you function prototypes are correct. MoveBlock has no return value; why configure it with one?

 

- Why is the Triclops part relevant? I don't see any interaction between those VIs and the FlyCapture ones, so start by getting just one part working.

 

- Do some of the FlyCapture functions work? At what point do they stop working? Does the GrabImage2 function fill any values into the struct? Check Error Out from every DLL call.

 

- Dispose of every pointer you allocate. Right now you don't clear one of them. I don't see documentation for the PrepareStereoImage function, but it might be a bad idea to wire the same pointer to two different inputs, if that function expects to fill different information to each one of them.

0 Kudos
Message 30 of 35
(1,285 Views)