Of Pump Commands To Dasnet Frames - Teledyne D series Installation And Operation Manual

Table of Contents

Advertisement

D Series Syringe Pumps
Section 8 Serial Interface
Table 8-5 Example of a Visual C++ program to demonstrate conversion
// visual C++ version 10.0
// Dasnet.cpp : Defines the entry point for the console application.
// A 'C, C++' example of DASNET serial control
#include "stdafx.h"
#include <windows.h>
#include<stdio.h>
#include<conio.h>
#include<string.h>
void commOpen(int port, long speed);
void conv_das(char *, char *);
void dgets(char *);
void dputs(char *);
void comm_putc(char);
int comm_getc(void);
BOOL GetCTS (void);
char unitnum;
HANDLE hCom;
DCB dcbSerialParams;
int _tmain(int argc, _TCHAR* argv[]) // console appication
{
int commport;
long speed;
char in[512],out[512];
// printf("Starting Program");
printf("Enter Unit ID=");
scanf_s("%d",&unitnum);
printf("Enter Comm port=");
scanf_s("%d",&commport);
printf("Enter Baud Rate=");
scanf_s("%ld",&speed);
fflush(stdin); //clear stdin buffer
commOpen(commport,speed);
while(1)
{
_cputs("\n\rString(Q TO Quit) >>>");
gets_s(in,200);
_strupr_s(in); /*convert to upper case */
if(in[0]=='Q') break;
conv_das(in,out);
_cputs("Dasnet Output >>>");
puts(out);
//printf("\nWriting to serial port");
dputs(out);
_strset_s(out,256,0);
dgets(out);
printf("Dasnet Response>>%s\n",out);
}
8-10

of pump commands to DASNET frames

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

30d100dx65d260d500d1000d ... Show all

Table of Contents