LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to create control for 12bit integer.

Solved!
Go to solution

i want create control where i can write maxmium 2^12=4096 integer value.

0 Kudos
Message 1 of 17
(2,932 Views)

Hi rishijha,

 

use an I16/U16 control and change the allowed value range in its properties…

 

i can write maxmium 2^12=4096 integer value.

Btw. to store the value 4096 you need 13 bits!

With 12 bits you can hold values from 0 to 4095, inclusive.

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 17
(2,914 Views)

suppose i have 29bit number that is combination of D0 -D11 ,D12,D13,D14-D17,D18-D27 and D28.how to do this one in labview.

0 Kudos
Message 3 of 17
(2,886 Views)
Solution
Accepted by topic author Risuraj

Hi rishijha,

 

use a 32bit integer!

 

Computers/CPUs (usually) use a fixed set of datatypes, all of them containing multiples of 8bit (aka bytes). So whatever you want to store needs to fit into those datatypes: 12bit fit into 16bit datatypes, 29bits fit into 32bit datatypes…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 17
(2,866 Views)

ok i assigned like that now i want to add all bit and form 32bit.so which lab view function i can use.

0 Kudos
Message 5 of 17
(2,856 Views)
Solution
Accepted by topic author Risuraj

Hi rishijha,

 

suppose i have 29bit number that is combination of D0 -D11 ,D12,D13,D14-D17,D18-D27 and D28.how to do this one in labview.

What's the point of separating bits #0 to #28 in 6 groups? Why not keep all bits in just one integer???

 

now i want to add all bit and form 32bit.

Why (and how) do you want to "add all bits"? ("add" in the same way as the math "add" operation?)

Maybe you want to build an array of all bits (using BuildArray) and then convert the BooleanArrayToNumber???

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 17
(2,853 Views)

@Risuraj wrote:

suppose i have 29bit number that is combination of D0 -D11 ,D12,D13,D14-D17,D18-D27 and D28.how to do this one in labview.


Earlier, you talked about a "control" and you already learned how to limit the range of values that can be entered. Now, out of the blue, you start talking about "D"s. What are these, what do they represent, where are they coming from, and what is "this" you want to do?

0 Kudos
Message 7 of 17
(2,826 Views)

What's the point of separating bits #0 to #28 in 6 groups? Why not keep all bits in just one integer???

these group have different meaning in my application.every time i am changing these bit value in my program.

Maybe you want to build an array of all bits (using BuildArray) and then convert the BooleanArrayToNumber???

i want to combine these bit and pass in to U32 bit numeric control.

0 Kudos
Message 8 of 17
(2,788 Views)

HI rishijha,

 

i want to combine these bit and pass in to U32 bit numeric control.

What have you tried so far?

Do you already use BuildArray and BooleanArrayToNumber?

And why do you want to display the result in a control? Don't you use indicators to display data?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 17
(2,782 Views)

@Risuraj wrote:

i want to combine these bit and pass in to U32 bit numeric control.


A "control" is a data source. Typically data is passed to an "indicator". Please clarify.

0 Kudos
Message 10 of 17
(2,776 Views)