Teledyne D series Installation And Operation Manual page 167

Table of Contents

Advertisement

Table 8-5 Example of a Visual C++ program to demonstrate conversion
of pump commands to DASNET frames (Continued)
Sleep(2000);
exit(1);
}
switch(speed)
{
case 19200:
dcbSerialParams.BaudRate=CBR_19200;
break;
case 38400:
dcbSerialParams.BaudRate=CBR_38400;
break;
case 57600:
dcbSerialParams.BaudRate=CBR_57600;
break;
case 115200:
dcbSerialParams.BaudRate=CBR_115200;
break;
default:
case 9600:
dcbSerialParams.BaudRate=CBR_9600;
break;
}
dcbSerialParams.ByteSize=8;
dcbSerialParams.StopBits=ONESTOPBIT;
dcbSerialParams.Parity=NOPARITY;
if(!SetCommState(hCom, &dcbSerialParams))
{
//error setting serial port state
printf("Setting Comm port state failed");
Sleep(2000);
exit(1);
}
//timeouts
COMMTIMEOUTS timeouts={0};
timeouts.ReadIntervalTimeout=100;
timeouts.ReadTotalTimeoutConstant=100;
timeouts.ReadTotalTimeoutMultiplier=100;
//timeouts.WriteTotalTimeoutConstant=50;
//timeouts.WriteTotalTimeoutMultiplier=10;
if(!SetCommTimeouts(hCom, &timeouts))
{
//error occureed. Inform user
printf("Setting Comm port timeouts failed");
Sleep(2000);
exit(1);
}
}
printf("\nComm intr installed");
}
int comm_getc ()
{
DWORD dwBytesRead = 0;
D Series Syringe Pumps
Section 8 Serial Interface
8-13

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

30d100dx65d260d500d1000d ... Show all

Table of Contents