From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, 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: 

crash and 0xC0000005 error passing pointer to array

Solved!
Go to solution

Well one thing which really would help with that is to use an event structure. Currently you keep setting all the various properties in every single loop iteration. That is not only bad for performance but can also influence the underlaying DLL operation as it may reset its operation each time.

 

Instead add an event structure inside the loop and then create event cases for all controls that the user can change. In each of those cases you then call the according function to change the appropriate property. The Acquire button will then be handled in its own event case too. This makes your application not only more easy to overview but also groups the logic for each user action more intuitively together than your current decoration frames and sequence structures.

 

Have you also checked if any of the HPixel and VPixel values would indicate the actual number of pixels of the CCD sensor? If so it would be a good idea to wire the CCD size constant inside GetProfile to another control on the frontpanel of that VI and connect it to the connector pane. Then you can actually wire the correct numer of pixels from the (calculation of) those values to GetProfile and don't depend on a magic number that could go wrong again after you change something on the sensor or its configuration.

Rolf Kalbermatter
My Blog
0 Kudos
Message 11 of 12
(288 Views)

Thanks Rolf !

 

I've built the event structure, placing every setter in a event, and getters in the timeout event (happends every 10 ms, and getters do not access the memory during measure). Created also an event for getProfile, and seems to work fine !

 

Thank U very much !

0 Kudos
Message 12 of 12
(277 Views)