Moxa DA-710-LX Руководство по программной части (Windows) онлайн [34/69] 170782

Moxa DA-710-LX Руководство по программной части (Windows) онлайн [34/69] 170782
DA-710 XPE User’s Manual Software Configuration
#include "stdafx.h"
#include <windows.h>
#include "..\release\devices.h"
char mode_array[][20]={"RS232", "RS485-2W", "RS422","RS485-4W"};
int _tmain(int argc, _TCHAR* argv[])
{
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 (3,4...) = \n");
wscanf(L"%s",wcs_port);
port=_wtoi(wcs_port);
mode=uart_getmode(port);
printf("COM%d=%s\n",port,mode_array[mode]);
break;
// if char == '2', Set the UART Mode
case 2:
2-23

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

Скачать