Problem Serial.available() = 0, ( SOLVED )

hi, i always control arduino via serial without problem. but I changed my pc, and i cant send data from pc to arduino, and now when I do it I always obtain "Serial.available() = 0" even with the most basic program to do it i obtain "Serial.available() = 0"

void setup() { 
void loop() {       
    if (Serial.available() > 0) {
            Serial.println("serial is not available");

i always obtain "serial is not available" in my new pc, i return to the old pc and works perfect

can any help me? thanks!

You need to send data to it for any other result. Serial.available() only returns the number of bytes in the receive buffer, not weather the serial functionality is available.

i always send data from monitor serial or matlab to arduino, but now these data are not read. obviously i erase this line

 Serial.println("serial is not available");

in my programs

What baud rate is the Serial monitor set to ?

9600 also

i think that my PC have a driver problem, but i can send data via serial using serial.print from arduino to PC.

I solved it! at left "blaud rate" in monitor serial I select "carriage return". thanks!

That does not make any sense.
What you have done is to tell the Serial monitor to append a Carriage Return to the text sent to the Arduino, but the code that you posted does not rely on the CR being present.