Subversion Repositories f9daq

Compare Revisions

Ignore whitespace Rev 312 → Rev 311

/cvi/instr/K2231A/K2231A.c
12,8 → 12,8
 
char response[0xFF]= {0};
 
int K2231A_SetDebug(int x){ debug = x;return 0;};
 
 
int K2231A_Write(const char *format, ... )
{
char cmd[0xFF];
75,16 → 75,11
return atof(K2231A_Read(cmd ));
}
 
static int K2231A_Port=5;
int K2231A_SetPort(int x){K2231A_Port=x; return x;};
 
int K2231A_Initialize()
{
 
istat = viOpenDefaultRM (&RMHandle);
char cport[0xFF];
sprintf(cport,"ASRL%d::INSTR", K2231A_Port );
if (RMHandle) istat = viOpen (RMHandle, cport , VI_NULL, VI_NULL, &DeviceHandle);
if (RMHandle) istat = viOpen (RMHandle, "ASRL5::INSTR", VI_NULL, VI_NULL, &DeviceHandle);
if (DeviceHandle)
{
 
151,11 → 146,11
}
 
double K2231A_SetCurrent(double x){
return K2231A_Write("CURR %f", x);
return K2231A_QueryDouble("CURR %f", x);
}
 
double K2231A_SetVoltage(double x){
return K2231A_Write("VOLT %f", x);
return K2231A_QueryDouble("VOLT %f", x);
}
 
double K2231A_GetCurrentMonitor(){
/cvi/instr/K2231A/K2231A.h
19,8 → 19,7
int K2231A_GetOperationMode();
int K2231A_SetSwitch(int state);
int K2231A_GetSwitch();
int K2231A_SetDebug(int x);
int K2231A_SetPort(int x);
 
void K2231A_ReadMonitorValues(double * I , double * V, unsigned char * mode, unsigned char *onoff);
void K2231A_ReadSetValues(double * I , double * V, unsigned char *onoff);