EasyManuals Logo

Siemens M20 Terminal User Manual

Siemens M20 Terminal
234 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #189 background imageLoading...
Page #189 background image
Application notes
Version 8 dated 15.03.00 189
Siemens Information and Communication Products
A
8.4.2.14 int SetCommState(lpdcb)
const DCB FAR* lpdcb; /* address of device control block */
The SetCommState function sets a communications device to the state specified by a device control block.
int SetCommState(lpdcb)
Parameter Description
lpdcb Indicates a DCB structure that contains the desired communications settings for the device. The
ID member of the DCB structure must identify the device.
Return value 0 if the function is successful.
Otherwise < 0
Example The following example uses the BuildCommDCB and SetCommState functions to set up COM1
at 9600 baud, no parity, 8 data bits, and 1 stop bit:
idComDev = OpenComm("COM1", 1024, 128);
if (idComDev < 0)
{ ShowError(idComDev, "OpenComm");
return 0;
}
err = BuildCommDCB("COM1:9600,n,8,1", &dcb);
if (err < 0)
{ ShowError(err, "BuildCommDCB");
return 0;
}
err = SetCommState(&dcb);
if (err < 0)
{ ShowError(err, "SetCommState");
return 0;
}
Comments This function reinitializes all hardware and controls as defined by the DCB structure, but it does
not empty transmission or receiving queues.
See also GetCommState, DCB

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Siemens M20 Terminal and is the answer not in the manual?

Siemens M20 Terminal Specifications

General IconGeneral
BrandSiemens
ModelM20 Terminal
CategoryEngine
LanguageEnglish

Related product manuals