01-04-2008 11:34 AM - edited 01-04-2008 11:37 AM
One serious problem that remains is race conditions! (as well as extra data copies and unecessary calculations)
For example if the user presses open, it is very likely that the local variable "imagedata" gets read at position 2 before the value gets updated at positions 1. You spin another loop with stale data, recalculating what you already calculated 200ms earlier. Same with the resolution locals. In addition, the local variable forces another datacopy in memory. Also the "boudries" local is useless, just branch the wire to the two places the control is used and delete the local.
A similar problem occurs with the SAVE case structure. For every iteration, there is no way to tell which of the case structures executes first becase you broke the dataflow!
It is also completely useless to recalculate that entire code every 200ms. A recalculation is only needed if one of the controls change.
All you need is a while loop with four shift registers for the four local variables (Imagedata,resx, resy, infos) and an event structure. Add an event case for "open: value changed", another one for "save: value changed" and a main one for any of the other controls.
All property nodes that are wired to constants (e.g. A-scan:scale multiplier) need to go outside the loop. They need to be set only once and not every 200ms.
01-04-2008 12:13 PM
01-04-2008 12:33 PM
01-07-2008 05:19 AM
Hi GerdW,
I am really very thankful to you for your help,
I tried programme that you modified with my system but unfortunately there is no more difference in working speed, Is there any other alternative to reduce the size of arrays? i mean in my programme i use correlation method but i think it is taking much time and not giving wanted result.
Wanted Result: Should be eliminate same line of data.
with regards,
dipen
01-07-2008 05:49 AM
Hi altenbach,
Thank you very much for your suggestions, In my case i will use this programm as realtime scanning, means continuously new data are entering in and result is going out,
but yes race condition will occurs in case of save data. I will improve all the important points you have suggested.
Thanking you once again,
with regards,
dipen
01-07-2008 06:05 AM
01-07-2008 06:24 AM
HI GerdW,
First point:-Yes i delete older code, and then after i run it.
second point:- My mistek of writing, want to delete similar lines.
with regards,
dipen