LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

convert an integer to 12 bit integer


Rupali wrote:

Hello... 🙂

 

I have done a VI it's a bit lengthy.. But hope it helps you... 🙂

 

Atleast you will get an idea... 🙂

 

The VI is in LabVIEW 7.1...


 

Lengthy isn't the word for it.  I would suggest Rube Goldberg.Smiley Very Happy  The only thing it was lacking was a stacked sequence, but  your sort of "state machine" made that unnecessary.

 

What you did gives the same result as this bit of code using the Format into String function.

 

One improvement on this would be to AND the Numeric with 4095 to guarantee the number is forced within 12 bits before feeding into the format into string function.

 

But we still don't know if the original poster wants a string of 12 binary digits or something else.

Message Edited by Ravens Fan on 10-08-2008 01:32 AM

 

 

On second thought, maybe "bit" lengthy is the correct word for what you are doing.Smiley Very Happy

Message Edited by Ravens Fan on 10-08-2008 01:34 AM
Message 11 of 14
(1,995 Views)

OK, so you want to format your number as 12 digit binary number with leading zeroes. All you need is the following, it will give exactly the same result as your code monstrosity. 🙂

 

 

(Of course you should use a more reasonable representation than DBL.)

Message Edited by altenbach on 10-07-2008 10:30 PM
Message 12 of 14
(1,994 Views)

Dear Ravens Fan & Altenbach,

 

Instead of laughing at me it will be better to help others... Don't waste your time in laughing at people... If you can then try to help others... I'm a new comer I don't even know much of the functions from LabVIEW 7.1 but whatever I know I do try to use it and solve my problems.... 🙂

 

Thanks for the extraordinary reply... That make me feel happy... 🙂

 

Best of luck... 🙂

Message Edited by Rupali on 10-08-2008 01:08 AM
0 Kudos
Message 13 of 14
(1,983 Views)

Thank you all for the help and contribution. However, I would especially like to thank Rupali since he has the patient to understand what I was trying to say and thus, made other people understand and contribute. I would also like to note that some of us we use the Forum exactly because we are not top level LabView developers. In addition, English is not our mother language and also we do not have a scientific background that a professional programmer has. However, we use Labview successfully and trying to be better every day.

 

Best Regards and see you in next thread

0 Kudos
Message 14 of 14
(1,923 Views)