|
|
@@ -33,12 +33,17 @@ int gpib_addr(int fd, int addr) |
|
|
|
|
|
|
|
int keithley_init(int fd) |
|
|
|
{ |
|
|
|
float i; |
|
|
|
gput(":syst:beep:stat 1"); |
|
|
|
gput(":sour:func:mode curr"); |
|
|
|
gput(":sour:del 0"); |
|
|
|
gput(":sour:curr 0"); |
|
|
|
gput(":sour:curr:range:auto on"); |
|
|
|
gput(":outp on"); |
|
|
|
drain(fd); |
|
|
|
i = keithley_read(fd); |
|
|
|
if (isnan(i)) |
|
|
|
return -1; |
|
|
|
return 0; |
|
|
|
} |
|
|
|
|
|
|
@@ -56,7 +61,7 @@ float keithley_read(int fd) |
|
|
|
float i, dummy; |
|
|
|
gputv("read?", NAN); |
|
|
|
gputv("++read", NAN); |
|
|
|
if (fdgets(s, 128, fd, 1000) == NULL) |
|
|
|
if (fdgets(s, 128, fd, 2000) == NULL) |
|
|
|
return NAN; |
|
|
|
if (sscanf(s, "%f,%f,", &dummy, &i) != 2) |
|
|
|
return NAN; |
|
|
|