LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

generate a unique number from two numbers

hi
i need to generate a unique number from two given numbers.wat operations do i perform on the two input numbers?
0 Kudos
Message 1 of 6
(4,052 Views)
Are the inputs integers or floating point ?
Does the generated number need to be integer or floating point ?
0 Kudos
Message 2 of 6
(4,050 Views)
one input is an integer and the other is floating point.both are positive.the genrated number has to be unique irrespective of its format

Message Edited by psychic on 04-20-2005 04:02 AM

0 Kudos
Message 3 of 6
(4,042 Views)
OK, I think you will have to append the numbers to get a unique number, but to demand that this unique number is independent of the format of the two original numbers is a bit awkward. In order to append the two numbers and have them unique independently of original format, you can convert the numbers into boolean arrays, pad to 128 elements (128 bit array will allow for all numbers to be included, up to EXT) and then append them.

The problem is only that you won't really be able to convert back to any number which you can then display in LabVIEW. You could of course convert back to an aray of U32, but I don't think the series of displayed numbers will really be very intuitive.

The whole problem would be much easier if you could fix the format of the numbers to be combined......

Hope this helps

Shane
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Message 4 of 6
(4,024 Views)
Hi psychic

If you are looking to create a single number then a double (8 bytes) is the only real option.
You will be limited to a Single (4 byte) floating point and a 32 bit (4 byte) integer. You can then concatenate these two values to produce a unique double. See the attached example.

Hope that helps.
Neil
0 Kudos
Message 5 of 6
(4,024 Views)
hey thanks a lot neil..ur vi works perfect
0 Kudos
Message 6 of 6
(4,018 Views)