06-08-2010 04:32 PM
Need some Labview help here...I'm stuck...
Need to...
Step 1 - Take a 1D array with 4 indexes Example: 0,153, 121, 249
Step 2 - Convert the array elements into their hex equivalent 0, 99, 79, F9
Step 3 - Concatenate the array indexes 09979F9
Step 4 - Convert the hex string into a decimal number 10058233
Any suggestions?
Thanks,
Aaron
Solved! Go to Solution.
06-08-2010 05:01 PM
06-08-2010 05:18 PM - edited 06-08-2010 05:19 PM
"Slightly" simpler: 😄
It is not clear if you want I32 or U32. Modify as needed.
06-08-2010 05:30 PM
"Slightly" simpler? This is truly remarkable. I had no idea that Type Cast was so powerful.
Maybe someone could come up with a Nugget on the many, many uses for Type Cast.
06-08-2010 05:47 PM - edited 06-08-2010 05:50 PM
OK, a lot simpler (bottom). 😉 A first simplification would be to get rid of the "nibbling" (middle). I am not sure why you are doing this (top).
All outputs are the same. 🙂
Of course the way the question was asked was a bit tricky, describing a complicated four step procedure when only one step is actually needed.
(In the grand scheme of things, there could be complications such as byte order.)
Yes, typecast is powerful, but extremely dumb at the same time:
In a first approximation, it does not change any bits in memory just looks at them differently. 😉
06-09-2010 09:15 AM - edited 06-09-2010 09:20 AM
Thanks folks! Exactly what I needed!....In the end a four step procedure is not important as I laid out my issue in the original post. It was just easiest to explain it that way on here so everyone could see exactly what I was trying to accomplish. The only thing that is important is the final solution.
This is a unique serial number ROM ID of a Maxim DS2431 1-wire EPROM and I am trying to ensure the unique ROM serial number is within a set range of values. I needed to convert it this way in order to make it easier to compare it to the pre-defined range of serial numbers.
06-09-2010 09:57 AM
A function you also can use is the Flatten To String Function/ Unflatten From String. It can be very useful then dealing with data that have different Endian format. You find those functions in the Data Manipulation Functions palette