03-13-2009 12:48 PM
Solved! Go to Solution.
03-13-2009 01:16 PM
Make a 1-D array of U8: 0x00, 0x01, 0x02, 0x03, ..., 0xFF
George ZOU
http://www.geocities.com/gzou999
03-13-2009 03:59 PM
03-13-2009 04:15 PM
03-13-2009 04:34 PM
Thank you very much for the help. But still I am not understanding this correctly.
1)- First of all why hexadecimal?
2)- Second: I am using a loop to generate a 1D array of unsigned 8 bit integers from 0 to 255. I am using the loop counter "i" to do that. I tried to convert the loop counter to hexadecimal, but I was not sure how.
3)- Also, I could not get an 0x to appear at the left corner of a number after I changed the representation to hexadecimal.
4)- I did not find a function that takes a number and converts it to hexadecimal. I am using LabVIEW 7. Where is this function?
Sorry for asking too many questions. I hope you will have time to answer.
03-13-2009 05:35 PM
Jahan wrote:Thank you very much for the help. But still I am not understanding this correctly.
1)- First of all why hexadecimal?
I don't think George had any particular reason. Sometimes it's just easier to represent numbes in hexadecimal format. It's still the same number, it's just displayed differently. Hex FF = decimal 255. Same number.
2)- Second: I am using a loop to generate a 1D array of unsigned 8 bit integers from 0 to 255. I am using the loop counter "i" to do that. I tried to convert the loop counter to hexadecimal, but I was not sure how.
You don't need to do that. The values of the numbers is what's important, and as I indicated it will still be the same whether you display it in decimal or hexadecimal format.
3)- Also, I could not get an 0x to appear at the left corner of a number after I changed the representation to hexadecimal.
You need to enable the "radix" display. When you right-click on the constant or control and select Properties it's on the Appearance page, marked "Show radix".
4)- I did not find a function that takes a number and converts it to hexadecimal. I am using LabVIEW 7. Where is this function?
There isn't one because there's no need to do so. The value of the number doesn't change. There are, however, functions to convert from/to hexadecimal strings, but that's something different.
03-13-2009 07:01 PM
03-14-2009 10:36 AM
03-14-2009 11:56 AM - edited 03-14-2009 11:57 AM
Jahan wrote:The problem seems to be solved this way. Although it seemed to work (I got a gray scale image), I am not sure if what I have done is technically correct (if there is a better way of doing it). If someone wants to comment on it, I would appreciate.
Yes, this is technically correct (top). (Typically you can do it once, then right-click the indicator and "change to constant" and delete the loop code.)
You might also flatten the rgb tool code to the diagram (bottom). This has the advantage that the entirel loop will be calculated once at compile time and internally folded into a constant so the loop actually never spins during execution of the program (See also). (Of course this particular loop is trivial and nothing to worry about, performance wise. ;))
03-14-2009 01:10 PM