diff --git a/fhem/CHANGED b/fhem/CHANGED index 032571b0e..94249ed80 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,10 @@ # Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # Do not insert empty lines here, update check depends on it. + - bugfix: 44_S7_ARead: event-on-change-reading + - bugfix: 44_S7_AWrite: event-on-change-reading + - bugfix: 44_S7_DRead: event-on-change-reading + - bugfix: 44_S7_DWrite: event-on-change-reading + - bugfix: 44_S7_S5Client.pm: loading serial modul - change: 89_FULLY: on-timer implemented - change: 77_SMAEM: V3.0.1, use abort cause of BlockingCall - change: 93_Log2Syslog: V3.2.0, add NOTIFYDEV (if possible) diff --git a/fhem/FHEM/44_S7_ARead.pm b/fhem/FHEM/44_S7_ARead.pm index 11d34a1ba..215f749c1 100644 --- a/fhem/FHEM/44_S7_ARead.pm +++ b/fhem/FHEM/44_S7_ARead.pm @@ -306,7 +306,7 @@ sub S7_ARead_Parse($$) { } else { Log3 $name, 3, - "$name S7_ARead: Parse unknown type : (" + "$n S7_ARead: Parse unknown type : (" . $h->{DATATYPE} . ")"; } @@ -333,7 +333,7 @@ sub S7_ARead_Parse($$) { my @a; if($attreocr) { @a = split(/,/,$attreocr); - $hash->{".attreocr"} = \@a; + $h->{".attreocr"} = \@a; } # determine whether the reading is listed in any of the attributes my @eocrv; @@ -350,7 +350,7 @@ sub S7_ARead_Parse($$) { if($myI =~ m/([\d\.\-eE]+)/ && looks_like_number($1)) { #41083, #62190 my $mv = $1; - my $last_value = $hash->{".attreocr-threshold$reading"}; + my $last_value = $h->{".attreocr-threshold$reading"}; if( !defined($last_value) ) { $h->{".attreocr-threshold$reading"} = $mv; } elsif( abs($mv - $last_value) < $threshold ) { diff --git a/fhem/FHEM/44_S7_AWrite.pm b/fhem/FHEM/44_S7_AWrite.pm index ff61cd6dd..899508c06 100644 --- a/fhem/FHEM/44_S7_AWrite.pm +++ b/fhem/FHEM/44_S7_AWrite.pm @@ -475,7 +475,7 @@ sub S7_AWrite_Parse($$) { my @a; if($attreocr) { @a = split(/,/,$attreocr); - $hash->{".attreocr"} = \@a; + $h->{".attreocr"} = \@a; } # determine whether the reading is listed in any of the attributes my @eocrv; @@ -492,7 +492,7 @@ sub S7_AWrite_Parse($$) { if($myI =~ m/([\d\.\-eE]+)/ && looks_like_number($1)) { #41083, #62190 my $mv = $1; - my $last_value = $hash->{".attreocr-threshold$reading"}; + my $last_value = $h->{".attreocr-threshold$reading"}; if( !defined($last_value) ) { $h->{".attreocr-threshold$reading"} = $mv; } elsif( abs($mv - $last_value) < $threshold ) { diff --git a/fhem/FHEM/44_S7_DRead.pm b/fhem/FHEM/44_S7_DRead.pm index 35beeabe1..5095b34ed 100644 --- a/fhem/FHEM/44_S7_DRead.pm +++ b/fhem/FHEM/44_S7_DRead.pm @@ -402,7 +402,7 @@ sub S7_DRead_Parse($$) { my @a; if($attreocr) { @a = split(/,/,$attreocr); - $hash->{".attreocr"} = \@a; + $h->{".attreocr"} = \@a; } # determine whether the reading is listed in any of the attributes my @eocrv; @@ -419,7 +419,7 @@ sub S7_DRead_Parse($$) { if($valueText =~ m/([\d\.\-eE]+)/ && looks_like_number($1)) { #41083, #62190 my $mv = $1; - my $last_value = $hash->{".attreocr-threshold$reading"}; + my $last_value = $h->{".attreocr-threshold$reading"}; if( !defined($last_value) ) { $h->{".attreocr-threshold$reading"} = $mv; } elsif( abs($mv - $last_value) < $threshold ) { diff --git a/fhem/FHEM/44_S7_DWrite.pm b/fhem/FHEM/44_S7_DWrite.pm index 1918aa2d0..a51444581 100644 --- a/fhem/FHEM/44_S7_DWrite.pm +++ b/fhem/FHEM/44_S7_DWrite.pm @@ -478,7 +478,7 @@ sub S7_DWrite_setABit($$) { my @a; if($attreocr) { @a = split(/,/,$attreocr); - $hash->{".attreocr"} = \@a; + $h->{".attreocr"} = \@a; } # determine whether the reading is listed in any of the attributes my @eocrv; @@ -495,7 +495,7 @@ sub S7_DWrite_setABit($$) { if($valueText =~ m/([\d\.\-eE]+)/ && looks_like_number($1)) { #41083, #62190 my $mv = $1; - my $last_value = $hash->{".attreocr-threshold$reading"}; + my $last_value = $h->{".attreocr-threshold$reading"}; if( !defined($last_value) ) { $h->{".attreocr-threshold$reading"} = $mv; } elsif( abs($mv - $last_value) < $threshold ) { diff --git a/fhem/FHEM/44_S7_S5Client.pm b/fhem/FHEM/44_S7_S5Client.pm index 37e5210ef..2cb10063d 100644 --- a/fhem/FHEM/44_S7_S5Client.pm +++ b/fhem/FHEM/44_S7_S5Client.pm @@ -477,13 +477,14 @@ sub S5ConnectPLCAS511($$) { my $b1 = ""; my $ttyPort; - if ($^O=~/Win/) { - eval ("use Win32::SerialPort;"); + if($^O =~ m/Win/) { + require Win32::SerialPort; + #eval ("use Win32::SerialPort;"); $self->{serial} = new Win32::SerialPort ($portName); }else{ - eval ("use Device::SerialPort;"); + #eval ("use Device::SerialPort;"); + require Device::SerialPort; $self->{serial} = new Device::SerialPort ($portName); - } main::Log3( undef, 3, "Can't open serial port $portName" ) diff --git a/fhem/FHEM/44_S7_S7Client.pm b/fhem/FHEM/44_S7_S7Client.pm index f94e94a1a..6eb0865fb 100644 --- a/fhem/FHEM/44_S7_S7Client.pm +++ b/fhem/FHEM/44_S7_S7Client.pm @@ -334,7 +334,7 @@ sub new { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ); $self->{PDU}->{DATA} = ""; - + $self->{TCPClient} = undef; return bless $self, $class; }