Arduino won't understand byte from COM port

Hello, I'm sending byte to board via FTD2XX.DLL, the example was taken from FTDI site: http://www.ftdichip.com/Support/SoftwareExamples/CodeExamples/Delphi/d2xxappl.zip
Sketch:

void setup(){
  Serial.begin(9600);
  pinMode(13,OUTPUT);
  digitalWrite(13,HIGH);
}
void loop() {
  char mode;
  if (Serial.available()) {
    mode=Serial.read();
    if(mode=='1') digitalWrite(13,HIGH);
    if(mode=='0') digitalWrite(13,LOW);
  }
}

The problem is that mode variable is not '0' or '1' until byte sended via Serial monitor. If I send from it, all working OK, but if I run program from example without launching Serial monitor first, Arduino may receive totally random value from program. If my program needs some kind of device reset, how to do it? Calling Reset_USB_Device; procedure from D2XXunit library gives no effect.

You haven't mentioned what operating system you are using. That matters.

Hello, I'm sending byte to board via FTD2XX.DLL,

I'm not familiar with this application, and I'm not going to run something I know nothing about. What control do you have over how the serial port is set up? It sounds like something is not being set up correctly. Opening the Serial Monitor corrects the mismatch, and allows the program to then correctly send data.

The issue is solved.
configuration form of example did assign FTDI device driver variables, but didn't call routines to set them.
Setup of default mode should look as this:

Reset_USB_Device;
Set_USB_Device_RTS;
Set_USB_Device_DTR;
FT_Current_Baud := FT_BAUD_9600;
Set_USB_Device_BaudRate;
FT_Current_DataBits := FT_DATA_BITS_8;
FT_Current_StopBits := FT_STOP_BITS_1;
FT_Current_Parity := FT_PARITY_NONE;
Set_USB_Device_DataCharacteristics;
FT_Current_FlowControl := FT_FLOW_NONE;
Set_USB_Device_FlowControl;
Set_USB_Device_TimeOuts(500,500);

These lines need to be put after opening device.