National Instruments GPIB-MAC User Manual page 137

Table of Contents

Advertisement

November 1985
Appendix I
Serial Port Sample Program
This appendix contains a sample program that contains code to
control the serial port of the Macintosh from a C program. It is
provided to demonstrate how to write your own serial I/O routines if
the language you are using does not already provide them..
Sample Program
send.c g-30-85 JR.
:bk=O;
Purpose:
This program is designed to send a text file
containing commands and data to the GPIB-MAC.
The program was compiled with Manx Aztec C-68K 106.F.
The data file is read into memory once, then sent to the
l
*
serial driver in a loop.
Programming languages such as MacBasic and MacPascal
have too much overhead to send data faster than 19200
baud.
#include <quickdraw.h>
#include <pb.h>
#include <stdio.h>
#include <serial.h>
#include <memory.h>
#include <event.h>
#include <inits.h>
#include <packages.h> /* File Package l /
#include <textEdit.h> /* textbox */
#define FALSE 0
main0
short refAOut, refAIn;
char l pBufIn;
int rc;
result code */
int inLen = (1<<13);
127
APPENDIX I - SERIAL PORT SAMPLE PROGRAM
Send file out modem port, fast.

Advertisement

Table of Contents
loading

Table of Contents