LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Array conversion help....

Solved!
Go to solution

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

 

 

0 Kudos
Message 1 of 7
(4,016 Views)

Here is a tool to do it:

 

HexConvert.png

 

The vi in LV2009 is attached:

 

- tbob

Inventor of the WORM Global
Message 2 of 7
(4,002 Views)

"Slightly" simpler: 😄

 

 

 

It is not clear if you want I32 or U32. Modify as needed. 

 

 

Message Edited by altenbach on 06-08-2010 03:19 PM
Message 3 of 7
(3,996 Views)

"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.

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 4 of 7
(3,978 Views)
Solution
Accepted by topic author aaronb

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. 😉

Message Edited by altenbach on 06-08-2010 03:50 PM
Download All
0 Kudos
Message 5 of 7
(3,966 Views)

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.  

Message Edited by aaronb on 06-09-2010 10:20 AM
0 Kudos
Message 6 of 7
(3,907 Views)

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

 



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 7 of 7
(3,871 Views)