Serial Connection

I'm trying to establish a serial connection between my Arduino Uno and LabVIEW. I have written a LabVIEW program that sends a string of "0" or "1" over the serial connection. I want the Arduino to turn on an LED when it sees the "1" string, however the LED is not lighting up and I'm having trouble identifying the problem. Does it look like my code has been written correctly?

int serialreading = 0;

void setup()
{
Serial.begin(9600);
pinMode(3, OUTPUT);
}

void loop() {
if (Serial.available() > 0)
{
serialreading = Serial.read();

if (serialreading != '0')
digitalWrite(3, HIGH);

if (serialreading == '0')
digitalWrite(3, LOW);
}
}

What exactly is your Labview sending?

Here is the labview file. I believe that it is sending a string of either 0's or 1's.

ArduinoLED_Test.vi (13.6 KB)

Here is the labview file.

As something we can read would be even better...

I believe that it is sending a string of either 0's or 1's.

Belief may cut it in church, but here we need something a little more concrete.

Does it send a string of 0s and 1s, or a string of '0's and '1's ?

I am sending a string of characters -- either zero or one.

Are you sending zeros and ones or the ASCII representation of zero and one?

I have modified the LabVIEW program. It now sends bytes of value 0 or 1.

have modified the LabVIEW program. It now sends bytes of value 0 or 1.

But your Arduino sketch above is looking for ASCII '0' (0x30).