Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Imaq grab with MC1362 causing crashes when program allocates memory.

I have programmed with the Mikrotron MC1310 through a national instruments framegrabber before. I am now trying to use a MC1362 on the same framegrabber and drivers. I have modified the icd file to exclude binning. I am trying to update my software to work with this camera.

 

The software now seems to be very unstable, i can get a grab to work, but the program will usually crash the next time i try and allocate any reasonably large ammount of memory after the grab function has been called and read out (e.g creating an array of about 300,000 ints causes a crash). I am programming in C#, the program will crash without giving any usefull debug information. I am not sure if the copy of the imaq drivers i am using are very up to date. I am looking for any ideas about what could be causing this. Could an update help, would that stop other software that is dependent on imaq.dll from working? Are there any settings that could be wrong in the .icd that could cause an issue like this?

 

Thanks,

0 Kudos
Message 1 of 6
(4,667 Views)

Hello O Jones,

 

I am not sure whether the use of that amount of memory causes the crash, so would you mind telling us which framegrabber you are using?

The two cameras you are using seem to come from the same family, but your new one has significantly higher spec which might have an effect on the acquisition.

I doubt an upgrade on the drivers will cause issues with other software, but again it depends on how old the drivers you are using at the moment are.

When did you last update the drivers? Can you check which version it is you are using right now?

 

Hope to hear from you soon,

Kind Regards,

Michael S.
Applications Engineer
NI UK & Ireland

0 Kudos
Message 2 of 6
(4,639 Views)

Hello O Jones,

 

Did you manage to resolve the issue you were dealing with?

Please do let me know how you are getting on and whether we could help further.

If your application is running with no problems now, would you mind posting how you overcame the problem along with what you were using from National Instrument products?

This would be much appreciated.

 

Kind Regards,

Michael S.
Applications Engineer
NI UK & Ireland

0 Kudos
Message 3 of 6
(4,579 Views)

I managed to solve the problem. It was not hardware related as i thought. In updating the software from the MC1310 to the MC1362 i had started using one more function from the imaq driver without thinking about it. I started using "imgInterfaceQueryNames" which should return an array of characters that represent the name of one of the interface boards on the computer. This value is then used to connect to a specific interface board.

 

I am using C#, as the data types are a little different i found it troublesome getting the function to work, i think this is why it was never used in the software before.

 

The helpfile states that this should be the interface : rval = imgInterfaceQueryNames(uInt32 index, char* name);

 

I tried interfacing with this method, but it would not work. I think the problem was the character array. I managed to get it to work by interfacing to the character array as a byte array, then casting the bytes back into characters later on.

 

        [DllImport("imaq.dll", EntryPoint="imgInterfaceQueryNames", ExactSpelling=true)]
        internal static extern int imgInterfaceQueryNames(uint index, [In, Out] byte[] queryName);

 

This worked perfectly, it would return the correct value 'img0' and never returned an error code. However after this function is called, any significant memory allocation in my program would cause a massive crash. Using MS Visual C# it would either confuse the debugger, or cause Visual C# to crash too. I have no idea why such a simple function could siliently kill an app like this. Removing the use of this function fixed all my problems. As the computer only has one interface on it, i started automatically connecting to 'img0' and bypass the need for this function.

0 Kudos
Message 4 of 6
(4,563 Views)

Hello O Jones,

 

I am glad your application is running with no problems now.

Thank you for posting your workaround, it is much appreciated.

 

Please do not hesitate to post back with anything further,

 

Kind Regards,

Michael S.
Applications Engineer
NI UK & Ireland

0 Kudos
Message 5 of 6
(4,560 Views)

Hello,

 

I'm writting you because I'm setting up a new equipment of Magnetic Tweezers, which will be managed by Labview Vi. I'm using a frame grabber NI PCIe-1433 and the MC1362 camera. I installed the PCIe and wondows 7 said that it was all the drivers all right, I accesed to Max to configure it, and it detects the Pci but it doesn't show chanel 0 or any feature from the camera, in addition the next time I run Max it shows a warning msg with some problems in the last sesion.

I have checked the "Data" folder and it doesn't have any .icd file with the features from the camera, I think it might be the problem, do you know where could I get it? Because I don't fell confident creating a new one by myself.

Sorry, I'm really new using this staff.

 

Thanks in advance.

0 Kudos
Message 6 of 6
(3,798 Views)