r4181 - developers/werner/ahrt/host/usbtmc
werner at sita.openmoko.org
werner at sita.openmoko.org
Sat Mar 8 22:35:44 CET 2008
Author: werner
Date: 2008-03-08 22:35:40 +0100 (Sat, 08 Mar 2008)
New Revision: 4181
Modified:
developers/werner/ahrt/host/usbtmc/README
developers/werner/ahrt/host/usbtmc/usbtmc.c
Log:
README: described multiple trigger bug (?) and work-around
README: corrected description of -r (it only repeats the last command, not the
entire sequence)
usbtmc.c (main): new option -e to repeat the last command indefinitely
Modified: developers/werner/ahrt/host/usbtmc/README
===================================================================
--- developers/werner/ahrt/host/usbtmc/README 2008-03-08 21:00:02 UTC (rev 4180)
+++ developers/werner/ahrt/host/usbtmc/README 2008-03-08 21:35:40 UTC (rev 4181)
@@ -52,9 +52,13 @@
By default, usbtmc waits forever for a response.
-Reponses normally end with a newline. This can be suppressed with the
-option -n. Note that this applies to all responses. E.g.,
+The option -e repeats the last command indefinitely. (See below.)
+
+Reponses are normally printed with a newline at their end. This can be
+suppressed with the option -n. Note that this applies to all responses.
+E.g.,
+
usbtmc -n 'DISP:TEXT "foo"' 'DISP:TEXT?' 'DISP:TEXT?'
will yield
@@ -76,10 +80,21 @@
transactions. Executing commands does not seem to be affected, e.g., a
loop of SYST:BEEP will not have pauses.
-As a work-around, we have the option -r that retries the entire command
-sequence if a timeout occurs.
+As a work-around, we have the option -r that retries the last command if
+a timeout occurs.
+Multiple trigger bug
+--------------------
+
+The PicoTest M3500 does not seem to respond to multiple triggers
+(TRIG:COUN <n> or TRIG:COUN INF) like a Fluke 8845A does, i.e., it only
+executes the trigger once.
+
+As a work-around, the last command can be repeated indefinitely with the
+option -e. E.g., usbtmc -e ... 'READ?'
+
+
Known problems and missing features
-----------------------------------
Modified: developers/werner/ahrt/host/usbtmc/usbtmc.c
===================================================================
--- developers/werner/ahrt/host/usbtmc/usbtmc.c 2008-03-08 21:00:02 UTC (rev 4180)
+++ developers/werner/ahrt/host/usbtmc/usbtmc.c 2008-03-08 21:35:40 UTC (rev 4181)
@@ -426,10 +426,11 @@
static void usage(const char *name)
{
fprintf(stderr,
-"usage: %s [-D] [-r] [-n] [-f] [-t timeout] [-v vendor_id]\n"
+"usage: %s [-D] [-r] [-n] [-e] [-f] [-t timeout] [-v vendor_id]\n"
" %*s [-p product_id] [-b bus_number] [-d device_number] command ...\n\n"
" -b bus_number USB bus number (8 bit)\n"
" -d device_number USB device number (8 bit)\n"
+" -e repeat last command endlessly\n"
" -D enable debug output\n"
" -n do not end reponses with a newline\n"
" -p product_id USB product identifier (16 bit)\n"
@@ -449,9 +450,9 @@
int c, i;
char *end;
unsigned long tmp;
- int nl = 1, retry = 0;
+ int nl = 1, retry = 0, endless = 0;
- while ((c = getopt(argc, argv, "b:d:Dnp:rt:v:")) != EOF)
+ while ((c = getopt(argc, argv, "b:d:eDnp:rt:v:")) != EOF)
switch (c) {
case 'b':
tmp = strtoul(optarg, &end, 0);
@@ -468,6 +469,9 @@
case 'D':
debug = 1;
break;
+ case 'e':
+ endless = 1;
+ break;
case 'n':
nl = 0;
break;
@@ -515,6 +519,10 @@
buf[got] = 0;
printf("%s%s", buf, nl ? "\n" : "");
}
+ if (endless && i == argc-1) {
+ fflush(stdout);
+ goto again;
+ }
}
return 0;
More information about the commitlog
mailing list