EasyManuals Logo

Pendulum CNT-91R Programmer's Handbook

Default Icon
264 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #47 background imageLoading...
Page #47 background image
USB Communication (Ex. #4)
#include “stdio.h”
#include “visa.h”
#include <time.h>
#define MAX_CNT 200
void Sleep( clock_t Wait );
int main(void)
{
ViStatus Status; // For checking errors
ViUInt32 RetCount; // Return count from string I/O
ViChar Buffer[MAX_CNT]; // Buffer for string I/O
ViFindList fList;
ViChar Desc[VI_FIND_BUFLEN];
ViUInt32 numInstrs;
ViSession defaultRM, Instr;
inti=0;
// Begin by initializing the system
Status = viOpenDefaultRM(&defaultRM);
if (Status < VI_SUCCESS) {
printf (“Failed to initialise NI-VISA system.\n”);
return -1;
}
// Look for something made by Pendulum
Status = viFindRsrc(defaultRM,
“USB?*INSTR{VI_ATTR_MANF_ID==0x14EB}”,
&fList, &numInstrs, Desc);
if (Status < VI_SUCCESS) {
printf (“No matching instruments found.\n”);
return -1;
}
// Open communication with GPIB Device
Status = viOpen(defaultRM, Desc, VI_NULL, VI_NULL, &Instr);
if (Status < VI_SUCCESS) {
printf (“Cannot communicate with instrument.\n”);
return -1;
}
// Set the timeout for message-based communication
Status = viSetAttribute(Instr, VI_ATTR_TMO_VALUE, 1000);
// Ask the device for identification
Programming Examples
USB Communication (Ex. #4) 4-11

Table of Contents

Other manuals for Pendulum CNT-91R

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Pendulum CNT-91R and is the answer not in the manual?

Pendulum CNT-91R Specifications

General IconGeneral
BrandPendulum
ModelCNT-91R
CategoryMeasuring Instruments
LanguageEnglish

Related product manuals