EasyManua.ls Logo

Stanford Research Systems PS310 - Page 21

Stanford Research Systems PS310
42 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
19
Program Example 2:
IBM PC, Microsoft C V4.0, Via GPIB
This program requires the Capital Equipment Corporation GPIB card for the IBM PC. It has firmware in ROM
to interface high level languages to the GPIB.
The header file MS-C488.H contains definitions of all of the CEC firmware routines which can be called from
C. Note that the order of arguments in the calls are reversed from those used by BASIC.
To use these routines, the large model must be used. Compile with the /AL/Ze switch and link with GPIB-
L.OBJ (on the CEC disk).
/* Compile with >MSC program name/AL/Ze;
link with GPIB-L.OBJ (on CEC disk)
include MS-C488.H
MS-C488.H defines all of the CEC firmware routines so that they
can be called from a C program. Remember that the order of the
arguments is REVERSED from the BASIC calls described in the manual.
Example program to ramp the PS300 output and read the current
using Microsoft C v4.0 (large model) and the Capital
Equipment Corp. GPIB interface card.
Set the PS300 for GPIB ADDR=23.
*/
#include <ms-c488.h>
#include <stdio.h>
char result[80];
main()
{
int i,status,ps300=23;
int my_address=21, system_controller=0;
char cmd[80], vstr[40];
float n;
float x;
initialize(&system_controller, &my_address); /* init GPIB controller */
/* clear interface */
transmit(&status, "IFC UNT UNL REN MTA LISTEN 23 SDC");
Statcheck(status);
/* reset PS300 */
TxGpib(ps300,"*RST");
x = 0; /* initial output value */
/* enable HV */
TxGpib(ps300,"HVON");
while (x<1000.0)

Table of Contents

Related product manuals