Moxa V2401-LX Руководство по программной части (Windows) онлайн [22/61] 170747

Moxa V2402-T-XPE Руководство по программной части (Windows) онлайн [22/61] 170753
V2401/2402 WinXP User’s Manual Introduction
1-19
Also, you can set the operation mode by programming; the example “UartMode” can be found in
\examples\C++\ of the Software DVD.
The code snippet is as follows:
int port=0,mode=0;
int n=0;
WCHAR sin;
WCHAR wcs_port[3],wcs_mode[3];
printf("UART Mode Test Program\n");
printf("\t (0) Exit Program\n");
printf("\t (1) Display UART Mode\n");
printf("\t (2) Set UART Mode\n");
sin=getwchar();
n=_wtoi(&sin);
do
{
switch (n)
{
// if char == '1', display the UART Mode
case 1:
printf("Input the Port Number (1~4) = \n");
wscanf(L"%s",wcs_port);
port=_wtoi(wcs_port);
mode=uart_getmode(port);
if(mode==(-1))
{

Похожие устройства

Скачать