03-18-2009 05:58 PM - edited 03-18-2009 05:59 PM
03-18-2009 06:28 PM
03-18-2009 06:41 PM
Your are really spoonfeeding us information, one little bit at a time.
Why don't you attach all your code?
NaN means "Not a Number", most likely you are trying to take the square root of a negative number, for example.
03-18-2009 07:15 PM
Sorry for the inconvinence... here is the VI
03-18-2009 08:02 PM
03-18-2009 08:05 PM
03-18-2009 08:07 PM
03-18-2009 08:08 PM
The problem is your blue integer wires coming out of the missing subVI aren't big enough. The blue integers are I16 and per the context help can handle values (-37628 to 37627). If a value is 256 and you square it (not sure why you didn't use the X^2 primitive) that value is 65536. Too big for the I16 coming out. Add that to a similar number. Still too big for an I16. By the time its all done, you probably have things truncated down to a value that is a negative integer which causes you to get a Nan when you try to take the square root of a negative number.
If you are going to do math on such large numbers use at least I32 or I64, or double represenation. You may need to typecast the numbers before sending them to the square functions.
03-19-2009 03:22 AM
Unflatten pixmap, the sub vi which i made is same as unflatten pixmap from original functions. I just took the X and Y resolution as output from it. See actthment.
The x and Y values are the sizes of the inputed image. I attach an exapmle image also...336X362
03-19-2009 04:43 AM - edited 03-19-2009 04:52 AM
Hi I think you are feeding a negative number to the square root function. This will give a NaN output, and the Initialize Array Function will fail. Can find any other explanations. By the way. Have you familiarized your self with the debugging futures in Labview. They are your best friend I cases like this. If you keep it between us. Long time ago then I was new to Labview. Debugging was the last thing I learned to master. I trusted my own skills better, so debugging was not a topic
But If you replace the dimension size control with a constant you will not get an error. Perhaps this is a small programming flaw