Question on Labview

Thread Starter

cnguyen

Joined Oct 19, 2009
6
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.
 

odinhg

Joined Jul 22, 2009
65
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.
 

Attachments

Top