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,11 → 75,16 |
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); |
if (RMHandle) istat = viOpen (RMHandle, "ASRL5::INSTR", VI_NULL, VI_NULL, &DeviceHandle); |
char cport[0xFF]; |
sprintf(cport,"ASRL%d::INSTR", K2231A_Port ); |
if (RMHandle) istat = viOpen (RMHandle, cport , VI_NULL, VI_NULL, &DeviceHandle); |
if (DeviceHandle) |
{ |
|
146,11 → 151,11 |
} |
|
double K2231A_SetCurrent(double x){ |
return K2231A_QueryDouble("CURR %f", x); |
return K2231A_Write("CURR %f", x); |
} |
|
double K2231A_SetVoltage(double x){ |
return K2231A_QueryDouble("VOLT %f", x); |
return K2231A_Write("VOLT %f", x); |
} |
|
double K2231A_GetCurrentMonitor(){ |