diff --git a/src/io/piconnection.cpp b/src/io/piconnection.cpp index 904dfb2a..58c79de9 100755 --- a/src/io/piconnection.cpp +++ b/src/io/piconnection.cpp @@ -861,6 +861,7 @@ int PIConnection::write(PIIODevice * dev, const PIByteArray & data) { piCoutObj << "Null Device!"; return -1; } + if (!dev->isOpened()) return -1; if (!dev->canWrite()) { piCoutObj << "Device \"" << dev->constructFullPath() << "\" can`t write!"; return -1;