Question on Labview

Discussion in 'Programmer's Corner' started by cnguyen, Oct 23, 2009.

  1. cnguyen

    Thread Starter New Member

    Oct 19, 2009
    6
    0
    Hi,
    Can you please show me how to transfer it to Labview program? This is a piece of code how to convert a decimal number to binary number ( 8 LEDs will active on and off for "1" and "0". Thanks for your help. Here you go!

    If Number > 255 Then
    Message " not convertable"
    Exit
    end if

    If Number < = 255 And Number > 127 Then
    turn on = "LED 1 on"
    Number = Number - 128
    Else
    turn on = "LED 1 off"
    End if.
     
  2. odinhg

    Active Member

    Jul 22, 2009
    65
    15
    Convert the number into a boolean array and reverse it should do the trick. Since the numeric control is unsigned 8 bit it can't have a value higher than 255 anyways. But if you use a unsigned 16 bit you can check if the number is over 255 and put the conversation in a case structure. If the number is over 255, display you message box.
     
  3. t_n_k

    AAC Fanatic!

    Mar 6, 2009
    5,448
    782
    This was my crude attempt....
     
Loading...