i'm ok with with changing ComPort parameters in W2K.
but i'd like to change them in the code like this:
com.LoadParam();
com.DataBits:=5; //or com.DataBits(5);
com.baudrate:=9600;
com.SaveParam();
But when i call com.ShowParam()
DataBits or BaudRate field is empty.
Is there any possibility to change them directly from a code.
0
Comments
LoadParam() - you don't need this, becouse it loads all settings from registry;
You must use this values for:
Baud rate:
0:110;
1:300;
2:600;
3:1200;
4:2400;
5:4800;
6:9600;
7:19200;
8:38400;
9:57600;
10:115200;
Data bits:
0:4;
1:5;
2:6;
3:7;
4:8;
Com port (ComX):
0:com1;
1:com2;
2:com3;
3:com4;
Parity:
0:None;
1:Odd;
2:Even;
3:Mark;
4:Space;
Stop bits:
0:1;
1:1.5;
2:2;
So 9600,8,n,1 are:
BaudRate:=6;
DataBits:=4;
Parity:=0;
StopBits:=0;
Setup is complete, you can it store to registry
SaveParam();
Then you will run communication to loa these settings use only LoadParam()
Dalius