Hello Ananda
You can do this by first wiring your digital control to a "Number to
Boolean Array" function (Boolean Palette). This converts the number to an
array of True and False Values. Then wire the output of the "Number to
Boolean Array" function (a green line) to a "Boolean to (0,1)" function,
and this converts the True's to 1, and the False's to 0. Then wire this (a
blue line now) to an "Array to Spreadsheet String" function ("array"
input), with a string constant "%d" (no quotes) wired to the "format
string" input, and an empty string constant wired to the "delimiter"
input. The out put of this function should be the string you want.
If you didn't understand some of this, contact me and I can email it to
you.
Paul Davey
Ananda Dave wrote:
> Hello Labv
iew People:
>
> I'm rather new to Labview, so this may be a simple-minded question . . .
>
> I would like to take a numeric control and have the decimal input
> converted to a binary string of 8 bits. So, for example, if I were to
> put in the number '127', I would get out (on an indicator) the string:
>
> 01111111
>
> The number '128' would show on the indicator as:
>
> 10000000
>
> It seems to me that this should be simple, but somehow I cannot figure
> out how to do it. Must an array be built bit by bit to accomplish this?
> (I'm afraid I don't yet know how to build arrays.)
>
> Thanks in advance for any help you provide!
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
--
Research Assistant
School of Physiotherapy, Curtin University of Technology
Selby Street, Shenton Park, Western Australia, Australia. 6008
email: P.C.Davey@curtin.edu.au
Tel. +61 8 9266 4657 Fax. +61 8 9266 3699
"Everyone who calls on the name of the Lord will be saved." Romans 10:12
"For all
have sinned and fall short of the glory of God, and are justified
freely by his grace through the redemption that came by Christ Jesus."
Romans 3:23-4