|
|
@@ -12,6 +12,7 @@ |
|
|
|
#include <err.h> |
|
|
|
#include <linux/serial.h> |
|
|
|
#include <sys/signal.h> |
|
|
|
#include <sys/time.h> |
|
|
|
#include "serial-util.h" |
|
|
|
#include "gpib.h" |
|
|
|
#include "zoom.h" |
|
|
@@ -103,6 +104,7 @@ void write_random(int zoom, int gpib) |
|
|
|
{ |
|
|
|
int dac; |
|
|
|
double meas; |
|
|
|
struct timeval now; |
|
|
|
|
|
|
|
info("Initializing Zoom NILM\n"); |
|
|
|
if (zoom_init_nozero(zoom) < 0) goto fail; |
|
|
@@ -118,10 +120,10 @@ void write_random(int zoom, int gpib) |
|
|
|
info("Running\n"); |
|
|
|
while (!g_quit) { |
|
|
|
dac = genrand_int32() & 0x3ff; |
|
|
|
zoom_write_dac(zoom, dac); |
|
|
|
gettimeofday(&now, NULL); |
|
|
|
meas = keithley2002_read(gpib); |
|
|
|
if (isnan(meas)) |
|
|
|
goto fail; |
|
|
|
printf("%d %.12f\n", dac, meas); |
|
|
|
printf("%ld.%06ld %d %.12f\n", now.tv_sec, now.tv_usec, dac, meas); |
|
|
|
} |
|
|
|
|
|
|
|
safecleanup: |
|
|
|