How To Add More Then One Variable from Labview to Arduino?

Arduino reads only the first serial , how can i let it reads the whole serials?:frowning:
as shown here it only reads and light the first one which is in pin 7 and it does not response at all to what in pin 8
i send data from labview

void setup() {

pinMode(7,OUTPUT);
pinMode(8,OUTPUT);
  Serial.begin(9600);
}

void loop()
{
  int val = Serial.read();
  int val2 = Serial.read();
  
  if (val == '1')
  
  digitalWrite(7,HIGH);
 
  else if (val == '2')
     
   digitalWrite(7,LOW);
   
   if (val2 == '3')
   
   digitalWrite(8,HIGH);

   else if (val2 == '4')
   
   digitalWrite(8,LOW);
  
}

Please post your entire sketch, in code tags.

aarg:
Please post your entire sketch, in code tags.

done and i added 2 screenshots one from labview diagram and other for arduino code

The serial input basics thread has very good information on how to read data from a serial port.

Just use 'val' only and ditch 'val2'