2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-07 12:58:13 +00:00

S7: AWrite fix for S7-200 and S7-300 (charlie71)

git-svn-id: https://svn.fhem.de/fhem/trunk@10597 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
charlie71born 2016-01-22 17:29:35 +00:00
parent f9f3424614
commit 2d4a2d99f3

View File

@ -236,31 +236,23 @@ sub S7_AWrite_Set($@) {
} }
elsif ( $datatype eq "u16" ) { elsif ( $datatype eq "u16" ) {
$b = $shash->{S7TCPClient}->setWordAt( "XX", 0, $newValue ); $b = $shash->{S7TCPClient}->setWordAt( "XX", 0, $newValue );
$WordLen = &S7Client::S7WLInt; $WordLen = &S7Client::S7WLByte;
# $WordLen = &S7Client::S7WLWord;
} }
elsif ( $datatype eq "s16" ) { elsif ( $datatype eq "s16" ) {
$b = $shash->{S7TCPClient}->setIntegerAt( "XX", 0, $newValue ); $b = $shash->{S7TCPClient}->setIntegerAt( "XX", 0, $newValue );
$WordLen = &S7Client::S7WLInt; $WordLen = &S7Client::S7WLByte;
# $WordLen = &S7Client::S7WLWord;
} }
elsif ( $datatype eq "u32" ) { elsif ( $datatype eq "u32" ) {
$b = $shash->{S7TCPClient}->setDWordAt( "XXXX", 0, $newValue ); $b = $shash->{S7TCPClient}->setDWordAt( "XXXX", 0, $newValue );
$WordLen = &S7Client::S7WLDInt; $WordLen = &S7Client::S7WLByte;
# $WordLen = &S7Client::S7WLDWord;
} }
elsif ( $datatype eq "s32" ) { elsif ( $datatype eq "s32" ) {
$b = $shash->{S7TCPClient}->setDintAt( "XXXX", 0, $newValue ); $b = $shash->{S7TCPClient}->setDintAt( "XXXX", 0, $newValue );
$WordLen = &S7Client::S7WLDInt; $WordLen = &S7Client::S7WLByte;
# $WordLen = &S7Client::S7WLDWord;
} }
elsif ( $datatype eq "float" ) { elsif ( $datatype eq "float" ) {
$b = $shash->{S7TCPClient}->setFloatAt( "XXXX", 0, $newValue ); $b = $shash->{S7TCPClient}->setFloatAt( "XXXX", 0, $newValue );
$WordLen = &S7Client::S7WLReal; $WordLen = &S7Client::S7WLByte;
} }
else { else {
my $err = "$name S7_AWrite: Parse unknown type : (" . $datatype . ")"; my $err = "$name S7_AWrite: Parse unknown type : (" . $datatype . ")";