|
Last change
on this file was
34,
checked in by markus, 7 years ago
|
|
Adding all debug tools and traces
|
-
Property svn:executable set to
*
|
|
File size:
1.7 KB
|
| Rev | Line | |
|---|
| [34] | 1 | #!/usr/bin/perl -w |
|---|
| 2 | $| = 1; |
|---|
| 3 | my $xxxCmd = "sigrok-cli --driver=uni-t-ut61b:conn=1.9 -O analog --samples=1"; |
|---|
| 4 | #my $measurementDev = "/dev/ttyUSB0"; |
|---|
| 5 | my $measurementDev = "/dev/stdin"; |
|---|
| 6 | die "No measurement device found!" unless (-e $measurementDev); |
|---|
| 7 | my $measurementHnd = undef; |
|---|
| 8 | open($measurementHnd, "< :encoding(UTF-8)", $measurementDev) || die "$0: can't open $$measurementDev for reading: $!"; |
|---|
| 9 | my $xxxVal = 0; |
|---|
| 10 | my $peVal = 0; |
|---|
| 11 | my $a2Val = 0; |
|---|
| 12 | my $a2Trend = 0; |
|---|
| 13 | my $a2Active = 0; |
|---|
| 14 | my $a3Val = 0; |
|---|
| 15 | my $a4Val = 0; |
|---|
| 16 | my $a5Val = 0; |
|---|
| 17 | my $pwmVal = 0; |
|---|
| 18 | my $reqVal = 0; |
|---|
| 19 | my $refVal = 0; |
|---|
| 20 | while (1) { |
|---|
| 21 | ## my $xxxString = `$xxxCmd`; |
|---|
| 22 | # |
|---|
| 23 | # P1: 6.670000 V DC |
|---|
| 24 | # |
|---|
| 25 | ## if ($xxxString =~ /^\s*P1:\s+([0-9\.]+)\s+V\s+\DC.*$/) { |
|---|
| 26 | # $xxxVal = int($1); |
|---|
| 27 | ## $xxxVal = $1; |
|---|
| 28 | while (1) { |
|---|
| 29 | if (<$measurementHnd>) { |
|---|
| 30 | my $measureString = <$measurementHnd>; |
|---|
| 31 | # |
|---|
| 32 | # Time: 2000 Periode: 1 A2: 326.31 A2.Trend: 0.00 A2.Rising: 0 T(A2): 40.02 A3: 318.00 T(A3): 38.51 A4: 622.00 A5: 1.77 PWM: 0 Req: 0.00 Q(A): 0.00 |
|---|
| 33 | # |
|---|
| 34 | if ($measureString =~ /Periode:\s+([0-9]+).*\s+A2:\s+([0-9\.]+).*\sA2\.Trend:\s+([-0-9\.]+).*\s+A2\.Rising:\s+([0-9]+).*\sA3:\s+([0-9\.]+).*\sA4:\s+([0-9\.]+).*\s+A5:\s+([0-9\.]+).*\s+PWM:\s+([0-9]+).*\s+Req:\s+([0-9\.]+).*\s+Q\(A\):\s+([0-9\.]+)/) { |
|---|
| 35 | $peVal = $1; |
|---|
| 36 | $a2Val = $2; |
|---|
| 37 | $a2Trend = $3; |
|---|
| 38 | $a2Active = $4; |
|---|
| 39 | $a3Val = $5; |
|---|
| 40 | $a4Val = $6; |
|---|
| 41 | $a5Val = $7; |
|---|
| 42 | $pwmVal = $8; |
|---|
| 43 | $reqVal = $9; |
|---|
| 44 | $refVal = $10; |
|---|
| 45 | my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime; |
|---|
| 46 | $mon += 1; $year += 1900; |
|---|
| 47 | print "$mday.$mon.$year $hour:$min:$sec;$peVal;$a2Val;$a2Trend;$a2Active;$a3Val;$a4Val;$a5Val;$pwmVal;$reqVal;$refVal;$xxxVal\n"; |
|---|
| 48 | last; |
|---|
| 49 | } else { |
|---|
| 50 | print STDERR "ERROR-2: $measureString\n"; |
|---|
| 51 | } |
|---|
| 52 | } |
|---|
| 53 | } |
|---|
| 54 | ## } else { |
|---|
| 55 | ## print STDERR "ERROR-1: $xxxString\n"; |
|---|
| 56 | ## } |
|---|
| 57 | } |
|---|
Note: See
TracBrowser
for help on using the repository browser.