05-01-2011 01:44 PM
Hi
I have a problem (perhaps very simple to solve). I have a cluster with 3 integers inside. I`m building an array of these elements (after unbundling my cluster) and I want to sum all these elements. However, my result is not satisfying. For example: my array: [255,255,238] and LV shows me sum of these elements: 236.
Probe 6 on my printscreen: my array
Probe 7: result of sum operation
What am I doing wrong? Thanks in advance
Solved! Go to Solution.
05-01-2011 01:51 PM - edited 05-01-2011 01:54 PM
Your datatype seems to be U8, so the maximum value can only be 255. (It is a bit hard to read because of the image scaling). Why don't you attach the VI instead?
If you need the real sum, you need to convert to a different representation (e.g. U16) first.
Also, what is the purpose of the FOR loop? Since it only runs for one iteration, you might as well delete it.
05-01-2011 02:58 PM
How didn`t I notice that ? 🙂 Thanks a lot - I knew it was stupid.
And about that loop - it will be more than 1 iteration (number of snapshots taken by cam and saved to bitmap file), but I`ve changed it for a while for easier debugging.
Thanks once again.