|
@@ -284,7 +284,12 @@ Error_manager Snap7_communication_base::read_data_buf(Snap7_buf& snap7_buf)
|
|
|
// std::this_thread::sleep_for(std::chrono::milliseconds(10));
|
|
|
if ( result == 0 )
|
|
|
{
|
|
|
- m_snap7_client.WaitAsCompletion(100);
|
|
|
+ result = m_snap7_client.WaitAsCompletion(100);
|
|
|
+ if ( result !=0 )
|
|
|
+ {
|
|
|
+ return Error_manager(Error_code::SNAP7_READ_ERROR, Error_level::MINOR_ERROR,
|
|
|
+ " Snap7_communication_base::read_data_buf error ");
|
|
|
+ }
|
|
|
//倒序数据 转为 正序数据
|
|
|
snap7_buf.reverse_to_obverse();
|
|
|
}
|
|
@@ -319,7 +324,12 @@ Error_manager Snap7_communication_base::write_data_buf(Snap7_buf& snap7_buf)
|
|
|
// std::this_thread::sleep_for(std::chrono::milliseconds(10));
|
|
|
if ( result == 0 )
|
|
|
{
|
|
|
- m_snap7_client.WaitAsCompletion(100);
|
|
|
+ result = m_snap7_client.WaitAsCompletion(100);
|
|
|
+ if ( result !=0 )
|
|
|
+ {
|
|
|
+ return Error_manager(Error_code::SNAP7_WRITE_ERROR, Error_level::MINOR_ERROR,
|
|
|
+ " Snap7_communication_base::write_data_buf error ");
|
|
|
+ }
|
|
|
}
|
|
|
else
|
|
|
{
|