Saturday, November 24, 2018



ANK LABS
  
NUMERIC DATA TYPES





In my previous blog post/youtube video we saw Boolean data type and different kinds of controls and indicator. Similarly Numeric data type have different kinds of controls and indicator too. Additionally we will see the functions of Numeric control pallet.




Today we will discuss the functions and usage of Numeric pallet we will cover the following portions.


-          Addition
-          Subtraction
-          Multiplication
-          Division
-          Quotient and Remainder
-          Increment
-          Decrement
-          Compound Arithmetic
-           Absolute value
-          Round to nearest
-          Round Toward – Infinity
            Round Toward + Infinity
-          Scale By Power Of Two
-          Square root
-          Square
-          Negate
-          Reciprocal
-          sign
-          Constant
-          Random numbers




LET’S GET STARTED:-

Under Boolean data type we got switches and indicators such as push button led etc. similarly numeric data types we got.


Numeric (Control and Indicators)

          

   






It is used to enter and display numeric dada.

Time Stamp


              It is used to send and receive time, date, year updates.

Fill Slides



             It is used to display numeric data in vertical and horizontal slide, it can also be used as indicators with customizable scale.

Pointer slides


             Similar to that of a Fill Slider, Additionally they got a pointer which help you see the exact value.

Progress Bar


           Shows the progress in vertical or horizontal bar.

Graduated Bar


           A progress Bar with customizable dividers which can be used to divide/break up the values in equal parts.

Knobs, Dials, Meters, and Gauges




              Can be used to control or display numeric data in rotatory action.

Tanks and Thermometers


              Displays numeric data in vertical slides which resembles a real time tank or thermometer.

Scroll Bar


             Displays numeric data in vertical as well as horizontal that scrolls through data by dragging, scrolling mouse wheel, incrementing and decrementing arrow etc.


All these controls and indicator can also be used has a control or indicator if required.




                                                                                                      
NUMERIC DATA TYPE

All this functions can be used if we connect controls and indicators to respective terminals.
 Addition

                Sum two input.

Example:-

                2 + 2 = 4


Subtraction

            
    Find difference of two input.

Example:-

                2 - 2 = 0


Multiplication

            
   Product of two input.  

Example:-

                2 * 2 = 4


Division

              
  It can only find the quotient of two input.

Example:-

                2 / 2 = 1


Quotient and Remainder

        
        Computes both quotient as well as remainder for the given input.

Example:-

              If input is 7 & 2 then our                quotient = 3
                                                                    Remainder = 1


Increment

          
Increments the value by one (add 1 to the input).

Example:-

                (Number) + 1 = number + 1
                               5 + 1 = 6

Decrement

       
    Decrement the value by one (subtracts 1 from the input). 

Example:-

                (Number) - 1 = number + 1
                               5 - 1 = 4

Compound Arithmetic
            
   Performs Arithmetic operation on one or more data given to it. We can also perform some basic logic operations on the data using compound Arithmetic.

Example:-
                 5+2+1+4+3 = 15
                               Or
                                              1*2*3*6 = 36
                            
 Absolute value

             
      Returns the absolute value of input, If we are working with complex number such as
                  X = a + bi
                      =52 + 62i
Then the absolute value abs(x) =
                                                     = 80.9197
                     
Round to nearest

        
    Rounds the input to its nearest value
Example:-

              52=52
              (52.0) to (52.5) = 52
              (52.6) to (52.9) = 53

Round Toward – Infinity

      
  Truncates the input to the next lowest integer.

Example:-

         If the input is 6.8, the result is 6.
       Similarly If the input is –6.8, the result is –7.

Round Toward + Infinity

             Rounds the input to the next highest integer.

Example:-

                               If the input is 3.1, the result is 4.
                               Similarly if the input is –3.1, the result is –3.
                              (3.1) to (3.9) = 4

Scale By Power Of Two

        
  This one simply Multiplies x by 2 raised to the power of n.
             Output = x*2^n

Example:-

         If x=2, n=o
                                    Output = 2*2^0 = 2
                                     Similarly
                                       When x=2, n=2
                                        Output = 2*2^2 = 8

Square root

       
    Computes the square root of the input value.

Example:-

            Square root of 2 = 1.41421


Square

        
Computes the square of the input value.

Example:-

               Square of 3 = 9

Negate

              Negates the input value.

Example:-

                                 5 = -5
                                 Similarly
                                -5 = 5

Reciprocal

              
  Divides 1 by the input value. That is the input value is taken as 1/input value.

Example:-

           2 = ½ = 0.5

sign

         Returns the sign of number.

Example:-

                              5 = 1
                             -5 = -1
                              0 = 0

Constant

      

    Numeric constant – instead of providing the value each and every time we can keep a number as constant whose value cannot be changed by the user.

Random numbers

       
  In labview this functions produces random values, it is similar to that of throwing a dies we get random values with any sequence the same way this functions generates random numbers.


                                      
A vi file containing all numeric control and indicator

                                                     DOWNLOAD

A vi file containing all numeric function.

                                                     DOWNLOAD